diff --git a/CHANGELOG.md b/CHANGELOG.md index ba5accd..a169e9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,13 @@ add a news fragment under `changelog.d/` for every user-facing change. See +## 4.3.0 (2026-07-09) + +### Added + +- On 5xx responses, the SDK now logs the Meraki `X-Request-Id` response header so it can be shared with Meraki to look up the request in server-side logs. If the header is absent, `none` is logged in its place. After retries are exhausted, the request ID is also logged at error level. + + ## 4.2.0b1 (2026-06-10) ### Changed diff --git a/changelog.d/+log-x-request-id-on-5xx.added.md b/changelog.d/+log-x-request-id-on-5xx.added.md deleted file mode 100644 index a242f18..0000000 --- a/changelog.d/+log-x-request-id-on-5xx.added.md +++ /dev/null @@ -1 +0,0 @@ -On 5xx responses, the SDK now logs the Meraki `X-Request-Id` response header so it can be shared with Meraki to look up the request in server-side logs. If the header is absent, `none` is logged in its place. After retries are exhausted, the request ID is also logged at error level. diff --git a/docs/generation-report.md b/docs/generation-report.md index a3710fa..71d3659 100644 --- a/docs/generation-report.md +++ b/docs/generation-report.md @@ -1,5 +1,11 @@ # Generation Report +## 2026-07-09 | Library v4.3.0 | API 1.72.0 + + +No Python keyword parameter conflicts detected. + + ## 2026-07-08 | Library v4.3.0b1 | API 1.72.0-beta.1 diff --git a/meraki/__init__.py b/meraki/__init__.py index f97c9c3..dbd324d 100644 --- a/meraki/__init__.py +++ b/meraki/__init__.py @@ -61,7 +61,7 @@ from meraki._version import __version__ # noqa: F401 from datetime import datetime -__api_version__ = "1.72.0-beta.1" +__api_version__ = "1.72.0" __all__ = [ "APIError", diff --git a/meraki/_version.py b/meraki/_version.py index ad6c0d7..111dc91 100644 --- a/meraki/_version.py +++ b/meraki/_version.py @@ -1 +1 @@ -__version__ = "4.3.0b1" +__version__ = "4.3.0" diff --git a/meraki/aio/api/administered.py b/meraki/aio/api/administered.py index 05b1663..86a4429 100644 --- a/meraki/aio/api/administered.py +++ b/meraki/aio/api/administered.py @@ -67,36 +67,3 @@ def revokeAdministeredIdentitiesMeApiKeys(self, suffix: str): resource = f"/administered/identities/me/api/keys/{suffix}/revoke" return self._session.post(metadata, resource) - - def getAdministeredSearchLive(self, query: str, organizationId: str, networkId: str, **kwargs): - """ - **List the appropriate results for a given global search utilizing live_search_react** - https://developer.cisco.com/meraki/api-v1/#!get-administered-search-live - - - query (string): Search keywords - - organizationId (string): Id of Organization you want to search with - - networkId (string): Id of NodeGroup you want to seach with - """ - - kwargs = locals() - - metadata = { - "tags": ["administered", "configure", "search", "live"], - "operation": "getAdministeredSearchLive", - } - resource = "/administered/search/live" - - query_params = [ - "query", - "organizationId", - "networkId", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getAdministeredSearchLive: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) diff --git a/meraki/aio/api/appliance.py b/meraki/aio/api/appliance.py index d3dcfdb..09c9805 100644 --- a/meraki/aio/api/appliance.py +++ b/meraki/aio/api/appliance.py @@ -34,21 +34,10 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): - personality (object): Describes the port's configurability - uplink (object): The port's settings when in WAN mode - downlink (object): The port's VLAN settings when in LAN mode - - speed (string): Link speed for the port, in Mbps - - duplex (string): Duplex configuration for the port """ kwargs.update(locals()) - if "speed" in kwargs and kwargs["speed"] is not None: - options = ["10", "100", "1000", "10000", "2500", "25000", "5000", "auto"] - assert kwargs["speed"] in options, f'''"speed" cannot be "{kwargs["speed"]}", & must be set to one of: {options}''' - if "duplex" in kwargs and kwargs["duplex"] is not None: - options = ["auto", "full", "half"] - assert kwargs["duplex"] in options, ( - f'''"duplex" cannot be "{kwargs["duplex"]}", & must be set to one of: {options}''' - ) - metadata = { "tags": ["appliance", "configure", "interfaces", "ports", "update"], "operation": "createDeviceApplianceInterfacesPortsUpdate", @@ -62,8 +51,6 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): "personality", "uplink", "downlink", - "speed", - "duplex", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -77,58 +64,6 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): return self._session.post(metadata, resource, payload) - def updateDeviceApplianceInterfacesPort(self, serial: str, number: str, **kwargs): - """ - **Update configurations for an appliance's specified port** - https://developer.cisco.com/meraki/api-v1/#!update-device-appliance-interfaces-port - - - serial (string): Serial - - number (string): Number - - enabled (boolean): Indicates whether the port is enabled - - personality (object): Describes the port's configurability - - uplink (object): The port's settings when in WAN mode - - downlink (object): The port's VLAN settings when in LAN mode - - speed (string): Link speed for the port, in Mbps - - duplex (string): Duplex configuration for the port - """ - - kwargs.update(locals()) - - if "speed" in kwargs and kwargs["speed"] is not None: - options = ["10", "100", "1000", "10000", "2500", "25000", "5000", "auto"] - assert kwargs["speed"] in options, f'''"speed" cannot be "{kwargs["speed"]}", & must be set to one of: {options}''' - if "duplex" in kwargs and kwargs["duplex"] is not None: - options = ["auto", "full", "half"] - assert kwargs["duplex"] in options, ( - f'''"duplex" cannot be "{kwargs["duplex"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["appliance", "configure", "interfaces", "ports"], - "operation": "updateDeviceApplianceInterfacesPort", - } - serial = urllib.parse.quote(str(serial), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/devices/{serial}/appliance/interfaces/ports/{number}" - - body_params = [ - "enabled", - "personality", - "uplink", - "downlink", - "speed", - "duplex", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateDeviceApplianceInterfacesPort: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def getDeviceAppliancePerformance(self, serial: str, **kwargs): """ **Return the performance score for a single Secure Appliance or Secure Router** @@ -1152,7 +1087,6 @@ def createNetworkApplianceInterfacesL3(self, networkId: str, ipv4: dict, **kwarg - networkId (string): Network ID - ipv4 (object): IPv4 configuration - port (object): Port configuration - - vrf (object): VRF assignment for the L3 interface """ kwargs.update(locals()) @@ -1167,7 +1101,6 @@ def createNetworkApplianceInterfacesL3(self, networkId: str, ipv4: dict, **kwarg body_params = [ "port", "ipv4", - "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1188,7 +1121,6 @@ def updateNetworkApplianceInterfacesL3(self, networkId: str, interfaceId: str, * - interfaceId (string): Interface ID - port (object): Port configuration - ipv4 (object): IPv4 configuration - - vrf (object): VRF assignment for the L3 interface """ kwargs.update(locals()) @@ -1204,7 +1136,6 @@ def updateNetworkApplianceInterfacesL3(self, networkId: str, interfaceId: str, * body_params = [ "port", "ipv4", - "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1284,8 +1215,6 @@ def updateNetworkAppliancePort(self, networkId: str, portId: str, **kwargs): - vlan (integer): Native VLAN when the port is in Trunk mode. Access VLAN when the port is in Access mode. - allowedVlans (string): Comma-delimited list of VLAN IDs (e.g. '2,15') for all devices. Secure Routers also support VLAN ranges (e.g. '2-10,15'). Use 'all' to permit all VLANs on the port. - accessPolicy (string): The name of the policy. Only applicable to Access ports. Valid values are: 'open', '8021x-radius', 'mac-radius', 'hybris-radius' for MX64 or Z3 or any MX supporting the per port authentication feature. Otherwise, 'open' is the only valid value and 'open' is the default value if the field is missing. - - peerSgtCapable (boolean): If true, Peer SGT is enabled for traffic through this port. Applicable to trunk port only, not access port. - - adaptivePolicyGroupId (string): Adaptive policy group ID that all traffic originating from this port is assigned to. - sgt (object): Security Group Tag settings for the port. """ @@ -1306,8 +1235,6 @@ def updateNetworkAppliancePort(self, networkId: str, portId: str, **kwargs): "vlan", "allowedVlans", "accessPolicy", - "peerSgtCapable", - "adaptivePolicyGroupId", "sgt", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1691,7 +1618,6 @@ def updateNetworkApplianceSecurityIntrusion(self, networkId: str, **kwargs): - networkId (string): Network ID - mode (string): Set mode to 'disabled'/'detection'/'prevention' (optional - omitting will leave current config unchanged) - idsRulesets (string): Set the detection ruleset 'connectivity'/'balanced'/'security' (optional - omitting will leave current config unchanged). Default value is 'balanced' if none currently saved - - policy (object): Set a custom intrusion policy by id (optional - omitting will leave current config unchanged) - protectedNetworks (object): Set the included/excluded networks from the intrusion engine (optional - omitting will leave current config unchanged). This is available only in 'passthrough' mode """ @@ -1716,7 +1642,6 @@ def updateNetworkApplianceSecurityIntrusion(self, networkId: str, **kwargs): body_params = [ "mode", "idsRulesets", - "policy", "protectedNetworks", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1879,7 +1804,6 @@ def updateNetworkApplianceSingleLan(self, networkId: str, **kwargs): - applianceIp (string): The appliance IP address of the single LAN - ipv6 (object): IPv6 configuration on the VLAN - mandatoryDhcp (object): Mandatory DHCP will enforce that clients connecting to this LAN must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. Only available on firmware versions 17.0 and above - - vrf (object): VRF configuration on the Single LAN. Omit this field to preserve the current VRF. """ kwargs.update(locals()) @@ -1896,7 +1820,6 @@ def updateNetworkApplianceSingleLan(self, networkId: str, **kwargs): "applianceIp", "ipv6", "mandatoryDhcp", - "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2040,7 +1963,6 @@ def createNetworkApplianceStaticRoute(self, networkId: str, name: str, subnet: s - subnet (string): Subnet of the route - gatewayIp (string): Gateway IP address (next hop) - gatewayVlanId (integer): Gateway VLAN ID - - vrf (object): VRF settings for the static route. """ kwargs.update(locals()) @@ -2057,7 +1979,6 @@ def createNetworkApplianceStaticRoute(self, networkId: str, name: str, subnet: s "subnet", "gatewayIp", "gatewayVlanId", - "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2102,7 +2023,6 @@ def updateNetworkApplianceStaticRoute(self, networkId: str, staticRouteId: str, - enabled (boolean): Whether the route should be enabled or not - fixedIpAssignments (object): Fixed DHCP IP assignments on the route - reservedIpRanges (array): DHCP reserved IP ranges - - vrf (object): VRF settings for the static route. """ kwargs.update(locals()) @@ -2123,7 +2043,6 @@ def updateNetworkApplianceStaticRoute(self, networkId: str, staticRouteId: str, "enabled", "fixedIpAssignments", "reservedIpRanges", - "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2512,7 +2431,6 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw - networkId (string): Network ID - custom (array): Custom VPN exclusion rules. Pass an empty array to clear existing rules. - majorApplications (array): Major Application based VPN exclusion rules. Pass an empty array to clear existing rules. - - applications (array): NBAR Application based VPN exclusion rules. Available for networks on >=19.2 firmware """ kwargs.update(locals()) @@ -2527,7 +2445,6 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw body_params = [ "custom", "majorApplications", - "applications", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2591,23 +2508,6 @@ def disconnectNetworkApplianceUmbrellaAccount(self, networkId: str): return self._session.post(metadata, resource) - def disableNetworkApplianceUmbrellaProtection(self, networkId: str): - """ - **Disable umbrella protection for an MX network** - https://developer.cisco.com/meraki/api-v1/#!disable-network-appliance-umbrella-protection - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["appliance", "configure", "umbrella"], - "operation": "disableNetworkApplianceUmbrellaProtection", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/appliance/umbrella/disableProtection" - - return self._session.delete(metadata, resource) - def exclusionsNetworkApplianceUmbrellaDomains(self, networkId: str, domains: list, **kwargs): """ **Specify one or more domain names to be excluded from being routed to Cisco Umbrella.** @@ -2641,54 +2541,6 @@ def exclusionsNetworkApplianceUmbrellaDomains(self, networkId: str, domains: lis return self._session.put(metadata, resource, payload) - def enableNetworkApplianceUmbrellaProtection(self, networkId: str): - """ - **Enable umbrella protection for an MX network** - https://developer.cisco.com/meraki/api-v1/#!enable-network-appliance-umbrella-protection - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["appliance", "configure", "umbrella"], - "operation": "enableNetworkApplianceUmbrellaProtection", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/appliance/umbrella/enableProtection" - - return self._session.post(metadata, resource) - - def policiesNetworkApplianceUmbrella(self, networkId: str, policyIds: list, **kwargs): - """ - **Update umbrella policies applied to MX network.** - https://developer.cisco.com/meraki/api-v1/#!policies-network-appliance-umbrella - - - networkId (string): Network ID - - policyIds (array): Array of umbrella policy IDs - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "umbrella"], - "operation": "policiesNetworkApplianceUmbrella", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/appliance/umbrella/policies" - - body_params = [ - "policyIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"policiesNetworkApplianceUmbrella: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def addNetworkApplianceUmbrellaPolicies(self, networkId: str, policy: dict, **kwargs): """ **Add one Cisco Umbrella DNS security policy to an MX network by policy ID** @@ -2894,7 +2746,6 @@ def createNetworkApplianceVlan(self, networkId: str, id: str, name: str, **kwarg - dhcpBootNextServer (string): DHCP boot option to direct boot clients to the server to load the boot file from - dhcpBootFilename (string): DHCP boot option for boot filename - dhcpOptions (array): The list of DHCP options that will be included in DHCP responses. Each object in the list should have "code", "type", and "value" properties. - - adaptivePolicyGroupId (string): Adaptive policy group ID this VLAN is assigned to. - sgt (object): Security Group Tag settings for the VLAN. - vrf (object): VRF configuration on the VLAN. - uplinks (array): Per-uplink NAT exception override configuration on the VLAN. Applicable only for networks that support NAT exceptions. @@ -2943,7 +2794,6 @@ def createNetworkApplianceVlan(self, networkId: str, id: str, name: str, **kwarg "dhcpBootNextServer", "dhcpBootFilename", "dhcpOptions", - "adaptivePolicyGroupId", "sgt", "vrf", "uplinks", @@ -3052,7 +2902,6 @@ def updateNetworkApplianceVlan(self, networkId: str, vlanId: str, **kwargs): - mask (integer): Mask used for the subnet of all bound to the template networks. Applicable only for template network. - ipv6 (object): IPv6 configuration on the VLAN - mandatoryDhcp (object): Mandatory DHCP will enforce that clients connecting to this VLAN must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. Only available on firmware versions 17.0 and above - - adaptivePolicyGroupId (string): Adaptive policy group ID that all traffic originating from this VLAN is assigned to. - sgt (object): Security Group Tag settings for the VLAN. - vrf (object): VRF configuration on the VLAN. - uplinks (array): Per-uplink NAT exception override configuration on the VLAN. Applicable only for networks that support NAT exceptions. @@ -3105,7 +2954,6 @@ def updateNetworkApplianceVlan(self, networkId: str, vlanId: str, **kwargs): "mask", "ipv6", "mandatoryDhcp", - "adaptivePolicyGroupId", "sgt", "vrf", "uplinks", @@ -3165,22 +3013,12 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): - enabled (boolean): Boolean value to enable or disable the BGP configuration. When BGP is enabled, the asNumber (ASN) will be autopopulated with the preconfigured ASN at other Hubs or a default value if there is no ASN configured. - asNumber (integer): An Autonomous System Number (ASN) is required if you are to run BGP and peer with another BGP Speaker outside of the Auto VPN domain. This ASN will be applied to the entire Auto VPN domain and is only configurable for Auto VPN BGP networks. The entire 4-byte ASN range is supported. So, the ASN must be an integer between 1 and 4294967295. When absent, this field is not updated. If no value exists then it defaults to 64512. - ibgpHoldTimer (integer): The iBGP holdtimer in seconds. The iBGP holdtimer must be an integer between 12 and 240. When absent, this field is not updated. If no value exists then it defaults to 240. - - ipv6 (object): Settings for IPv6 configurations on the organization. - - tunnelDownTermination (object): Settings for tunnel down termination on the organization. - - vpnAsNumber (integer): Network specific number of the Autonomous System to which the appliance belongs. This field is only configurable for Independent BGP networks. - - priorityRoute (string): Sets the priority route between eBGP and Auto VPN. - routerId (string): The router ID of the appliance - neighbors (array): List of BGP neighbors. This list replaces the existing set of neighbors. When absent, this field is not updated. """ kwargs.update(locals()) - if "priorityRoute" in kwargs and kwargs["priorityRoute"] is not None: - options = ["Auto VPN", "eBGP"] - assert kwargs["priorityRoute"] in options, ( - f'''"priorityRoute" cannot be "{kwargs["priorityRoute"]}", & must be set to one of: {options}''' - ) - metadata = { "tags": ["appliance", "configure", "vpn", "bgp"], "operation": "updateNetworkApplianceVpnBgp", @@ -3192,10 +3030,6 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): "enabled", "asNumber", "ibgpHoldTimer", - "ipv6", - "tunnelDownTermination", - "vpnAsNumber", - "priorityRoute", "routerId", "neighbors", ] @@ -3209,41 +3043,6 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): return self._session.put(metadata, resource, payload) - def updateNetworkApplianceVpnSiteToSiteHubVrfs(self, networkId: str, hubNetworkId: str, _json: list, **kwargs): - """ - **Update the VRF mappings for a source network and hub pair.** - https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-vpn-site-to-site-hub-vrfs - - - networkId (string): Network ID - - hubNetworkId (string): Hub network ID - - _json (array): The list of VRFs for this source and hub mapping. - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "vpn", "siteToSite", "hubs", "vrfs"], - "operation": "updateNetworkApplianceVpnSiteToSiteHubVrfs", - } - networkId = urllib.parse.quote(str(networkId), safe="") - hubNetworkId = urllib.parse.quote(str(hubNetworkId), safe="") - resource = f"/networks/{networkId}/appliance/vpn/siteToSite/hubs/{hubNetworkId}/vrfs" - - body_params = [ - "_json", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateNetworkApplianceVpnSiteToSiteHubVrfs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - def getNetworkApplianceVpnSiteToSiteVpn(self, networkId: str): """ **Return the site-to-site VPN settings of a network** @@ -3270,7 +3069,6 @@ def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kw - mode (string): The site-to-site VPN mode. Can be one of 'none', 'spoke' or 'hub' - hubs (array): The list of VPN hubs, in order of preference. In spoke mode, at least 1 hub is required. - subnets (array): The list of subnets and their VPN presence. - - peerSgtCapable (boolean): Whether or not Peer SGT is enabled for traffic to this VPN peer. - sgt (object): Security Group Tag settings for the VPN peer. - subnet (object): Configuration of subnet features - hostTranslations (array): The list of VPN host translations. Host translations are supported starting from MX firmware version 26.1.2 @@ -3293,7 +3091,6 @@ def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kw "mode", "hubs", "subnets", - "peerSgtCapable", "sgt", "subnet", "hostTranslations", @@ -3585,68 +3382,6 @@ def getOrganizationApplianceDevicesRedundancyByNetwork( return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationApplianceDevicesSystemUtilizationByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Return the appliance utilization history for devices in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-devices-system-utilization-by-interval - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 2 hours. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 1200. The default is 1200. - - networkIds (array): Optional parameter to filter the result set by the included set of network IDs - - serials (array): Optional parameter to filter device utilization history by device serial numbers - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "monitor", "devices", "system", "utilization", "byInterval"], - "operation": "getOrganizationApplianceDevicesSystemUtilizationByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/devices/system/utilization/byInterval" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - "networkIds", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceDevicesSystemUtilizationByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationApplianceDnsLocalProfiles(self, organizationId: str, **kwargs): """ **Fetch the local DNS profiles used in the organization** @@ -4432,55 +4167,6 @@ def updateOrganizationApplianceRoutingVrfsSettings(self, organizationId: str, en return self._session.put(metadata, resource, payload) - def getOrganizationApplianceSdwanInternetPolicies(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get the SDWAN internet traffic preferences for an MX network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-sdwan-internet-policies - - - 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 - 200. 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. - - wanTrafficUplinkPreferences (array): policies with respective traffic filters for an MX network - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "sdwan", "internetPolicies"], - "operation": "getOrganizationApplianceSdwanInternetPolicies", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/sdwan/internetPolicies" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "wanTrafficUplinkPreferences", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "wanTrafficUplinkPreferences", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSdwanInternetPolicies: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationApplianceSecurityEvents(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **List the security events for an organization** @@ -4534,58 +4220,6 @@ def getOrganizationApplianceSecurityEvents(self, organizationId: str, total_page return self._session.get_pages(metadata, resource, params, total_pages, direction) - def httpsiOrganizationApplianceSecurity(self, organizationId: str): - """ - **Retrieve the HTTPS Inspection state for all security appliances in an organization.** - https://developer.cisco.com/meraki/api-v1/#!httpsi-organization-appliance-security - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["appliance", "configure", "security"], - "operation": "httpsiOrganizationApplianceSecurity", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/httpsi" - - return self._session.get(metadata, resource) - - def certificatesOrganizationApplianceSecurityHttpsi(self, organizationId: str, contents: str, serials: list, **kwargs): - """ - **Upload an HTTPS Inspection certificate to MX devices in the same organization** - https://developer.cisco.com/meraki/api-v1/#!certificates-organization-appliance-security-httpsi - - - organizationId (string): Organization ID - - contents (string): The private key and certificate used to inspect HTTPS traffic. The certificate must be in .pem format. - - serials (array): Serial numbers of the security appliances that will receive the new HTTPS certificate for HTTPS Inspection - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "security", "httpsi"], - "operation": "certificatesOrganizationApplianceSecurityHttpsi", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/httpsi/certificates" - - body_params = [ - "contents", - "serials", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"certificatesOrganizationApplianceSecurityHttpsi: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - def getOrganizationApplianceSecurityIntrusion(self, organizationId: str): """ **Returns all supported intrusion settings for an organization** @@ -4636,841 +4270,30 @@ def updateOrganizationApplianceSecurityIntrusion(self, organizationId: str, allo return self._session.put(metadata, resource, payload) - def getOrganizationApplianceSecurityIntrusionPolicies( + def getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **List the intrusion policies configured for an organization along with base policies.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-policies + **Display VPN exclusion rules for MX networks.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-traffic-shaping-vpn-exclusions-by-network - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 50. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - mode (string): Controls which policy set is returned. - - policyIds (array): Identifiers of policies to filter - - search (string): Filter policies by case-insensitive partial match on name or description. + - networkIds (array): Optional parameter to filter the results by network IDs """ kwargs.update(locals()) - if "mode" in kwargs: - options = ["base", "intrusion"] - assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies"], - "operation": "getOrganizationApplianceSecurityIntrusionPolicies", + "tags": ["appliance", "configure", "trafficShaping", "vpnExclusions", "byNetwork"], + "operation": "getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "mode", - "policyIds", - "search", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSecurityIntrusionPolicies: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, **kwargs): - """ - **Create a new intrusion policy for the organization.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy - - - organizationId (string): Organization ID - - policy (object): Attributes for the intrusion policy - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies"], - "operation": "createOrganizationApplianceSecurityIntrusionPolicy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies" - - body_params = [ - "policy", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationApplianceSecurityIntrusionPolicy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationApplianceSecurityIntrusionPoliciesOverviews( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List counts for the intrusion and base policies configured for an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-policies-overviews - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. - - 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. - - policyIds (array): Identifiers of policies to filter - - search (string): Filter policy overviews by case-insensitive partial match on policy name or description. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies", "overviews"], - "operation": "getOrganizationApplianceSecurityIntrusionPoliciesOverviews", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/overviews" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "policyIds", - "search", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSecurityIntrusionPoliciesOverviews: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def updateOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, policyId: str, policy: dict, **kwargs): - """ - **Update a single intrusion policy for the organization.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - policy (object): Attributes for the intrusion policy - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies"], - "operation": "updateOrganizationApplianceSecurityIntrusionPolicy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}" - - body_params = [ - "policy", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationApplianceSecurityIntrusionPolicy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, policyId: str): - """ - **Delete a single intrusion policy for the organization.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-policy - - - organizationId (string): Organization ID - - policyId (string): Policy ID - """ - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies"], - "operation": "deleteOrganizationApplianceSecurityIntrusionPolicy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}" - - return self._session.delete(metadata, resource) - - def declareOrganizationApplianceSecurityIntrusionPolicyRuleGroupsOverrides( - self, organizationId: str, policyId: str, items: list, **kwargs - ): - """ - **Declare the desired rule group overrides for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!declare-organization-appliance-security-intrusion-policy-rule-groups-overrides - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - items (array): Desired overrides state - - mode (string): Controls how the configuration payload in the request body is applied to the resource. This parameter dictates the declarative mode: - - * **`complete`**: The request body represents the entire desired configuration for this resource. Any existing configurations that are not included in the payload will be removed. - * **`partial` (default)**: The request body contains only the configurations to be created or modified. Existing configurations that are not specified in the payload will be preserved. - - - recursive (boolean): Controls how the configuration payload in the request body applies to the rule group hierarchy. When true, the API applies each declared override to the rule group itself and its descendants unless the payload explicitly sets a descendant override. When false (default), the API applies overrides only to the rule groups listed in the payload. - - """ - - kwargs.update(locals()) - - if "mode" in kwargs: - options = ["complete", "partial"] - assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies", "ruleGroups", "overrides"], - "operation": "declareOrganizationApplianceSecurityIntrusionPolicyRuleGroupsOverrides", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - resource = ( - f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/overrides/declare" - ) - - body_params = [ - "mode", - "recursive", - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"declareOrganizationApplianceSecurityIntrusionPolicyRuleGroupsOverrides: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def createOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride( - self, organizationId: str, policyId: str, ruleGroupId: str, override: dict, **kwargs - ): - """ - **Create a rule group override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy-rule-group-override - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleGroupId (string): Rule group ID - - override (object): Attributes for the override for a rule group in a intrusion policy - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies", "ruleGroups", "override"], - "operation": "createOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleGroupId = urllib.parse.quote(str(ruleGroupId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/{ruleGroupId}/override" - - body_params = [ - "override", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride( - self, organizationId: str, policyId: str, ruleGroupId: str, override: dict, **kwargs - ): - """ - **Update a rule group override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy-rule-group-override - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleGroupId (string): Rule group ID - - override (object): Attributes for the override for a rule group in a intrusion policy - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies", "ruleGroups", "override"], - "operation": "updateOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleGroupId = urllib.parse.quote(str(ruleGroupId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/{ruleGroupId}/override" - - body_params = [ - "override", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def declareOrganizationApplianceSecurityIntrusionPolicyRulesOverrides( - self, organizationId: str, policyId: str, items: list, **kwargs - ): - """ - **Declare the desired rule overrides for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!declare-organization-appliance-security-intrusion-policy-rules-overrides - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - items (array): Desired overrides state - - mode (string): Controls how the configuration payload in the request body is applied to the resource. This parameter dictates the declarative mode: - - * **`complete`**: The request body represents the entire desired configuration for this resource. Any existing configurations that are not included in the payload will be removed. This effectively performs a full replacement or overwrite of the resource's configuration. - * **`partial` (default)**: The request body contains only the configurations to be created or modified. Existing configurations that are not specified in the payload will be preserved. This performs a merge or partial update, applying only the changes specified. - - """ - - kwargs.update(locals()) - - if "mode" in kwargs: - options = ["complete", "partial"] - assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies", "rules", "overrides"], - "operation": "declareOrganizationApplianceSecurityIntrusionPolicyRulesOverrides", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/overrides/declare" - - body_params = [ - "mode", - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"declareOrganizationApplianceSecurityIntrusionPolicyRulesOverrides: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def createOrganizationApplianceSecurityIntrusionPolicyRuleOverride( - self, organizationId: str, policyId: str, ruleId: str, override: dict, **kwargs - ): - """ - **Create a rule override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy-rule-override - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleId (string): Rule ID - - override (object): Rule override to create - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies", "rules", "override"], - "operation": "createOrganizationApplianceSecurityIntrusionPolicyRuleOverride", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleId = urllib.parse.quote(str(ruleId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/{ruleId}/override" - - body_params = [ - "override", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationApplianceSecurityIntrusionPolicyRuleOverride: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationApplianceSecurityIntrusionPolicyRuleOverride( - self, organizationId: str, policyId: str, ruleId: str, override: dict, **kwargs - ): - """ - **Update a rule override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy-rule-override - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleId (string): Rule ID - - override (object): Override attributes - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies", "rules", "override"], - "operation": "updateOrganizationApplianceSecurityIntrusionPolicyRuleOverride", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleId = urllib.parse.quote(str(ruleId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/{ruleId}/override" - - body_params = [ - "override", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationApplianceSecurityIntrusionPolicyRuleOverride: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def getOrganizationApplianceSecurityIntrusionRuleGroups( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the rule groups that belong to a security policy.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rule-groups - - - 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 - 500. 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. - - policyIds (array): Collection of base or intrusion policy identifiers to filter results by - - parentRuleGroupIds (array): Filter results to rule groups whose parent matches any of the provided identifiers - - search (string): Case-insensitive text filter applied to rule group name and description - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups"], - "operation": "getOrganizationApplianceSecurityIntrusionRuleGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "policyIds", - "parentRuleGroupIds", - "search", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - "parentRuleGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSecurityIntrusionRuleGroups: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationApplianceSecurityIntrusionRuleGroupsOverrides( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the rule group overrides configured for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rule-groups-overrides - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. - - 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. - - policyIds (array): Collection of intrusion policy identifiers to filter the overrides by. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups", "overrides"], - "operation": "getOrganizationApplianceSecurityIntrusionRuleGroupsOverrides", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups/overrides" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "policyIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSecurityIntrusionRuleGroupsOverrides: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def deleteOrganizationApplianceSecurityIntrusionRuleGroupsOverride(self, organizationId: str, overrideId: str): - """ - **Delete a rule group override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-rule-groups-override - - - organizationId (string): Organization ID - - overrideId (string): Override ID - """ - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups", "overrides"], - "operation": "deleteOrganizationApplianceSecurityIntrusionRuleGroupsOverride", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - overrideId = urllib.parse.quote(str(overrideId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups/overrides/{overrideId}" - - return self._session.delete(metadata, resource) - - def getOrganizationApplianceSecurityIntrusionRuleGroupsOverviews( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List counts for the child rule groups and rules for each rule group in a security policy.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rule-groups-overviews - - - 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 - 500. 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. - - policyIds (array): Collection of base or intrusion policy identifiers to filter results by - - parentRuleGroupIds (array): Filter results to rule groups whose parent matches any of the provided identifiers - - search (string): Case-insensitive text filter applied to rule group name and description - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups", "overviews"], - "operation": "getOrganizationApplianceSecurityIntrusionRuleGroupsOverviews", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups/overviews" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "policyIds", - "parentRuleGroupIds", - "search", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - "parentRuleGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSecurityIntrusionRuleGroupsOverviews: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationApplianceSecurityIntrusionRules(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the rules that belong to a security policy.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rules - - - 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 - 500. 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. - - policyIds (array): Identifiers of the base or intrusion policies to query - - parentRuleGroupIds (array): Filter results to rules that belong to any of the specified rule groups - - search (string): Case-insensitive text filter applied to rule name and description - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "rules"], - "operation": "getOrganizationApplianceSecurityIntrusionRules", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/rules" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "policyIds", - "parentRuleGroupIds", - "search", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - "parentRuleGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSecurityIntrusionRules: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationApplianceSecurityIntrusionRulesOverrides( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the rule overrides configured for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rules-overrides - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. - - 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. - - policyIds (array): Identifiers of intrusion policies to filter - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "rules", "overrides"], - "operation": "getOrganizationApplianceSecurityIntrusionRulesOverrides", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/rules/overrides" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "policyIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSecurityIntrusionRulesOverrides: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def deleteOrganizationApplianceSecurityIntrusionRulesOverride(self, organizationId: str, overrideId: str): - """ - **Delete a rule override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-rules-override - - - organizationId (string): Organization ID - - overrideId (string): Override ID - """ - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "rules", "overrides"], - "operation": "deleteOrganizationApplianceSecurityIntrusionRulesOverride", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - overrideId = urllib.parse.quote(str(overrideId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/rules/overrides/{overrideId}" - - return self._session.delete(metadata, resource) - - def getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Display VPN exclusion rules for MX networks.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-traffic-shaping-vpn-exclusions-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 50. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter the results by network IDs - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "trafficShaping", "vpnExclusions", "byNetwork"], - "operation": "getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/trafficShaping/vpnExclusions/byNetwork" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationApplianceUmbrellaPoliciesByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List Umbrella policy IDs applied to MX networks in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-umbrella-policies-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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): Filter results to only the given network IDs - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "umbrella", "policies", "byNetwork"], - "operation": "getOrganizationApplianceUmbrellaPoliciesByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/umbrella/policies/byNetwork" + resource = f"/organizations/{organizationId}/appliance/trafficShaping/vpnExclusions/byNetwork" query_params = [ "perPage", @@ -5493,7 +4316,7 @@ def getOrganizationApplianceUmbrellaPoliciesByNetwork( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationApplianceUmbrellaPoliciesByNetwork: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) @@ -5683,282 +4506,6 @@ def getOrganizationApplianceUplinksUsageByNetwork(self, organizationId: str, **k return self._session.get(metadata, resource, params) - def getOrganizationApplianceVlans(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the VLANs for an Organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vlans - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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": ["appliance", "configure", "vlans"], - "operation": "getOrganizationApplianceVlans", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/vlans" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationApplianceVlans: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationApplianceVpnConnectivityVpnPeersByNetwork(self, organizationId: str, **kwargs): - """ - **Summarizes by-device vpn peers for the organization in the given interval.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vpn-connectivity-vpn-peers-by-network - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 1 day. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 3600, 14400, 86400. The default is 3600. Interval is calculated if time params are provided. - - networkIds (array): Filter results by network. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "monitor", "vpn", "connectivity", "vpnPeers", "byNetwork"], - "operation": "getOrganizationApplianceVpnConnectivityVpnPeersByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/vpn/connectivity/vpnPeers/byNetwork" - - query_params = [ - "t0", - "t1", - "timespan", - "interval", - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceVpnConnectivityVpnPeersByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationApplianceVpnRemoteAccessSecureClientAuthenticationByClient(self, organizationId: str, **kwargs): - """ - **Get authentication for all clients in organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vpn-remote-access-secure-client-authentication-by-client - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "monitor", "vpn", "remoteAccess", "secureClient", "authentication", "byClient"], - "operation": "getOrganizationApplianceVpnRemoteAccessSecureClientAuthenticationByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/vpn/remoteAccess/secureClient/authentication/byClient" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceVpnRemoteAccessSecureClientAuthenticationByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationApplianceVpnRemoteAccessSecureClientIpAssignmentByClient(self, organizationId: str, **kwargs): - """ - **Get IP assignment for all clients in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vpn-remote-access-secure-client-ip-assignment-by-client - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "monitor", "vpn", "remoteAccess", "secureClient", "ipAssignment", "byClient"], - "operation": "getOrganizationApplianceVpnRemoteAccessSecureClientIpAssignmentByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/vpn/remoteAccess/secureClient/ipAssignment/byClient" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceVpnRemoteAccessSecureClientIpAssignmentByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationApplianceVpnRemoteAccessSecureClientTunnelCreationByClient(self, organizationId: str, **kwargs): - """ - **Get tunnel creation events for all clients in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vpn-remote-access-secure-client-tunnel-creation-by-client - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "monitor", "vpn", "remoteAccess", "secureClient", "tunnelCreation", "byClient"], - "operation": "getOrganizationApplianceVpnRemoteAccessSecureClientTunnelCreationByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/vpn/remoteAccess/secureClient/tunnelCreation/byClient" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceVpnRemoteAccessSecureClientTunnelCreationByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationApplianceVpnSiteToSiteHubsVrfs(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return source-to-hub VRF mappings for site-to-site VPN within an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vpn-site-to-site-hubs-vrfs - - - 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 - 500. 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 source-to-hub mappings by source network IDs. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "vpn", "siteToSite", "hubs", "vrfs"], - "operation": "getOrganizationApplianceVpnSiteToSiteHubsVrfs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/vpn/siteToSite/hubs/vrfs" - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceVpnSiteToSiteHubsVrfs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationApplianceVpnSiteToSiteIpsecPeersSlas(self, organizationId: str): """ **Get the list of available IPsec SLA policies for an organization** diff --git a/meraki/aio/api/assistant.py b/meraki/aio/api/assistant.py deleted file mode 100644 index 3dfece6..0000000 --- a/meraki/aio/api/assistant.py +++ /dev/null @@ -1,491 +0,0 @@ -import urllib - - -class AsyncAssistant: - def __init__(self, session): - super().__init__() - self._session = session - - def getOrganizationAssistantCapabilities(self, organizationId: str): - """ - **List the AI assistant's available capabilities and agents for this organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-capabilities - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["assistant", "configure", "capabilities"], - "operation": "getOrganizationAssistantCapabilities", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assistant/capabilities" - - return self._session.get(metadata, resource) - - def createOrganizationAssistantChatCompletion(self, organizationId: str, **kwargs): - """ - **Create a chat completion with the AI assistant** - https://developer.cisco.com/meraki/api-v1/#!create-organization-assistant-chat-completion - - - organizationId (string): Organization ID - - query (string): Simple text question or instruction to send to the AI assistant. Provide either 'query' for text-only requests or 'content' for multi-modal input. - - content (array): List of multi-modal content blocks. Use instead of 'query' to send text or images. Supports text and image types only; for audio and file support, use the messages endpoint. Maximum 8 parts. - - threadId (string): An existing thread ID to continue a conversation. If omitted, a new thread is created. - - networkId (string): Optional network ID to scope the query to a specific network. Defaults to the user's last visited network. - - platform (string): Platform identifier. Defaults to MERAKI when omitted. Case-insensitive. - - language (string): Optional language override. Defaults to the user's preferred language. - - country (string): Optional country override. Defaults to the user's country. - """ - - kwargs.update(locals()) - - if "platform" in kwargs: - options = ["DIGITAL_TWIN", "DNAC", "MERAKI", "digital_twin", "dnac", "meraki"] - assert kwargs["platform"] in options, ( - f'''"platform" cannot be "{kwargs["platform"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["assistant", "configure", "chat", "completions"], - "operation": "createOrganizationAssistantChatCompletion", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/completions" - - body_params = [ - "query", - "content", - "threadId", - "networkId", - "platform", - "language", - "country", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationAssistantChatCompletion: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationAssistantChatThreads(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List all active conversation threads for the authenticated user.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-chat-threads - - - 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): Number of entries per page. Defaults to 100. Maximum 1000. - - sort (string): Field to sort results by. Defaults to dateModified. - - sortOrder (string): Sort direction for results. Defaults to desc. - - from (string): Filter threads modified after this timestamp. - - to (string): Filter threads modified before this timestamp. - """ - - kwargs.update(locals()) - - if "sort" in kwargs: - options = ["dateModified", "id", "name"] - assert kwargs["sort"] in options, f'''"sort" cannot be "{kwargs["sort"]}", & must be set to one of: {options}''' - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["assistant", "configure", "chat", "threads"], - "operation": "getOrganizationAssistantChatThreads", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads" - - query_params = [ - "perPage", - "sort", - "sortOrder", - "from", - "to", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationAssistantChatThreads: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationAssistantChatThread(self, organizationId: str, **kwargs): - """ - **Create a new conversation thread.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-assistant-chat-thread - - - organizationId (string): Organization ID - - threadName (string): Display name for the new thread. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["assistant", "configure", "chat", "threads"], - "operation": "createOrganizationAssistantChatThread", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads" - - body_params = [ - "threadName", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationAssistantChatThread: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationAssistantChatThread(self, organizationId: str, threadId: str): - """ - **Return a single conversation thread.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-chat-thread - - - organizationId (string): Organization ID - - threadId (string): Thread ID - """ - - metadata = { - "tags": ["assistant", "configure", "chat", "threads"], - "operation": "getOrganizationAssistantChatThread", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}" - - return self._session.get(metadata, resource) - - def updateOrganizationAssistantChatThread(self, organizationId: str, threadId: str, threadName: str, **kwargs): - """ - **Update the name of a conversation thread.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-assistant-chat-thread - - - organizationId (string): Organization ID - - threadId (string): Thread ID - - threadName (string): New display name for the thread. - """ - - kwargs = locals() - - metadata = { - "tags": ["assistant", "configure", "chat", "threads"], - "operation": "updateOrganizationAssistantChatThread", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}" - - body_params = [ - "threadName", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationAssistantChatThread: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationAssistantChatThread(self, organizationId: str, threadId: str): - """ - **Delete a conversation thread and all its messages.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-assistant-chat-thread - - - organizationId (string): Organization ID - - threadId (string): Thread ID - """ - - metadata = { - "tags": ["assistant", "configure", "chat", "threads"], - "operation": "deleteOrganizationAssistantChatThread", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}" - - return self._session.delete(metadata, resource) - - def getOrganizationAssistantChatThreadMessages( - self, organizationId: str, threadId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List messages in a conversation thread.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-chat-thread-messages - - - organizationId (string): Organization ID - - threadId (string): Thread 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): Number of entries per page. Defaults to 100. Maximum 1000. - - sortOrder (string): Sort direction for results by timestamp. Defaults to asc. - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["assistant", "configure", "chat", "threads", "messages"], - "operation": "getOrganizationAssistantChatThreadMessages", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages" - - query_params = [ - "perPage", - "sortOrder", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssistantChatThreadMessages: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationAssistantChatThreadMessage(self, organizationId: str, threadId: str, content: list, **kwargs): - """ - **Create a new chat message in a thread.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-assistant-chat-thread-message - - - organizationId (string): Organization ID - - threadId (string): Thread ID - - content (array): List of message content parts. Supports text, image, audio, and file types. Maximum 8 parts. - - networkName (string): Name of the target network. - - networkId (string): Optional Meraki network ID for thread context. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["assistant", "configure", "chat", "threads", "messages"], - "operation": "createOrganizationAssistantChatThreadMessage", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages" - - body_params = [ - "content", - "networkName", - "networkId", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationAssistantChatThreadMessage: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationAssistantChatThreadMessage(self, organizationId: str, threadId: str, messageId: str): - """ - **Return a single message in a conversation thread.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-chat-thread-message - - - organizationId (string): Organization ID - - threadId (string): Thread ID - - messageId (string): Message ID - """ - - metadata = { - "tags": ["assistant", "configure", "chat", "threads", "messages"], - "operation": "getOrganizationAssistantChatThreadMessage", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - messageId = urllib.parse.quote(str(messageId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages/{messageId}" - - return self._session.get(metadata, resource) - - def getOrganizationAssistantChatThreadMessageArtifacts(self, organizationId: str, threadId: str, messageId: str): - """ - **List artifacts attached to a specific message** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-chat-thread-message-artifacts - - - organizationId (string): Organization ID - - threadId (string): Thread ID - - messageId (string): Message ID - """ - - metadata = { - "tags": ["assistant", "configure", "chat", "threads", "messages", "artifacts"], - "operation": "getOrganizationAssistantChatThreadMessageArtifacts", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - messageId = urllib.parse.quote(str(messageId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages/{messageId}/artifacts" - - return self._session.get(metadata, resource) - - def getOrganizationAssistantChatThreadMessageArtifact( - self, organizationId: str, threadId: str, messageId: str, artifactId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Return a single artifact with its full content.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-chat-thread-message-artifact - - - organizationId (string): Organization ID - - threadId (string): Thread ID - - messageId (string): Message ID - - artifactId (string): Artifact 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 - - page (integer): Page number for paginated artifact content, defaulting to 1 - - perPage (integer): Number of entries per page. Defaults to 100. Maximum 1000. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["assistant", "configure", "chat", "threads", "messages", "artifacts"], - "operation": "getOrganizationAssistantChatThreadMessageArtifact", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - messageId = urllib.parse.quote(str(messageId), safe="") - artifactId = urllib.parse.quote(str(artifactId), safe="") - resource = ( - f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages/{messageId}/artifacts/{artifactId}" - ) - - query_params = [ - "page", - "perPage", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssistantChatThreadMessageArtifact: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssistantChatThreadMessageFeedback(self, organizationId: str, threadId: str, messageId: str): - """ - **Return all feedback entries previously submitted for a specific message in a thread.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-chat-thread-message-feedback - - - organizationId (string): Organization ID - - threadId (string): Thread ID - - messageId (string): Message ID - """ - - metadata = { - "tags": ["assistant", "configure", "chat", "threads", "messages", "feedback"], - "operation": "getOrganizationAssistantChatThreadMessageFeedback", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - messageId = urllib.parse.quote(str(messageId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages/{messageId}/feedback" - - return self._session.get(metadata, resource) - - def createOrganizationAssistantChatThreadMessageFeedback( - self, organizationId: str, threadId: str, messageId: str, vote: bool, **kwargs - ): - """ - **Submit or replace feedback for a specific assistant message.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-assistant-chat-thread-message-feedback - - - organizationId (string): Organization ID - - threadId (string): Thread ID - - messageId (string): Message ID - - vote (boolean): True for positive, false for negative. - - reason (string): Optional free-text reason for the feedback (e.g., 'inaccurate', 'incomplete', 'helpful'). Not constrained to a fixed set of values. - - comment (string): Optional free-text comment providing additional detail. - - message (string): The assistant message text the feedback refers to. Captured for analytics; not required. - - prompt (string): The user prompt that produced the assistant message. Captured for analytics; not required. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["assistant", "configure", "chat", "threads", "messages", "feedback"], - "operation": "createOrganizationAssistantChatThreadMessageFeedback", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - messageId = urllib.parse.quote(str(messageId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages/{messageId}/feedback" - - body_params = [ - "vote", - "reason", - "comment", - "message", - "prompt", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationAssistantChatThreadMessageFeedback: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationAssistantQueryLimits(self, organizationId: str): - """ - **Get query limits for the AI assistant for this organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-query-limits - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["assistant", "configure", "queryLimits"], - "operation": "getOrganizationAssistantQueryLimits", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assistant/queryLimits" - - return self._session.get(metadata, resource) diff --git a/meraki/aio/api/camera.py b/meraki/aio/api/camera.py index 8d29b25..98e5c8a 100644 --- a/meraki/aio/api/camera.py +++ b/meraki/aio/api/camera.py @@ -739,97 +739,6 @@ def getNetworkCameraSchedules(self, networkId: str): return self._session.get(metadata, resource) - def createNetworkCameraVideoWall(self, networkId: str, name: str, tiles: list, **kwargs): - """ - **Create a new video wall.** - https://developer.cisco.com/meraki/api-v1/#!create-network-camera-video-wall - - - networkId (string): Network ID - - name (string): The name of the video wall. - - tiles (array): The tiles that should appear on the video wall. - - index (integer): The order that this wall should appear on the video wall list. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["camera", "configure", "videoWalls"], - "operation": "createNetworkCameraVideoWall", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/camera/videoWalls" - - body_params = [ - "name", - "index", - "tiles", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createNetworkCameraVideoWall: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def updateNetworkCameraVideoWall(self, networkId: str, id: str, name: str, tiles: list, **kwargs): - """ - **Update the specified video wall.** - https://developer.cisco.com/meraki/api-v1/#!update-network-camera-video-wall - - - networkId (string): Network ID - - id (string): ID - - name (string): The name of the video wall. - - tiles (array): The tiles that should appear on the video wall. - - index (integer): The order that this wall should appear on the video wall list. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["camera", "configure", "videoWalls"], - "operation": "updateNetworkCameraVideoWall", - } - networkId = urllib.parse.quote(str(networkId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/networks/{networkId}/camera/videoWalls/{id}" - - body_params = [ - "name", - "index", - "tiles", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkCameraVideoWall: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteNetworkCameraVideoWall(self, networkId: str, id: str): - """ - **Delete the specified video wall.** - https://developer.cisco.com/meraki/api-v1/#!delete-network-camera-video-wall - - - networkId (string): Network ID - - id (string): ID - """ - - metadata = { - "tags": ["camera", "configure", "videoWalls"], - "operation": "deleteNetworkCameraVideoWall", - } - networkId = urllib.parse.quote(str(networkId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/networks/{networkId}/camera/videoWalls/{id}" - - return self._session.delete(metadata, resource) - def createNetworkCameraWirelessProfile(self, networkId: str, name: str, ssid: dict, **kwargs): """ **Creates a new camera wireless profile for this network.** @@ -1182,45 +1091,6 @@ def getOrganizationCameraDetectionsHistoryByBoundaryByInterval( return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationCameraDevicesConfigurations(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Lists all the capabilities of cameras in this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-devices-configurations - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 20. - - 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": ["camera", "configure", "devices", "configurations"], - "operation": "getOrganizationCameraDevicesConfigurations", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/camera/devices/configurations" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCameraDevicesConfigurations: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationCameraOnboardingStatuses(self, organizationId: str, **kwargs): """ **Fetch onboarding status of cameras** @@ -1466,104 +1336,3 @@ def updateOrganizationCameraRole(self, organizationId: str, roleId: str, **kwarg self._session._logger.warning(f"updateOrganizationCameraRole: ignoring unrecognized kwargs: {invalid}") return self._session.put(metadata, resource, payload) - - def getOrganizationCameraVideoWalls(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return a list of video walls.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-video-walls - - - 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 10 - 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): A list of network ids to filter video walls on - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["camera", "configure", "videoWalls"], - "operation": "getOrganizationCameraVideoWalls", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/camera/videoWalls" - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationCameraVideoWalls: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationCameraVideoWall(self, organizationId: str, id: str): - """ - **Return the specified video wall.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-video-wall - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["camera", "configure", "videoWalls"], - "operation": "getOrganizationCameraVideoWall", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/camera/videoWalls/{id}" - - return self._session.get(metadata, resource) - - def getOrganizationCameraVideoWallVideoLink(self, organizationId: str, id: str, **kwargs): - """ - **Returns video wall link to the specified video wall id** - https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-video-wall-video-link - - - organizationId (string): Organization ID - - id (string): ID - - timestamp (string): [optional] The video link will start at this time. The timestamp should be a string in ISO8601 format. If no timestamp is specified, we will assume current time. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["camera", "configure", "videoWalls", "videoLink"], - "operation": "getOrganizationCameraVideoWallVideoLink", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/camera/videoWalls/{id}/videoLink" - - query_params = [ - "timestamp", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCameraVideoWallVideoLink: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) diff --git a/meraki/aio/api/campusGateway.py b/meraki/aio/api/campusGateway.py index 90e053a..ed7cee5 100644 --- a/meraki/aio/api/campusGateway.py +++ b/meraki/aio/api/campusGateway.py @@ -96,150 +96,6 @@ def updateNetworkCampusGatewayCluster(self, networkId: str, clusterId: str, **kw return self._session.put(metadata, resource, payload) - def deleteNetworkCampusGatewayCluster(self, networkId: str, clusterId: str): - """ - **Delete a cluster** - https://developer.cisco.com/meraki/api-v1/#!delete-network-campus-gateway-cluster - - - networkId (string): Network ID - - clusterId (string): Cluster ID - """ - - metadata = { - "tags": ["campusGateway", "configure", "clusters"], - "operation": "deleteNetworkCampusGatewayCluster", - } - networkId = urllib.parse.quote(str(networkId), safe="") - clusterId = urllib.parse.quote(str(clusterId), safe="") - resource = f"/networks/{networkId}/campusGateway/clusters/{clusterId}" - - return self._session.delete(metadata, resource) - - def getNetworkCampusGatewaySsidMdns(self, networkId: str, number: str): - """ - **List the currently configured mDNS settings for the SSID** - https://developer.cisco.com/meraki/api-v1/#!get-network-campus-gateway-ssid-mdns - - - networkId (string): Network ID - - number (string): Number - """ - - metadata = { - "tags": ["campusGateway", "configure", "ssids", "mdns"], - "operation": "getNetworkCampusGatewaySsidMdns", - } - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/campusGateway/ssids/{number}/mdns" - - return self._session.get(metadata, resource) - - def updateNetworkCampusGatewaySsidMdns(self, networkId: str, number: str, **kwargs): - """ - **Update the mDNS gateway settings and rules for a SSID and cluster** - https://developer.cisco.com/meraki/api-v1/#!update-network-campus-gateway-ssid-mdns - - - networkId (string): Network ID - - number (string): Number - - enabled (boolean): If true, mDNS gateway is enabled for this SSID and cluster. - - rules (array): List of mDNS forwarding rules. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["campusGateway", "configure", "ssids", "mdns"], - "operation": "updateNetworkCampusGatewaySsidMdns", - } - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/campusGateway/ssids/{number}/mdns" - - body_params = [ - "enabled", - "rules", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkCampusGatewaySsidMdns: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getOrganizationCampusGatewayClientsUsageByNetworkByCluster( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns client usage details for campus gateway clusters within an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-clients-usage-by-network-by-cluster - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 1 hour and be less than or equal to 7 days. The default is 2 hours. - - networkIds (array): Filter results by a list of network IDs. - - networkGroupIds (array): Limit the results to clients that belong to one of the provided network groups. - - clusterIds (array): Filter results by a list of cluster IDs. - - usageUnits (string): Usage units to use in the response. - """ - - kwargs.update(locals()) - - if "usageUnits" in kwargs: - options = ["GB", "KB", "MB", "TB"] - assert kwargs["usageUnits"] in options, ( - f'''"usageUnits" cannot be "{kwargs["usageUnits"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["campusGateway", "monitor", "clients", "usage", "byNetwork", "byCluster"], - "operation": "getOrganizationCampusGatewayClientsUsageByNetworkByCluster", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clients/usage/byNetwork/byCluster" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "networkIds", - "networkGroupIds", - "clusterIds", - "usageUnits", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "networkGroupIds", - "clusterIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayClientsUsageByNetworkByCluster: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationCampusGatewayClusters(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Get the details of campus gateway clusters** @@ -287,556 +143,6 @@ def getOrganizationCampusGatewayClusters(self, organizationId: str, total_pages= return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationCampusGatewayClustersFailoverTargets( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the details of a Failover Targets for a Campus Gateway cluster** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-clusters-failover-targets - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter networks. This filter uses multiple exact matches. - - clusterIds (array): Optional parameter to filter clusters. This filter uses multiple exact matches. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["campusGateway", "configure", "clusters", "failover", "targets"], - "operation": "getOrganizationCampusGatewayClustersFailoverTargets", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/failover/targets" - - query_params = [ - "networkIds", - "clusterIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "clusterIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayClustersFailoverTargets: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationCampusGatewayClustersFailoverTargetsByCluster( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get available backup cluster targets for campus gateway failover configuration** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-clusters-failover-targets-by-cluster - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Networks for which backup cluster targets should be gathered. - - clusterIds (array): Cluster IDs to filter backup cluster targets. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["campusGateway", "configure", "clusters", "failover", "targets", "byCluster"], - "operation": "getOrganizationCampusGatewayClustersFailoverTargetsByCluster", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/failover/targets/byCluster" - - query_params = [ - "networkIds", - "clusterIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "clusterIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayClustersFailoverTargetsByCluster: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationCampusGatewayClustersNetworksOverviews( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List networks tunneling through Campus Gateway clusters with their AP, ssids and client counts** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-clusters-networks-overviews - - - 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 - - clusterIds (array): Optional parameter to filter by MCG cluster IDs. This filter uses multiple exact matches. - - siteIds (array): Optional parameter to filter by site IDs. This filter uses multiple exact matches. - - networkIds (array): Optional parameter to filter networks. This filter uses multiple exact matches. - - tunnelingSources (array): Optional parameter to filter networks by tunneling source. 'configured' returns networks explicitly set up to tunnel through the campus gateway. 'roaming' returns networks tunneling due to AP roaming or disaster recovery. 'roaming' is only effective when 'clusterIds' is also provided; without 'clusterIds', the filter defaults to configured-only behavior. Defaults to 'configured' if omitted. - - search (string): Optional parameter to filter networks by wireless network name. This filter uses case-insensitive substring matching. - - sortBy (string): Optional parameter to sort results. Default is 'name'. Use 'siteName' to sort by site name. - - sortOrder (string): Optional parameter to specify sort direction. Default is 'asc'. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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()) - - if "sortBy" in kwargs: - options = ["clients", "clusterId", "connections", "name", "networkId", "siteName", "ssids"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["campusGateway", "configure", "clusters", "networks", "overviews"], - "operation": "getOrganizationCampusGatewayClustersNetworksOverviews", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/networks/overviews" - - query_params = [ - "clusterIds", - "siteIds", - "networkIds", - "tunnelingSources", - "search", - "sortBy", - "sortOrder", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "clusterIds", - "siteIds", - "networkIds", - "tunnelingSources", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayClustersNetworksOverviews: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def provisionOrganizationCampusGatewayClusters( - self, - organizationId: str, - clusterId: str, - network: dict, - name: str, - uplinks: list, - tunnels: list, - nameservers: dict, - portChannels: list, - **kwargs, - ): - """ - **Provisions a cluster,adds campus gateways to it and associate/dissociate failover targets.** - https://developer.cisco.com/meraki/api-v1/#!provision-organization-campus-gateway-clusters - - - organizationId (string): Organization ID - - clusterId (string): ID of the cluster to be provisioned - - network (object): Network to be provisioned - - 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 - - failover (object): Failover targets for the cluster - - notes (string): Notes about cluster with max size of 511 characters allowed - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["campusGateway", "configure", "clusters"], - "operation": "provisionOrganizationCampusGatewayClusters", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/provision" - - body_params = [ - "clusterId", - "network", - "name", - "uplinks", - "tunnels", - "nameservers", - "portChannels", - "devices", - "failover", - "notes", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"provisionOrganizationCampusGatewayClusters: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationCampusGatewayClustersSsids(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List SSIDs tunneling through Campus Gateway clusters** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-clusters-ssids - - - 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 - - clusterIds (array): Optional parameter to filter by MCG cluster IDs. This filter uses multiple exact matches. - - networkIds (array): Optional parameter to filter networks. This filter uses multiple exact matches. - - search (string): Optional parameter to filter SSIDs by name. This filter uses case-insensitive starts with string matching. - - sortBy (string): Optional parameter to sort results. Default is 'networkId'. - - sortOrder (string): Optional parameter to specify sort direction. Default is 'asc'. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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()) - - if "sortBy" in kwargs: - options = ["clusterId", "name", "networkId", "ssidId"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["campusGateway", "configure", "clusters", "ssids"], - "operation": "getOrganizationCampusGatewayClustersSsids", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/ssids" - - query_params = [ - "clusterIds", - "networkIds", - "search", - "sortBy", - "sortOrder", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "clusterIds", - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayClustersSsids: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationCampusGatewayClustersTunnelingByClusterByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List all the MCG cluster-network tunnel settings** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-clusters-tunneling-by-cluster-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 - - clusterIds (array): Optional parameter to filter MCG clusters. This filter uses multiple exact matches - - dataEncryptionEnabled (boolean): Optional parameter to filter cluster-network tunnel settings by data encryption configuration - - networkIds (array): Optional parameter to filter networks. This filter uses multiple exact matches - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["campusGateway", "configure", "clusters", "tunneling", "byCluster", "byNetwork"], - "operation": "getOrganizationCampusGatewayClustersTunnelingByClusterByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/tunneling/byCluster/byNetwork" - - query_params = [ - "clusterIds", - "dataEncryptionEnabled", - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "clusterIds", - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayClustersTunnelingByClusterByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def batchOrganizationCampusGatewayClustersTunnelingByClusterByNetworkUpdate(self, organizationId: str, **kwargs): - """ - **Update MCG cluster-network tunnel settings for multiple networks** - https://developer.cisco.com/meraki/api-v1/#!batch-organization-campus-gateway-clusters-tunneling-by-cluster-by-network-update - - - organizationId (string): Organization ID - - items (array): MCG cluster-network tunnel settings - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["campusGateway", "configure", "clusters", "tunneling", "byCluster", "byNetwork"], - "operation": "batchOrganizationCampusGatewayClustersTunnelingByClusterByNetworkUpdate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/tunneling/byCluster/byNetwork/batchUpdate" - - body_params = [ - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"batchOrganizationCampusGatewayClustersTunnelingByClusterByNetworkUpdate: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationCampusGatewayConnections(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the details of APs tunneling through the Campus Gateway clusters** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-connections - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter networks. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter connections(APs) by its own serials. This filter uses multiple exact matches. - - campusGatewaySerials (array): Optional parameter to filter connections(APs) by MCG serials. This filter uses multiple exact matches. - - campusGatewayClusterIds (array): Optional parameter to filter connections(APs) by MCG cluster IDs. This filter uses multiple exact matches. - - campusGatewayTunnelStatuses (array): Optional parameter to filter connections(APs) by tunnel statuses. This filter uses multiple exact matches. - - search (string): Optional parameter to filter connections(APs) on AP name, serial, MAC address, network name, or interface IP address. This filter uses partial string matching (ILIKE). - - models (array): Optional parameter to filter connections(APs) by device model names. This filter uses multiple exact matches. - - dataEncryptionStatuses (array): Optional parameter to filter connections(APs) by data encryption status. This filter uses multiple exact matches. - - sortBy (string): Optional parameter to sort results. Available options: name, serial, status, interfaces, clients, dataEncryption, networkName. Default is 'serial'. - - sortOrder (string): Optional parameter to specify sort direction. Default is 'asc'. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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()) - - if "sortBy" in kwargs: - options = ["clients", "dataEncryption", "interfaces", "name", "networkName", "serial", "status"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["campusGateway", "configure", "connections"], - "operation": "getOrganizationCampusGatewayConnections", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/connections" - - query_params = [ - "networkIds", - "serials", - "campusGatewaySerials", - "campusGatewayClusterIds", - "campusGatewayTunnelStatuses", - "search", - "models", - "dataEncryptionStatuses", - "sortBy", - "sortOrder", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "campusGatewaySerials", - "campusGatewayClusterIds", - "campusGatewayTunnelStatuses", - "models", - "dataEncryptionStatuses", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayConnections: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, **kwargs): - """ - **List the count of connections(APs) with tunneling status up and down through the Campus Gateway clusters** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-connections-overview - - - organizationId (string): Organization ID - - networkIds (array): Optional parameter to filter networks. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter connections(APs) by its own serials. This filter uses multiple exact matches. - - campusGatewaySerials (array): Optional parameter to filter connections(APs) by Campus Gateway serials. This filter uses multiple exact matches. - - campusGatewayClusterIds (array): Optional parameter to filter connections(APs) by Campus Gateway cluster IDs. This filter uses multiple exact matches. - - campusGatewayTunnelStatuses (array): Optional parameter to filter connections(APs) by tunnel statuses. This filter uses multiple exact matches. - - search (string): Optional setting that lets you filter access points (APs) by name, serial number, MAC address, network name, or interface IP address. The filter matches partial text, not just exact values (uses ILIKE matching). - - models (array): Optional parameter to filter connections(APs) by device model names. This filter uses multiple exact matches. - - dataEncryptionStatuses (array): Optional parameter to filter connections(APs) by data encryption status. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["campusGateway", "configure", "connections", "overview"], - "operation": "getOrganizationCampusGatewayConnectionsOverview", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/connections/overview" - - query_params = [ - "networkIds", - "serials", - "campusGatewaySerials", - "campusGatewayClusterIds", - "campusGatewayTunnelStatuses", - "search", - "models", - "dataEncryptionStatuses", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "campusGatewaySerials", - "campusGatewayClusterIds", - "campusGatewayTunnelStatuses", - "models", - "dataEncryptionStatuses", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayConnectionsOverview: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - def getOrganizationCampusGatewayDevicesUplinksLocalOverridesByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): diff --git a/meraki/aio/api/devices.py b/meraki/aio/api/devices.py index 3e24199..1c02af9 100644 --- a/meraki/aio/api/devices.py +++ b/meraki/aio/api/devices.py @@ -232,56 +232,6 @@ def createDeviceCellularUplinksBandsMasksUpdate(self, serial: str, slot: str, ty return self._session.post(metadata, resource, payload) - def revokeDeviceCertificate(self, serial: str, certificateSerial: str, **kwargs): - """ - **Revoke a device certificate** - https://developer.cisco.com/meraki/api-v1/#!revoke-device-certificate - - - serial (string): Serial - - certificateSerial (string): Certificate serial - - reason (string): Revocation reason per RFC 5280; omit to use `unspecified` - """ - - kwargs.update(locals()) - - if "reason" in kwargs: - options = [ - "aACompromise", - "affiliationChanged", - "cACompromise", - "certificateHold", - "cessationOfOperation", - "keyCompromise", - "privilegeWithdrawn", - "removeFromCRL", - "superseded", - "unspecified", - ] - assert kwargs["reason"] in options, ( - f'''"reason" cannot be "{kwargs["reason"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["devices", "configure", "certificates"], - "operation": "revokeDeviceCertificate", - } - serial = urllib.parse.quote(str(serial), safe="") - certificateSerial = urllib.parse.quote(str(certificateSerial), safe="") - resource = f"/devices/{serial}/certificates/{certificateSerial}/revoke" - - body_params = [ - "reason", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"revokeDeviceCertificate: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - def getDeviceClients(self, serial: str, **kwargs): """ **List the clients of a device, up to a maximum of a month ago** @@ -315,56 +265,6 @@ def getDeviceClients(self, serial: str, **kwargs): return self._session.get(metadata, resource, params) - def createDeviceLiveToolsAclHitCount(self, serial: str, **kwargs): - """ - **Enqueue a job to perform an ACL hit count for the device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-acl-hit-count - - - serial (string): Serial - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["devices", "liveTools", "aclHitCount"], - "operation": "createDeviceLiveToolsAclHitCount", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/aclHitCount" - - body_params = [ - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsAclHitCount: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getDeviceLiveToolsAclHitCount(self, serial: str, id: str): - """ - **Return an ACL hit count live tool job.** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-acl-hit-count - - - serial (string): Serial - - id (string): ID - """ - - metadata = { - "tags": ["devices", "liveTools", "aclHitCount"], - "operation": "getDeviceLiveToolsAclHitCount", - } - serial = urllib.parse.quote(str(serial), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/devices/{serial}/liveTools/aclHitCount/{id}" - - return self._session.get(metadata, resource) - def createDeviceLiveToolsArpTable(self, serial: str, **kwargs): """ **Enqueue a job to perform a ARP table request for the device** @@ -467,75 +367,6 @@ def getDeviceLiveToolsCableTest(self, serial: str, id: str): return self._session.get(metadata, resource) - def getDeviceLiveToolsClientsDisconnect(self, serial: str, id: str): - """ - **Return a client disconnect job.** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-clients-disconnect - - - serial (string): Serial - - id (string): ID - """ - - metadata = { - "tags": ["devices", "liveTools", "clients", "disconnect"], - "operation": "getDeviceLiveToolsClientsDisconnect", - } - serial = urllib.parse.quote(str(serial), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/devices/{serial}/liveTools/clients/disconnect/{id}" - - return self._session.get(metadata, resource) - - def createDeviceLiveToolsDhcpLease(self, serial: str, **kwargs): - """ - **Enqueue a job to perform a DHCP leases request for the device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-dhcp-lease - - - serial (string): Serial - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["devices", "liveTools", "dhcpLeases"], - "operation": "createDeviceLiveToolsDhcpLease", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/dhcpLeases" - - body_params = [ - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsDhcpLease: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getDeviceLiveToolsDhcpLease(self, serial: str, dhcpLeasesId: str): - """ - **Return a DHCP leases live tool job.** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-dhcp-lease - - - serial (string): Serial - - dhcpLeasesId (string): Dhcp leases ID - """ - - metadata = { - "tags": ["devices", "liveTools", "dhcpLeases"], - "operation": "getDeviceLiveToolsDhcpLease", - } - serial = urllib.parse.quote(str(serial), safe="") - dhcpLeasesId = urllib.parse.quote(str(dhcpLeasesId), safe="") - resource = f"/devices/{serial}/liveTools/dhcpLeases/{dhcpLeasesId}" - - return self._session.get(metadata, resource) - def createDeviceLiveToolsLedsBlink(self, serial: str, duration: int, **kwargs): """ **Enqueue a job to blink LEDs on a device** @@ -692,56 +523,6 @@ def getDeviceLiveToolsMulticastRouting(self, serial: str, multicastRoutingId: st return self._session.get(metadata, resource) - def createDeviceLiveToolsOspfNeighbor(self, serial: str, **kwargs): - """ - **Enqueue a job to perform a OSPF neighbors request for the device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-ospf-neighbor - - - serial (string): Serial - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["devices", "liveTools", "ospfNeighbors"], - "operation": "createDeviceLiveToolsOspfNeighbor", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/ospfNeighbors" - - body_params = [ - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsOspfNeighbor: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getDeviceLiveToolsOspfNeighbor(self, serial: str, ospfNeighborsId: str): - """ - **Return an OSPF neighbors live tool job.** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-ospf-neighbor - - - serial (string): Serial - - ospfNeighborsId (string): Ospf neighbors ID - """ - - metadata = { - "tags": ["devices", "liveTools", "ospfNeighbors"], - "operation": "getDeviceLiveToolsOspfNeighbor", - } - serial = urllib.parse.quote(str(serial), safe="") - ospfNeighborsId = urllib.parse.quote(str(ospfNeighborsId), safe="") - resource = f"/devices/{serial}/liveTools/ospfNeighbors/{ospfNeighborsId}" - - return self._session.get(metadata, resource) - def createDeviceLiveToolsPing(self, serial: str, target: str, **kwargs): """ **Enqueue a job to ping a target host from the device** @@ -1000,89 +781,6 @@ def getDeviceLiveToolsPowerUsage(self, serial: str, jobId: str): return self._session.get(metadata, resource) - def createDeviceLiveToolsReboot(self, serial: str, **kwargs): - """ - **Enqueue a job to reboot a device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-reboot - - - serial (string): Serial - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["devices", "liveTools", "reboot"], - "operation": "createDeviceLiveToolsReboot", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/reboot" - - body_params = [ - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsReboot: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getDeviceLiveToolsReboot(self, serial: str, rebootId: str): - """ - **Return a reboot job** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-reboot - - - serial (string): Serial - - rebootId (string): Reboot ID - """ - - metadata = { - "tags": ["devices", "liveTools", "reboot"], - "operation": "getDeviceLiveToolsReboot", - } - serial = urllib.parse.quote(str(serial), safe="") - rebootId = urllib.parse.quote(str(rebootId), safe="") - resource = f"/devices/{serial}/liveTools/reboot/{rebootId}" - - return self._session.get(metadata, resource) - - def createDeviceLiveToolsRoutingTable(self, serial: str, **kwargs): - """ - **Enqueue a job to perform a routing table request for the device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-routing-table - - - serial (string): Serial - - destination (object): Optional destination filter used to return routes containing the supplied destination. - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["devices", "liveTools", "routingTable"], - "operation": "createDeviceLiveToolsRoutingTable", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/routingTable" - - body_params = [ - "destination", - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsRoutingTable: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - def createDeviceLiveToolsRoutingTableLookup(self, serial: str, **kwargs): """ **Enqueue a job to perform a routing table lookup request for a device** @@ -1215,81 +913,6 @@ def getDeviceLiveToolsRoutingTableSummary(self, serial: str, id: str): return self._session.get(metadata, resource) - def getDeviceLiveToolsRoutingTable(self, serial: str, id: str): - """ - **Return an routing table live tool job.** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-routing-table - - - serial (string): Serial - - id (string): ID - """ - - metadata = { - "tags": ["devices", "liveTools", "routingTable"], - "operation": "getDeviceLiveToolsRoutingTable", - } - serial = urllib.parse.quote(str(serial), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/devices/{serial}/liveTools/routingTable/{id}" - - return self._session.get(metadata, resource) - - def createDeviceLiveToolsSpeedTest(self, serial: str, **kwargs): - """ - **Enqueue a job to execute a speed test from a device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-speed-test - - - serial (string): Serial - - interface (string): Optional filter for a specific WAN interface. Valid interfaces are wan1, wan2, wan3, wan4. Default will return wan1. - """ - - kwargs.update(locals()) - - if "interface" in kwargs: - options = ["wan1", "wan2", "wan3", "wan4"] - assert kwargs["interface"] in options, ( - f'''"interface" cannot be "{kwargs["interface"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["devices", "liveTools", "speedTest"], - "operation": "createDeviceLiveToolsSpeedTest", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/speedTest" - - body_params = [ - "interface", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsSpeedTest: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getDeviceLiveToolsSpeedTest(self, serial: str, id: str): - """ - **Returns a speed test result in megabits per second** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-speed-test - - - serial (string): Serial - - id (string): ID - """ - - metadata = { - "tags": ["devices", "liveTools", "speedTest"], - "operation": "getDeviceLiveToolsSpeedTest", - } - serial = urllib.parse.quote(str(serial), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/devices/{serial}/liveTools/speedTest/{id}" - - return self._session.get(metadata, resource) - def createDeviceLiveToolsThroughputTest(self, serial: str, **kwargs): """ **Enqueue a job to test a device throughput, the test will run for 10 secs to test throughput** @@ -1340,110 +963,6 @@ def getDeviceLiveToolsThroughputTest(self, serial: str, throughputTestId: str): return self._session.get(metadata, resource) - def createDeviceLiveToolsTraceRoute(self, serial: str, target: str, sourceInterface: str, **kwargs): - """ - **Enqueue a job to run trace route in the device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-trace-route - - - serial (string): Serial - - target (string): Destination Host name or address - - sourceInterface (string): Source Interface IP address - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["devices", "liveTools", "traceRoute"], - "operation": "createDeviceLiveToolsTraceRoute", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/traceRoute" - - body_params = [ - "target", - "sourceInterface", - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsTraceRoute: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getDeviceLiveToolsTraceRoute(self, serial: str, traceRouteId: str): - """ - **Return a trace route job** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-trace-route - - - serial (string): Serial - - traceRouteId (string): Trace route ID - """ - - metadata = { - "tags": ["devices", "liveTools", "traceRoute"], - "operation": "getDeviceLiveToolsTraceRoute", - } - serial = urllib.parse.quote(str(serial), safe="") - traceRouteId = urllib.parse.quote(str(traceRouteId), safe="") - resource = f"/devices/{serial}/liveTools/traceRoute/{traceRouteId}" - - return self._session.get(metadata, resource) - - def createDeviceLiveToolsVrrpTable(self, serial: str, **kwargs): - """ - **Enqueue a job to perform a VRRP table request for the device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-vrrp-table - - - serial (string): Serial - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["devices", "liveTools", "vrrpTable"], - "operation": "createDeviceLiveToolsVrrpTable", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/vrrpTable" - - body_params = [ - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsVrrpTable: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getDeviceLiveToolsVrrpTable(self, serial: str, vrrpTableId: str): - """ - **Return an VRRP table live tool job.** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-vrrp-table - - - serial (string): Serial - - vrrpTableId (string): Vrrp table ID - """ - - metadata = { - "tags": ["devices", "liveTools", "vrrpTable"], - "operation": "getDeviceLiveToolsVrrpTable", - } - serial = urllib.parse.quote(str(serial), safe="") - vrrpTableId = urllib.parse.quote(str(vrrpTableId), safe="") - resource = f"/devices/{serial}/liveTools/vrrpTable/{vrrpTableId}" - - return self._session.get(metadata, resource) - def createDeviceLiveToolsWakeOnLan(self, serial: str, vlanId: int, mac: str, **kwargs): """ **Enqueue a job to send a Wake-on-LAN packet from the device** diff --git a/meraki/aio/api/insight.py b/meraki/aio/api/insight.py index eab3e2a..98345d2 100644 --- a/meraki/aio/api/insight.py +++ b/meraki/aio/api/insight.py @@ -64,95 +64,6 @@ def getOrganizationInsightApplications(self, organizationId: str): return self._session.get(metadata, resource) - def createOrganizationInsightApplication(self, organizationId: str, counterSetRuleId: int, **kwargs): - """ - **Add an Insight tracked application** - https://developer.cisco.com/meraki/api-v1/#!create-organization-insight-application - - - organizationId (string): Organization ID - - counterSetRuleId (integer): The id of the counter set rule - - enableSmartThresholds (boolean): Enable Smart Thresholds - - thresholds (object): Thresholds defined by a user for each application - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["insight", "configure", "applications"], - "operation": "createOrganizationInsightApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/insight/applications" - - body_params = [ - "counterSetRuleId", - "enableSmartThresholds", - "thresholds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationInsightApplication: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def updateOrganizationInsightApplication(self, organizationId: str, applicationId: str, **kwargs): - """ - **Update an Insight tracked application** - https://developer.cisco.com/meraki/api-v1/#!update-organization-insight-application - - - organizationId (string): Organization ID - - applicationId (string): Application ID - - enableSmartThresholds (boolean): Enable Smart Thresholds - - thresholds (object): Thresholds defined by a user for each application - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["insight", "configure", "applications"], - "operation": "updateOrganizationInsightApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - applicationId = urllib.parse.quote(str(applicationId), safe="") - resource = f"/organizations/{organizationId}/insight/applications/{applicationId}" - - body_params = [ - "enableSmartThresholds", - "thresholds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationInsightApplication: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationInsightApplication(self, organizationId: str, applicationId: str): - """ - **Delete an Insight tracked application** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-insight-application - - - organizationId (string): Organization ID - - applicationId (string): Application ID - """ - - metadata = { - "tags": ["insight", "configure", "applications"], - "operation": "deleteOrganizationInsightApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - applicationId = urllib.parse.quote(str(applicationId), safe="") - resource = f"/organizations/{organizationId}/insight/applications/{applicationId}" - - return self._session.delete(metadata, resource) - def getOrganizationInsightMonitoredMediaServers(self, organizationId: str): """ **List the monitored media servers for this organization** @@ -283,154 +194,3 @@ def deleteOrganizationInsightMonitoredMediaServer(self, organizationId: str, mon resource = f"/organizations/{organizationId}/insight/monitoredMediaServers/{monitoredMediaServerId}" return self._session.delete(metadata, resource) - - def getOrganizationInsightSpeedTestResults(self, organizationId: str, serials: list, **kwargs): - """ - **List the speed tests for the given devices under this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-insight-speed-test-results - - - organizationId (string): Organization ID - - serials (array): A list of serial numbers. The returned results will be filtered to only include these serials. - - timespan (integer): Amount of seconds ago to query for results. Only include timespan OR both t0 & t1. - - t0 (integer): Start time to query for results in epoch seconds. Only include timespan OR both t0 & t1. - - t1 (integer): End time to query for results in epoch seconds. Only include timespan OR both t0 & t1. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["insight", "configure", "speedTestResults"], - "operation": "getOrganizationInsightSpeedTestResults", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/insight/speedTestResults" - - query_params = [ - "serials", - "timespan", - "t0", - "t1", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationInsightSpeedTestResults: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationInsightWebApps(self, organizationId: str): - """ - **Lists all default web applications rules with counter set rule ids** - https://developer.cisco.com/meraki/api-v1/#!get-organization-insight-web-apps - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["insight", "configure", "webApps"], - "operation": "getOrganizationInsightWebApps", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/insight/webApps" - - return self._session.get(metadata, resource) - - def createOrganizationInsightWebApp(self, organizationId: str, name: str, hostname: str, **kwargs): - """ - **Add a custom web application for Insight to be able to track** - https://developer.cisco.com/meraki/api-v1/#!create-organization-insight-web-app - - - organizationId (string): Organization ID - - name (string): The name of the Web Application - - hostname (string): The hostname of Web Application - """ - - kwargs = locals() - - metadata = { - "tags": ["insight", "configure", "webApps"], - "operation": "createOrganizationInsightWebApp", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/insight/webApps" - - body_params = [ - "name", - "hostname", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationInsightWebApp: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def updateOrganizationInsightWebApp(self, organizationId: str, customCounterSetRuleId: str, **kwargs): - """ - **Update a custom web application for Insight to be able to track** - https://developer.cisco.com/meraki/api-v1/#!update-organization-insight-web-app - - - organizationId (string): Organization ID - - customCounterSetRuleId (string): Custom counter set rule ID - - name (string): The name of the Web Application - - hostname (string): The hostname of Web Application - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["insight", "configure", "webApps"], - "operation": "updateOrganizationInsightWebApp", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - customCounterSetRuleId = urllib.parse.quote(str(customCounterSetRuleId), safe="") - resource = f"/organizations/{organizationId}/insight/webApps/{customCounterSetRuleId}" - - body_params = [ - "name", - "hostname", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationInsightWebApp: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationInsightWebApp(self, organizationId: str, customCounterSetRuleId: str): - """ - **Delete a custom web application by counter set rule id.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-insight-web-app - - - organizationId (string): Organization ID - - customCounterSetRuleId (string): Custom counter set rule ID - """ - - metadata = { - "tags": ["insight", "configure", "webApps"], - "operation": "deleteOrganizationInsightWebApp", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - customCounterSetRuleId = urllib.parse.quote(str(customCounterSetRuleId), safe="") - resource = f"/organizations/{organizationId}/insight/webApps/{customCounterSetRuleId}" - - return self._session.delete(metadata, resource) diff --git a/meraki/aio/api/licensing.py b/meraki/aio/api/licensing.py index c8ba0f9..962e765 100644 --- a/meraki/aio/api/licensing.py +++ b/meraki/aio/api/licensing.py @@ -45,39 +45,6 @@ def getAdministeredLicensingSubscriptionEntitlements(self, **kwargs): return self._session.get(metadata, resource, params) - def batchAdministeredLicensingSubscriptionNetworksFeatureTiersUpdate(self, **kwargs): - """ - **Batch change networks to their desired feature tier for specified product types** - https://developer.cisco.com/meraki/api-v1/#!batch-administered-licensing-subscription-networks-feature-tiers-update - - - items (array): List of networks and corresponding product types to update. Maximum 500 networks - - isAtomic (boolean): Flag to determine if the operation should act atomically - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["licensing", "configure", "subscription", "featureTiers"], - "operation": "batchAdministeredLicensingSubscriptionNetworksFeatureTiersUpdate", - } - resource = "/administered/licensing/subscription/networks/featureTiers/batchUpdate" - - body_params = [ - "items", - "isAtomic", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"batchAdministeredLicensingSubscriptionNetworksFeatureTiersUpdate: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - def getAdministeredLicensingSubscriptionSubscriptions( self, organizationIds: list, total_pages=1, direction="next", **kwargs ): diff --git a/meraki/aio/api/nac.py b/meraki/aio/api/nac.py deleted file mode 100644 index 0dcad5c..0000000 --- a/meraki/aio/api/nac.py +++ /dev/null @@ -1,1151 +0,0 @@ -import urllib - - -class AsyncNac: - def __init__(self, session): - super().__init__() - self._session = session - - def getOrganizationNacAuthorizationPolicies(self, organizationId: str, **kwargs): - """ - **Get all nac authorization policies for this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-authorization-policies - - - organizationId (string): Organization ID - - policyIds (array): List of ids for specific authorization policies retrieval - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "authorization", "policies"], - "operation": "getOrganizationNacAuthorizationPolicies", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/authorization/policies" - - query_params = [ - "policyIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationNacAuthorizationPolicies: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def createOrganizationNacAuthorizationPolicyRule( - self, organizationId: str, policyId: str, name: str, rank: int, authorizationProfile: dict, **kwargs - ): - """ - **Create a rule in an authorization policy set of an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-authorization-policy-rule - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - name (string): Name of Authorization rule - - rank (integer): Rank of Authorization rule - - authorizationProfile (object): Authorization profile associated with the rule - - enabled (boolean): Enabled status of authorization rule. Default is False. - - sourcePolicyVersion (string): Source policy version of the policy set containing this rule - - condition (object): Condition of Authorization rule. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "authorization", "policies", "rules"], - "operation": "createOrganizationNacAuthorizationPolicyRule", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - resource = f"/organizations/{organizationId}/nac/authorization/policies/{policyId}/rules" - - body_params = [ - "name", - "rank", - "enabled", - "sourcePolicyVersion", - "authorizationProfile", - "condition", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationNacAuthorizationPolicyRule: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationNacAuthorizationPolicyRule( - self, organizationId: str, policyId: str, ruleId: str, name: str, rank: int, authorizationProfile: dict, **kwargs - ): - """ - **Update an existing rule of an authorization policy set within an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-nac-authorization-policy-rule - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleId (string): Rule ID - - name (string): Name of Authorization rule - - rank (integer): Rank of Authorization rule - - authorizationProfile (object): Authorization profile associated with the rule - - enabled (boolean): Enabled status of authorization rule. Default is False. - - sourcePolicyVersion (string): Source policy version of the policy set containing this rule - - condition (object): Condition of Authorization rule. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "authorization", "policies", "rules"], - "operation": "updateOrganizationNacAuthorizationPolicyRule", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleId = urllib.parse.quote(str(ruleId), safe="") - resource = f"/organizations/{organizationId}/nac/authorization/policies/{policyId}/rules/{ruleId}" - - body_params = [ - "name", - "rank", - "enabled", - "sourcePolicyVersion", - "authorizationProfile", - "condition", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationNacAuthorizationPolicyRule: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationNacAuthorizationPolicyRule(self, organizationId: str, policyId: str, ruleId: str, **kwargs): - """ - **Delete a rule in an authorization policy set of an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-nac-authorization-policy-rule - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleId (string): Rule ID - - sourcePolicyVersion (string): Source policy version of the policy set containing this rule - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "authorization", "policies", "rules"], - "operation": "deleteOrganizationNacAuthorizationPolicyRule", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleId = urllib.parse.quote(str(ruleId), safe="") - resource = f"/organizations/{organizationId}/nac/authorization/policies/{policyId}/rules/{ruleId}" - - return self._session.delete(metadata, resource) - - def getOrganizationNacCertificates(self, organizationId: str, **kwargs): - """ - **Gets all certificates for an organization and can filter by certificate status, expiry date and last used date** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-certificates - - - organizationId (string): Organization ID - - status (string): Status Parameter for GetAll request - - expiry (boolean): Boolean indicating whether to filter by expiry in one month - - lastUsed (boolean): Boolean indicating whether to filter by last used in over one month - """ - - kwargs.update(locals()) - - if "status" in kwargs: - options = ["Disabled", "Enabled"] - assert kwargs["status"] in options, ( - f'''"status" cannot be "{kwargs["status"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["nac", "configure", "certificates"], - "operation": "getOrganizationNacCertificates", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates" - - query_params = [ - "status", - "expiry", - "lastUsed", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationNacCertificates: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def getOrganizationNacCertificatesAuthoritiesCrls(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get all the organization's CRL.It's possible to filter results by CRL issuers (CA) or CRL's ID - see caIds and crlIds query parameters.This endpoint could be used for 'show' action when you specify a single CRL ID in crlIds parameter** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-certificates-authorities-crls - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 5. - - 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. - - sortBy (string): Optional parameter to specify the field used to sort results. (default: caId) - - sortOrder (string): Optional parameter to specify the sort order. (default: asc) - - crlIds (array): A list of CRL ids. The returned CRLs will be filtered to only include these ids - - caIds (array): When ca Ids are provided, only CRLs associated to the given CA will be returned. Otherwise, all the CRLs created for an organization will be returned. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["caId", "createdAt", "lastUpdatedAt"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["nac", "configure", "certificates", "authorities", "crls"], - "operation": "getOrganizationNacCertificatesAuthoritiesCrls", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/authorities/crls" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "sortBy", - "sortOrder", - "crlIds", - "caIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "crlIds", - "caIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationNacCertificatesAuthoritiesCrls: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationNacCertificatesAuthoritiesCrl( - self, organizationId: str, caId: str, content: str, isDelta: bool, **kwargs - ): - """ - **Create a new CRL (either base or delta) for an existing CA** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-certificates-authorities-crl - - - organizationId (string): Organization ID - - caId (string): ID of the CRL issuer - - content (string): CRL content in PEM format - - isDelta (boolean): Whether it's a delta CRL or not - """ - - kwargs = locals() - - metadata = { - "tags": ["nac", "configure", "certificates", "authorities", "crls"], - "operation": "createOrganizationNacCertificatesAuthoritiesCrl", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/authorities/crls" - - body_params = [ - "caId", - "content", - "isDelta", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationNacCertificatesAuthoritiesCrl: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationNacCertificatesAuthoritiesCrlsDescriptors( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get all the organization's CRL descriptors (metadata only - revocation list data is excluded)** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-certificates-authorities-crls-descriptors - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 20. - - 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. - - sortBy (string): Optional parameter to specify the field used to sort results. (default: caId) - - sortOrder (string): Optional parameter to specify the sort order. (default: asc) - - caIds (array): When ca Ids are provided, only CRLs associated to the given CA will be returned. Otherwise, all the CRLs created for an organization will be returned. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["caId", "createdAt", "lastUpdatedAt"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["nac", "configure", "certificates", "authorities", "crls", "descriptors"], - "operation": "getOrganizationNacCertificatesAuthoritiesCrlsDescriptors", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/authorities/crls/descriptors" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "sortBy", - "sortOrder", - "caIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "caIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationNacCertificatesAuthoritiesCrlsDescriptors: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def deleteOrganizationNacCertificatesAuthoritiesCrl(self, organizationId: str, crlId: str): - """ - **Deletes a whole CRL, including all its deltas (in case of base CRL removal)** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-nac-certificates-authorities-crl - - - organizationId (string): Organization ID - - crlId (string): Crl ID - """ - - metadata = { - "tags": ["nac", "configure", "certificates", "authorities", "crls"], - "operation": "deleteOrganizationNacCertificatesAuthoritiesCrl", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - crlId = urllib.parse.quote(str(crlId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/authorities/crls/{crlId}" - - return self._session.delete(metadata, resource) - - def createOrganizationNacCertificatesImport(self, organizationId: str, contents: str, **kwargs): - """ - **Import certificate for this organization or validate without persisting** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-certificates-import - - - organizationId (string): Organization ID - - contents (string): Certificate content in valid PEM format - - dryRun (boolean): If true, validates the certificate without persisting it - - profile (object): Profile object containing certificate config fields - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "certificates", "import"], - "operation": "createOrganizationNacCertificatesImport", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/import" - - body_params = [ - "contents", - "dryRun", - "profile", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationNacCertificatesImport: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationNacCertificatesOverview(self, organizationId: str): - """ - **Get counts of Enabled, Disabled, Expired and Last Used certificates for this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-certificates-overview - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["nac", "configure", "certificates", "overview"], - "operation": "getOrganizationNacCertificatesOverview", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/overview" - - return self._session.get(metadata, resource) - - def updateOrganizationNacCertificate(self, organizationId: str, certificateId: str, profile: dict, **kwargs): - """ - **Update certificate configuration by certificateId for this organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-nac-certificate - - - organizationId (string): Organization ID - - certificateId (string): Certificate ID - - profile (object): Profile object containing certificate config fields - """ - - kwargs = locals() - - metadata = { - "tags": ["nac", "configure", "certificates"], - "operation": "updateOrganizationNacCertificate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - certificateId = urllib.parse.quote(str(certificateId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/{certificateId}" - - body_params = [ - "profile", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationNacCertificate: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getOrganizationNacClients(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get all known clients for the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-clients - - - 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 - - sortOrder (string): Query parameter for specifying the direction of sorting to use for the given sortKey. - - sortKey (string): Query parameter to sort the clients by the value of the specified key. - - 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. - - search (string): Optional parameter to fuzzy search on clients. - - clientIds (array): List of ids for specific client retrieval - - groupIds (array): List of group ids for client retrieval by group - - lastNetworkName (array): List of network names for client retrieval by last login network name - - ssid (array): List of SSID's to filter - - classification (object): Classification filters for client retrieval - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["ASC", "DESC"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - if "sortKey" in kwargs: - options = ["mac"] - assert kwargs["sortKey"] in options, ( - f'''"sortKey" cannot be "{kwargs["sortKey"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["nac", "configure", "clients"], - "operation": "getOrganizationNacClients", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients" - - query_params = [ - "sortOrder", - "sortKey", - "perPage", - "startingAfter", - "endingBefore", - "search", - "clientIds", - "groupIds", - "lastNetworkName", - "ssid", - "classification", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "clientIds", - "groupIds", - "lastNetworkName", - "ssid", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationNacClients: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationNacClient(self, organizationId: str, mac: str, **kwargs): - """ - **Create a client for the organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-client - - - organizationId (string): Organization ID - - mac (string): The MAC address of the client - - type (string): Type describes if the network client belongs to an individual user or corporate - - owner (string): The username of the owner of the client - - description (string): User provided description for the client - - uuid (string): Universally unique identifier of the client - - userDetails (array): List of users of this network client - - oui (object): Organizationally unique identifier assigned to a vendor of the client - - groups (array): List of group members associated with the client - """ - - kwargs.update(locals()) - - if "type" in kwargs: - options = ["BYOD", "corporate"] - assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["nac", "configure", "clients"], - "operation": "createOrganizationNacClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients" - - body_params = [ - "type", - "owner", - "mac", - "description", - "uuid", - "userDetails", - "oui", - "groups", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationNacClient: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def bulkOrganizationNacClientsDelete(self, organizationId: str, clientIds: list, **kwargs): - """ - **Delete existing client(s) for the organization** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-nac-clients-delete - - - organizationId (string): Organization ID - - clientIds (array): List of ids for specific client retrieval - """ - - kwargs = locals() - - metadata = { - "tags": ["nac", "configure", "clients"], - "operation": "bulkOrganizationNacClientsDelete", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/bulkDelete" - - body_params = [ - "clientIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"bulkOrganizationNacClientsDelete: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def createOrganizationNacClientsBulkEdit(self, organizationId: str, clientIds: list, **kwargs): - """ - **Bulk Update of existing clients for the organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-clients-bulk-edit - - - organizationId (string): Organization ID - - clientIds (array): List of clients ids to apply the bulk edit operation on. - - description (string): User provided description to be applied on the list of clients provided - - groups (object): Client group information to be applied on the list of clients provided - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "clients", "bulkEdit"], - "operation": "createOrganizationNacClientsBulkEdit", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/bulkEdit" - - body_params = [ - "clientIds", - "description", - "groups", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationNacClientsBulkEdit: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def createOrganizationNacClientsBulkUpload( - self, organizationId: str, contents: str, updateClients: bool, createClientGroups: bool, **kwargs - ): - """ - **Bulk upload of clients, client groups and their associations for the organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-clients-bulk-upload - - - organizationId (string): Organization ID - - contents (string): CSV file content in Base64 encoded string format - - updateClients (boolean): The updateClients indicates whether existing clients must be updated with new data from the CSV - - createClientGroups (boolean): The createClientGroups indicates whether new client groups must be created or not - """ - - kwargs = locals() - - metadata = { - "tags": ["nac", "configure", "clients", "bulkUpload"], - "operation": "createOrganizationNacClientsBulkUpload", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/bulkUpload" - - body_params = [ - "contents", - "updateClients", - "createClientGroups", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationNacClientsBulkUpload: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationNacClientsGroups(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get all known client groups for the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-clients-groups - - - 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 - - sortOrder (string): Query parameter for specifying the direction of sorting to use for the given sortKey. - - sortKey (string): Query parameter to sort the client groups by the value of the specified key. - - 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. - - search (string): Optional parameter to fuzzy search on client groups. - - groupIds (array): List of ids for specific group retrieval - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["ASC", "DESC"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - if "sortKey" in kwargs: - options = ["name"] - assert kwargs["sortKey"] in options, ( - f'''"sortKey" cannot be "{kwargs["sortKey"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["nac", "configure", "clients", "groups"], - "operation": "getOrganizationNacClientsGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/groups" - - query_params = [ - "sortOrder", - "sortKey", - "perPage", - "startingAfter", - "endingBefore", - "search", - "groupIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "groupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationNacClientsGroups: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationNacClientsGroup(self, organizationId: str, name: str, **kwargs): - """ - **Create a client group for the organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-clients-group - - - organizationId (string): Organization ID - - name (string): The name of the group for access control model - - description (string): User provided description of the group - - members (array): List of client members associated with the group - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "clients", "groups"], - "operation": "createOrganizationNacClientsGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/groups" - - body_params = [ - "name", - "description", - "members", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationNacClientsGroup: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def updateOrganizationNacClientsGroup(self, organizationId: str, groupId: str, **kwargs): - """ - **Update an existing client group for the organization with bulk member operations** - https://developer.cisco.com/meraki/api-v1/#!update-organization-nac-clients-group - - - organizationId (string): Organization ID - - groupId (string): Group ID - - name (string): The name of the group for access control model - - description (string): User provided description of the group - - members (object): Bulk member operations with addList/removeList arrays - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "clients", "groups"], - "operation": "updateOrganizationNacClientsGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/groups/{groupId}" - - body_params = [ - "name", - "description", - "members", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationNacClientsGroup: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationNacClientsGroup(self, organizationId: str, groupId: str): - """ - **Delete an existing client group for the organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-nac-clients-group - - - organizationId (string): Organization ID - - groupId (string): Group ID - """ - - metadata = { - "tags": ["nac", "configure", "clients", "groups"], - "operation": "deleteOrganizationNacClientsGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/groups/{groupId}" - - return self._session.delete(metadata, resource) - - def getOrganizationNacClientsOverview(self, organizationId: str): - """ - **Get overview data for all known clients for the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-clients-overview - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["nac", "configure", "clients", "overview"], - "operation": "getOrganizationNacClientsOverview", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/overview" - - return self._session.get(metadata, resource) - - def updateOrganizationNacClient(self, organizationId: str, clientId: str, mac: str, **kwargs): - """ - **Update an existing client for the organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-nac-client - - - organizationId (string): Organization ID - - clientId (string): Client ID - - mac (string): The MAC address of the client - - type (string): Type describes if the network client belongs to an individual user or corporate - - owner (string): The username of the owner of the client - - description (string): User provided description for the client - - uuid (string): Universally unique identifier of the client - - userDetails (array): List of users of this network client - - oui (object): Organizationally unique identifier assigned to a vendor of the client - - groups (object): Client group membership changes - """ - - kwargs.update(locals()) - - if "type" in kwargs: - options = ["BYOD", "corporate"] - assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["nac", "configure", "clients"], - "operation": "updateOrganizationNacClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - clientId = urllib.parse.quote(str(clientId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/{clientId}" - - body_params = [ - "type", - "owner", - "mac", - "description", - "uuid", - "userDetails", - "oui", - "groups", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationNacClient: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getOrganizationNacDictionaries(self, organizationId: str): - """ - **Get all NAC dictionaries** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-dictionaries - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["nac", "configure", "dictionaries"], - "operation": "getOrganizationNacDictionaries", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/dictionaries" - - return self._session.get(metadata, resource) - - def getOrganizationNacDictionaryAttributes(self, organizationId: str, dictionaryId: str, **kwargs): - """ - **Get all attributes by dictionary ID** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-dictionary-attributes - - - organizationId (string): Organization ID - - dictionaryId (string): Dictionary ID - - networkIds (array): An optional list of network IDs to filter the 'enum' field. Only enum values applicable to the specified networks will be returned. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "dictionaries", "attributes"], - "operation": "getOrganizationNacDictionaryAttributes", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - dictionaryId = urllib.parse.quote(str(dictionaryId), safe="") - resource = f"/organizations/{organizationId}/nac/dictionaries/{dictionaryId}/attributes" - - query_params = [ - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationNacDictionaryAttributes: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationNacDictionaryAttributeValues( - self, organizationId: str, dictionaryId: str, attributeName: str, **kwargs - ): - """ - **Search allowed values for a dictionary attribute** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-dictionary-attribute-values - - - organizationId (string): Organization ID - - dictionaryId (string): Dictionary ID - - attributeName (string): Attribute name - - search (string): Optional search string for contains-match filtering of allowed values - - networkIds (array): An optional list of network IDs to filter the allowed values. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "dictionaries", "attributes", "values"], - "operation": "getOrganizationNacDictionaryAttributeValues", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - dictionaryId = urllib.parse.quote(str(dictionaryId), safe="") - attributeName = urllib.parse.quote(str(attributeName), safe="") - resource = f"/organizations/{organizationId}/nac/dictionaries/{dictionaryId}/attributes/{attributeName}/values" - - query_params = [ - "search", - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationNacDictionaryAttributeValues: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationNacLicenseUsage(self, organizationId: str, startDate: str, **kwargs): - """ - **Returns license usage data for a specific organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-license-usage - - - organizationId (string): Organization ID - - startDate (string): Start date for the usage data in UTC timezone - - endDate (string): End date for the usage data in UTC timezone - - networkIds (array): List of locale and node group ids - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "license", "usage"], - "operation": "getOrganizationNacLicenseUsage", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/license/usage" - - query_params = [ - "startDate", - "endDate", - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationNacLicenseUsage: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def getOrganizationNacSessionsHistory(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the NAC Sessions for this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-sessions-history - - - 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 - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is 1 hour. - - 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": ["nac", "configure", "sessions", "history"], - "operation": "getOrganizationNacSessionsHistory", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/sessions/history" - - query_params = [ - "t0", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationNacSessionsHistory: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationNacSessionDetails(self, organizationId: str, sessionId: str): - """ - **Return the details of selected NAC Sessions** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-session-details - - - organizationId (string): Organization ID - - sessionId (string): Session ID - """ - - metadata = { - "tags": ["nac", "configure", "sessions", "details"], - "operation": "getOrganizationNacSessionDetails", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - sessionId = urllib.parse.quote(str(sessionId), safe="") - resource = f"/organizations/{organizationId}/nac/sessions/{sessionId}/details" - - return self._session.get(metadata, resource) diff --git a/meraki/aio/api/networks.py b/meraki/aio/api/networks.py index e995d1d..83c085c 100644 --- a/meraki/aio/api/networks.py +++ b/meraki/aio/api/networks.py @@ -855,23 +855,6 @@ def vmxNetworkDevicesClaim(self, networkId: str, size: str, **kwargs): return self._session.post(metadata, resource, payload) - def getNetworkDevicesJson(self, networkId: str): - """ - **Extraction of the legacy nodes JSON endpoint for a network** - https://developer.cisco.com/meraki/api-v1/#!get-network-devices-json - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["networks", "configure", "devices", "json"], - "operation": "getNetworkDevicesJson", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/devices/json" - - return self._session.get(metadata, resource) - def removeNetworkDevices(self, networkId: str, serial: str, **kwargs): """ **Remove a single device** @@ -1503,7 +1486,6 @@ def createNetworkFloorPlan(self, networkId: str, name: str, imageContents: str, - topLeftCorner (object): The longitude and latitude of the top left corner of your floor plan. - topRightCorner (object): The longitude and latitude of the top right corner of your floor plan. - floorNumber (number): The floor number of the floors within the building - - buildingId (string): The ID of the building that this floor belongs to. """ kwargs.update(locals()) @@ -1523,7 +1505,6 @@ def createNetworkFloorPlan(self, networkId: str, name: str, imageContents: str, "topLeftCorner", "topRightCorner", "floorNumber", - "buildingId", "imageContents", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1720,7 +1701,6 @@ def updateNetworkFloorPlan(self, networkId: str, floorPlanId: str, **kwargs): - topLeftCorner (object): The longitude and latitude of the top left corner of your floor plan. - topRightCorner (object): The longitude and latitude of the top right corner of your floor plan. - floorNumber (number): The floor number of the floors within the building - - buildingId (string): The ID of the building that this floor belongs to. - imageContents (string): The file contents (a base 64 encoded string) of your new image. Supported formats are PNG, GIF, and JPG. Note that all images are saved as PNG files, regardless of the format they are uploaded in. If you upload a new image, and you do NOT specify any new geolocation fields ('center, 'topLeftCorner', etc), the floor plan will be recentered with no rotation in order to maintain the aspect ratio of your new image. """ @@ -1742,7 +1722,6 @@ def updateNetworkFloorPlan(self, networkId: str, floorPlanId: str, **kwargs): "topLeftCorner", "topRightCorner", "floorNumber", - "buildingId", "imageContents", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1970,106 +1949,6 @@ def getNetworkHealthAlerts(self, networkId: str): return self._session.get(metadata, resource) - def getNetworkLocationScanning(self, networkId: str): - """ - **Return scanning API settings** - https://developer.cisco.com/meraki/api-v1/#!get-network-location-scanning - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["networks", "configure", "locationScanning"], - "operation": "getNetworkLocationScanning", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/locationScanning" - - return self._session.get(metadata, resource) - - def updateNetworkLocationScanning(self, networkId: str, **kwargs): - """ - **Change scanning API settings** - https://developer.cisco.com/meraki/api-v1/#!update-network-location-scanning - - - networkId (string): Network ID - - analyticsEnabled (boolean): Collect location and scanning analytics - - scanningApiEnabled (boolean): Enable push API for scanning events, analytics must be enabled - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["networks", "configure", "locationScanning"], - "operation": "updateNetworkLocationScanning", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/locationScanning" - - body_params = [ - "analyticsEnabled", - "scanningApiEnabled", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkLocationScanning: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getNetworkLocationScanningHttpServers(self, networkId: str): - """ - **Return list of scanning API receivers** - https://developer.cisco.com/meraki/api-v1/#!get-network-location-scanning-http-servers - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["networks", "configure", "locationScanning", "httpServers"], - "operation": "getNetworkLocationScanningHttpServers", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/locationScanning/httpServers" - - return self._session.get(metadata, resource) - - def updateNetworkLocationScanningHttpServers(self, networkId: str, endpoints: list, **kwargs): - """ - **Set the list of scanning API receivers** - https://developer.cisco.com/meraki/api-v1/#!update-network-location-scanning-http-servers - - - networkId (string): Network ID - - endpoints (array): A set of http server configurations - """ - - kwargs = locals() - - metadata = { - "tags": ["networks", "configure", "locationScanning", "httpServers"], - "operation": "updateNetworkLocationScanningHttpServers", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/locationScanning/httpServers" - - body_params = [ - "endpoints", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateNetworkLocationScanningHttpServers: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - def getNetworkMerakiAuthUsers(self, networkId: str): """ **List the authorized users configured under Meraki Authentication for a network (splash guest or RADIUS users for a wireless network, or client VPN users for a MX network)** @@ -2227,17 +2106,14 @@ def updateNetworkMerakiAuthUser(self, networkId: str, merakiAuthUserId: str, **k return self._session.put(metadata, resource, payload) - def getNetworkMqttBrokers(self, networkId: str, **kwargs): + def getNetworkMqttBrokers(self, networkId: str): """ **List the MQTT brokers for this network** https://developer.cisco.com/meraki/api-v1/#!get-network-mqtt-brokers - networkId (string): Network ID - - productTypes (array): Optional parameter to filter MQTT brokers by product type. If multiple types are provided, the query will return brokers that match any of the provided types. """ - kwargs.update(locals()) - metadata = { "tags": ["networks", "configure", "mqttBrokers"], "operation": "getNetworkMqttBrokers", @@ -2245,26 +2121,7 @@ def getNetworkMqttBrokers(self, networkId: str, **kwargs): networkId = urllib.parse.quote(str(networkId), safe="") resource = f"/networks/{networkId}/mqttBrokers" - query_params = [ - "productTypes", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "productTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getNetworkMqttBrokers: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) + return self._session.get(metadata, resource) def createNetworkMqttBroker(self, networkId: str, name: str, host: str, port: int, **kwargs): """ @@ -2277,17 +2134,10 @@ def createNetworkMqttBroker(self, networkId: str, name: str, host: str, port: in - port (integer): Host port though which the MQTT broker can be reached. - security (object): Security settings of the MQTT broker. - authentication (object): Authentication settings of the MQTT broker - - productType (string): The product type for which the MQTT broker is being created. """ kwargs.update(locals()) - if "productType" in kwargs: - options = ["camera", "wireless"] - assert kwargs["productType"] in options, ( - f'''"productType" cannot be "{kwargs["productType"]}", & must be set to one of: {options}''' - ) - metadata = { "tags": ["networks", "configure", "mqttBrokers"], "operation": "createNetworkMqttBroker", @@ -2301,7 +2151,6 @@ def createNetworkMqttBroker(self, networkId: str, name: str, host: str, port: in "port", "security", "authentication", - "productType", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2788,7 +2637,6 @@ def updateNetworkSettings(self, networkId: str, **kwargs): - remoteStatusPageEnabled (boolean): Enables / disables access to the device status page (http://[device's LAN IP]). Optional. Can only be set if localStatusPageEnabled is set to true - localStatusPage (object): A hash of Local Status page(s)' authentication options applied to the Network. - securePort (object): A hash of SecureConnect options applied to the Network. - - fips (object): A hash of FIPS options applied to the Network - namedVlans (object): A hash of Named VLANs options applied to the Network. """ @@ -2806,7 +2654,6 @@ def updateNetworkSettings(self, networkId: str, **kwargs): "remoteStatusPageEnabled", "localStatusPage", "securePort", - "fips", "namedVlans", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2819,93 +2666,6 @@ def updateNetworkSettings(self, networkId: str, **kwargs): return self._session.put(metadata, resource, payload) - def createNetworkSitesBuilding(self, networkId: str, name: str, **kwargs): - """ - **Create a new building** - https://developer.cisco.com/meraki/api-v1/#!create-network-sites-building - - - networkId (string): Network ID - - name (string): The name of the building - - floors (array): The floors of the building - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["networks", "configure", "sites", "buildings"], - "operation": "createNetworkSitesBuilding", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sites/buildings" - - body_params = [ - "name", - "floors", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createNetworkSitesBuilding: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def deleteNetworkSitesBuilding(self, networkId: str, buildingId: str): - """ - **Delete a building** - https://developer.cisco.com/meraki/api-v1/#!delete-network-sites-building - - - networkId (string): Network ID - - buildingId (string): Building ID - """ - - metadata = { - "tags": ["networks", "configure", "sites", "buildings"], - "operation": "deleteNetworkSitesBuilding", - } - networkId = urllib.parse.quote(str(networkId), safe="") - buildingId = urllib.parse.quote(str(buildingId), safe="") - resource = f"/networks/{networkId}/sites/buildings/{buildingId}" - - return self._session.delete(metadata, resource) - - def updateNetworkSitesBuilding(self, networkId: str, buildingId: str, **kwargs): - """ - **Update a building** - https://developer.cisco.com/meraki/api-v1/#!update-network-sites-building - - - networkId (string): Network ID - - buildingId (string): Building ID - - name (string): The name of the building - - floors (array): The floors of the building - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["networks", "configure", "sites", "buildings"], - "operation": "updateNetworkSitesBuilding", - } - networkId = urllib.parse.quote(str(networkId), safe="") - buildingId = urllib.parse.quote(str(buildingId), safe="") - resource = f"/networks/{networkId}/sites/buildings/{buildingId}" - - body_params = [ - "name", - "floors", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkSitesBuilding: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def getNetworkSnmp(self, networkId: str): """ **Return the SNMP settings for a network** @@ -2968,47 +2728,6 @@ def updateNetworkSnmp(self, networkId: str, **kwargs): return self._session.put(metadata, resource, payload) - def updateNetworkSnmpTraps(self, networkId: str, **kwargs): - """ - **Update the SNMP trap configuration for the specified network** - https://developer.cisco.com/meraki/api-v1/#!update-network-snmp-traps - - - networkId (string): Network ID - - mode (string): SNMP trap protocol version - - receiver (object): Stores the port and address - - v2 (object): V2 mode - - v3 (object): V3 mode - """ - - kwargs.update(locals()) - - if "mode" in kwargs: - options = ["disabled", "v1/v2c", "v3"] - assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["networks", "configure", "snmp", "traps"], - "operation": "updateNetworkSnmpTraps", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/snmp/traps" - - body_params = [ - "mode", - "receiver", - "v2", - "v3", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkSnmpTraps: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def getNetworkSplashLoginAttempts(self, networkId: str, **kwargs): """ **List the splash login attempts for a network** @@ -3321,10 +3040,9 @@ def createNetworkVlanProfile(self, networkId: str, name: str, vlanNames: list, v - vlanNames (array): An array of named VLANs - vlanGroups (array): An array of VLAN groups - iname (string): IName of the profile - - allowedVlans (string): The VLANs allowed on the VLAN profile. Only applicable to trunk ports. The given range must be inclusive of all named VLANs. """ - kwargs.update(locals()) + kwargs = locals() metadata = { "tags": ["networks", "configure", "vlanProfiles"], @@ -3335,7 +3053,6 @@ def createNetworkVlanProfile(self, networkId: str, name: str, vlanNames: list, v body_params = [ "name", - "allowedVlans", "vlanNames", "vlanGroups", "iname", @@ -3471,10 +3188,9 @@ def updateNetworkVlanProfile(self, networkId: str, iname: str, name: str, vlanNa - name (string): Name of the profile, string length must be from 1 to 255 characters - vlanNames (array): An array of named VLANs - vlanGroups (array): An array of VLAN groups - - allowedVlans (string): The VLANs allowed on the VLAN profile. Only applicable to trunk ports. The given range must be inclusive of all named VLANs. """ - kwargs.update(locals()) + kwargs = locals() metadata = { "tags": ["networks", "configure", "vlanProfiles"], @@ -3486,7 +3202,6 @@ def updateNetworkVlanProfile(self, networkId: str, iname: str, name: str, vlanNa body_params = [ "name", - "allowedVlans", "vlanNames", "vlanGroups", ] diff --git a/meraki/aio/api/organizations.py b/meraki/aio/api/organizations.py index 178a9e7..c043f25 100644 --- a/meraki/aio/api/organizations.py +++ b/meraki/aio/api/organizations.py @@ -1083,329 +1083,6 @@ def deleteOrganizationAlertsProfile(self, organizationId: str, alertConfigId: st return self._session.delete(metadata, resource) - def getOrganizationApiPushProfiles(self, organizationId: str, **kwargs): - """ - **List the push profiles in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-push-profiles - - - organizationId (string): Organization ID - - inames (array): Optional parameter to filter the result set by the included set of push profile inames - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "api", "push", "profiles"], - "operation": "getOrganizationApiPushProfiles", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/api/push/profiles" - - query_params = [ - "inames", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "inames", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationApiPushProfiles: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def createOrganizationApiPushProfile(self, organizationId: str, iname: str, topic: dict, receiver: dict, **kwargs): - """ - **Create a new push profile** - https://developer.cisco.com/meraki/api-v1/#!create-organization-api-push-profile - - - organizationId (string): Organization ID - - iname (string): Immutable name of the resource. Must be unique within resources of this type. - - topic (object): Push topic - - receiver (object): Push receiver profile - - name (string): Name of push profile - - description (string): Description of push profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "api", "push", "profiles"], - "operation": "createOrganizationApiPushProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/api/push/profiles" - - body_params = [ - "iname", - "name", - "description", - "topic", - "receiver", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationApiPushProfile: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def updateOrganizationApiPushProfile(self, organizationId: str, iname: str, **kwargs): - """ - **Update a push profile** - https://developer.cisco.com/meraki/api-v1/#!update-organization-api-push-profile - - - organizationId (string): Organization ID - - iname (string): Iname - - name (string): Name of push profile - - description (string): Description of push profile - - topic (object): Push topic - - receiver (object): Push receiver profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "api", "push", "profiles"], - "operation": "updateOrganizationApiPushProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - iname = urllib.parse.quote(str(iname), safe="") - resource = f"/organizations/{organizationId}/api/push/profiles/{iname}" - - body_params = [ - "name", - "description", - "topic", - "receiver", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationApiPushProfile: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationApiPushProfile(self, organizationId: str, iname: str): - """ - **Delete a push profile** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-api-push-profile - - - organizationId (string): Organization ID - - iname (string): Iname - """ - - metadata = { - "tags": ["organizations", "configure", "api", "push", "profiles"], - "operation": "deleteOrganizationApiPushProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - iname = urllib.parse.quote(str(iname), safe="") - resource = f"/organizations/{organizationId}/api/push/profiles/{iname}" - - return self._session.delete(metadata, resource) - - def getOrganizationApiPushReceiversProfiles(self, organizationId: str): - """ - **List the push receiver profiles in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-push-receivers-profiles - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "api", "push", "receivers", "profiles"], - "operation": "getOrganizationApiPushReceiversProfiles", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/api/push/receivers/profiles" - - return self._session.get(metadata, resource) - - def createOrganizationApiPushReceiversProfile(self, organizationId: str, iname: str, receiver: dict, **kwargs): - """ - **Create a new push receiver profile** - https://developer.cisco.com/meraki/api-v1/#!create-organization-api-push-receivers-profile - - - organizationId (string): Organization ID - - iname (string): Immutable name of the resource. Must be unique within resources of this type. - - receiver (object): Webhook receiver - - name (string): Name of receiver profile - - description (string): Description of receiver profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "api", "push", "receivers", "profiles"], - "operation": "createOrganizationApiPushReceiversProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/api/push/receivers/profiles" - - body_params = [ - "iname", - "name", - "description", - "receiver", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationApiPushReceiversProfile: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def deleteOrganizationApiPushReceiversProfile(self, organizationId: str, iname: str): - """ - **Delete a push receiver profile** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-api-push-receivers-profile - - - organizationId (string): Organization ID - - iname (string): Iname - """ - - metadata = { - "tags": ["organizations", "configure", "api", "push", "receivers", "profiles"], - "operation": "deleteOrganizationApiPushReceiversProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - iname = urllib.parse.quote(str(iname), safe="") - resource = f"/organizations/{organizationId}/api/push/receivers/profiles/{iname}" - - return self._session.delete(metadata, resource) - - def updateOrganizationApiPushReceiversProfile(self, organizationId: str, iname: str, **kwargs): - """ - **Update a push receiver profile** - https://developer.cisco.com/meraki/api-v1/#!update-organization-api-push-receivers-profile - - - organizationId (string): Organization ID - - iname (string): Iname - - name (string): Name of the receiver profile - - description (string): Description of the receiver profile - - receiver (object): API Push Receiver details - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "api", "push", "receivers", "profiles"], - "operation": "updateOrganizationApiPushReceiversProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - iname = urllib.parse.quote(str(iname), safe="") - resource = f"/organizations/{organizationId}/api/push/receivers/profiles/{iname}" - - body_params = [ - "name", - "description", - "receiver", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationApiPushReceiversProfile: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def getOrganizationApiPushTopics(self, organizationId: str): - """ - **List of push topics** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-push-topics - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "api", "push", "topics"], - "operation": "getOrganizationApiPushTopics", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/api/push/topics" - - return self._session.get(metadata, resource) - - def getOrganizationApiRestProvisioningPipelines(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List pipelines with operation and status metadata, sorted by pipeline ID** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-rest-provisioning-pipelines - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'descending'. - - status (string): If provided, filters pipelines by status. If omitted, pipelines of all statuses are returned. `pending` pipelines have not started, `active` pipelines have started but not finished, `success` pipelines completed successfully, and `error` pipelines failed. - - timespan (integer): Created-at lookback for matching pipelines, in seconds. Defaults to 7200 seconds. The maximum is 30 days. - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["ascending", "descending"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - if "status" in kwargs: - options = ["active", "error", "pending", "success"] - assert kwargs["status"] in options, ( - f'''"status" cannot be "{kwargs["status"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "api", "rest", "provisioning", "pipelines"], - "operation": "getOrganizationApiRestProvisioningPipelines", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/api/rest/provisioning/pipelines" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "sortOrder", - "status", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApiRestProvisioningPipelines: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationApiRestProvisioningPipelinesJobs(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **List pipeline jobs, with optional status filtering** @@ -1692,180 +1369,32 @@ def getOrganizationApiRequestsOverviewResponseCodesByInterval(self, organization return self._session.get(metadata, resource, params) - def getOrganizationApiRequestsResponseCodesHistoryByAdmin(self, organizationId: str, **kwargs): + def getOrganizationAssuranceAlerts(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Lists API request response codes and their counts aggregated by admin** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-requests-response-codes-history-by-admin + **Return all health alerts for an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-alerts - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "apiRequests", "responseCodes", "history", "byAdmin"], - "operation": "getOrganizationApiRequestsResponseCodesHistoryByAdmin", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/apiRequests/responseCodes/history/byAdmin" - - query_params = [ - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApiRequestsResponseCodesHistoryByAdmin: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationApiRequestsResponseCodesHistoryByApplication(self, organizationId: str, **kwargs): - """ - **Lists API request response codes and their counts aggregated by application** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-requests-response-codes-history-by-application - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "apiRequests", "responseCodes", "history", "byApplication"], - "operation": "getOrganizationApiRequestsResponseCodesHistoryByApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/apiRequests/responseCodes/history/byApplication" - - query_params = [ - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApiRequestsResponseCodesHistoryByApplication: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationApiRequestsResponseCodesHistoryByOperation(self, organizationId: str, **kwargs): - """ - **Aggregates API usage data by operationId** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-requests-response-codes-history-by-operation - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "apiRequests", "responseCodes", "history", "byOperation"], - "operation": "getOrganizationApiRequestsResponseCodesHistoryByOperation", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/apiRequests/responseCodes/history/byOperation" - - query_params = [ - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApiRequestsResponseCodesHistoryByOperation: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationApiRequestsResponseCodesHistoryBySourceIp(self, organizationId: str, **kwargs): - """ - **Aggregates API usage by source ip** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-requests-response-codes-history-by-source-ip - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "apiRequests", "responseCodes", "history", "bySourceIp"], - "operation": "getOrganizationApiRequestsResponseCodesHistoryBySourceIp", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/apiRequests/responseCodes/history/bySourceIp" - - query_params = [ - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApiRequestsResponseCodesHistoryBySourceIp: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceAlerts(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return all health alerts for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-alerts - - - 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 4 - 300. Default is 30. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'ascending'. - - networkId (string): Optional parameter to filter alerts by network ids. - - severity (string): Optional parameter to filter by severity type. - - types (array): Optional parameter to filter by alert type. - - tsStart (string): Optional parameter to filter by starting timestamp - - tsEnd (string): Optional parameter to filter by end timestamp - - category (string): Optional parameter to filter by category. - - sortBy (string): Optional parameter to set column to sort by. - - serials (array): Optional parameter to filter by primary device serial - - deviceTypes (array): Optional parameter to filter by device types - - deviceTags (array): Optional parameter to filter by device tags - - active (boolean): Optional parameter to filter by active alerts defaults to true - - dismissed (boolean): Optional parameter to filter by dismissed alerts defaults to false - - resolved (boolean): Optional parameter to filter by resolved alerts defaults to false - - suppressAlertsForOfflineNodes (boolean): When set to true the api will only return connectivity alerts for a given device if that device is in an offline state. This only applies to devices. This is ignored when resolved is true. Example: If a Switch has a VLan Mismatch and is Unreachable. only the Unreachable alert will be returned. Defaults to false. + - 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 4 - 300. Default is 30. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'ascending'. + - networkId (string): Optional parameter to filter alerts by network ids. + - severity (string): Optional parameter to filter by severity type. + - types (array): Optional parameter to filter by alert type. + - tsStart (string): Optional parameter to filter by starting timestamp + - tsEnd (string): Optional parameter to filter by end timestamp + - category (string): Optional parameter to filter by category. + - sortBy (string): Optional parameter to set column to sort by. + - serials (array): Optional parameter to filter by primary device serial + - deviceTypes (array): Optional parameter to filter by device types + - deviceTags (array): Optional parameter to filter by device tags + - active (boolean): Optional parameter to filter by active alerts defaults to true + - dismissed (boolean): Optional parameter to filter by dismissed alerts defaults to false + - resolved (boolean): Optional parameter to filter by resolved alerts defaults to false + - suppressAlertsForOfflineNodes (boolean): When set to true the api will only return connectivity alerts for a given device if that device is in an offline state. This only applies to devices. This is ignored when resolved is true. Example: If a Switch has a VLan Mismatch and is Unreachable. only the Unreachable alert will be returned. Defaults to false. """ kwargs.update(locals()) @@ -2379,2218 +1908,170 @@ def getOrganizationAssuranceAlert(self, organizationId: str, id: str): return self._session.get(metadata, resource) - def getOrganizationAssuranceClientsConnectedCountHistory(self, organizationId: str, networkId: str, **kwargs): + def getOrganizationBrandingPolicies(self, organizationId: str): """ - **Return combined wireless and wired connected client counts over time for a network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-clients-connected-count-history + **List the branding policies of an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-branding-policies - organizationId (string): Organization ID - - networkId (string): Network ID to query. - - serials (array): A list of serials of wireless AP or wired switch devices - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - ssidNumbers (array): Filter results by SSID number - - deviceType (string): Filter connected client counts by device type. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 8 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600. The default is 600. Interval is calculated if time params are provided. """ - kwargs.update(locals()) + metadata = { + "tags": ["organizations", "configure", "brandingPolicies"], + "operation": "getOrganizationBrandingPolicies", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/brandingPolicies" - if "deviceType" in kwargs: - options = ["access_point", "switch"] - assert kwargs["deviceType"] in options, ( - f'''"deviceType" cannot be "{kwargs["deviceType"]}", & must be set to one of: {options}''' - ) + return self._session.get(metadata, resource) + + 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 + + - organizationId (string): Organization ID + - name (string): Name of the Dashboard branding policy. + - enabled (boolean): Boolean indicating whether this policy is enabled. + - adminSettings (object): Settings for describing which kinds of admins this policy applies to. + - helpSettings (object): Settings for describing the modifications to various Help page features. Each property in this object accepts one of + 'default or inherit' (do not modify functionality), 'hide' (remove the section from Dashboard), or 'show' (always show + the section on Dashboard). Some properties in this object also accept custom HTML used to replace the section on + Dashboard; see the documentation for each property to see the allowed values. + Each property defaults to 'default or inherit' when not provided. + - customLogo (object): Properties describing the custom logo attached to the branding policy. + """ + + kwargs.update(locals()) metadata = { - "tags": ["organizations", "monitor", "clients", "connectedCountHistory"], - "operation": "getOrganizationAssuranceClientsConnectedCountHistory", + "tags": ["organizations", "configure", "brandingPolicies"], + "operation": "createOrganizationBrandingPolicy", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/clients/connectedCountHistory" - - query_params = [ - "networkId", - "serials", - "bands", - "ssidNumbers", - "deviceType", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + resource = f"/organizations/{organizationId}/brandingPolicies" - array_params = [ - "serials", - "bands", - "ssidNumbers", + body_params = [ + "name", + "enabled", + "adminSettings", + "helpSettings", + "customLogo", ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceClientsConnectedCountHistory: ignoring unrecognized kwargs: {invalid}" - ) + self._session._logger.warning(f"createOrganizationBrandingPolicy: ignoring unrecognized kwargs: {invalid}") - return self._session.get(metadata, resource, params) + return self._session.post(metadata, resource, payload) - def getOrganizationAssuranceClientsEvents(self, organizationId: str, clientId: str, networkId: str, **kwargs): + def getOrganizationBrandingPoliciesPriorities(self, organizationId: str): """ - **Given a client, get all alerts and events for a given timespan** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-clients-events + **Return the branding policy IDs of an organization in priority order** + https://developer.cisco.com/meraki/api-v1/#!get-organization-branding-policies-priorities - organizationId (string): Organization ID - - clientId (string): ID of client to query - - networkId (string): Network ID where client is connected - - filter (array): Optional parameter to filter by issue - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. """ - kwargs.update(locals()) - metadata = { - "tags": ["organizations", "configure", "clients", "events"], - "operation": "getOrganizationAssuranceClientsEvents", + "tags": ["organizations", "configure", "brandingPolicies", "priorities"], + "operation": "getOrganizationBrandingPoliciesPriorities", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/clients/events" - - query_params = [ - "filter", - "clientId", - "networkId", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "filter", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceClientsEvents: ignoring unrecognized kwargs: {invalid}" - ) + resource = f"/organizations/{organizationId}/brandingPolicies/priorities" - return self._session.get(metadata, resource, params) + return self._session.get(metadata, resource) - def getOrganizationAssuranceClientsEventsCorrelated( - self, organizationId: str, clientId: str, category: str, networkId: str, timestamp: str, **kwargs - ): + def updateOrganizationBrandingPoliciesPriorities(self, organizationId: str, **kwargs): """ - **Given a client, category, and timespan, return events that have a close connection to each other.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-clients-events-correlated + **Update the priority ordering of an organization's branding policies.** + https://developer.cisco.com/meraki/api-v1/#!update-organization-branding-policies-priorities - organizationId (string): Organization ID - - clientId (string): Client ID - - category (string): Category of events - - networkId (string): Network used by the client - - timestamp (string): Timestamp for the event - - lookback (integer): Amount of time in minutes to look back - - lookforward (integer): Amount of time in minutes to look forwards + - brandingPolicyIds (array): An ordered list of branding policy IDs that determines the priority order of how to apply the policies + """ kwargs.update(locals()) - if "category" in kwargs: - options = ["application", "association", "authentication", "dhcp", "dns"] - assert kwargs["category"] in options, ( - f'''"category" cannot be "{kwargs["category"]}", & must be set to one of: {options}''' - ) - metadata = { - "tags": ["organizations", "configure", "clients", "events", "correlated"], - "operation": "getOrganizationAssuranceClientsEventsCorrelated", + "tags": ["organizations", "configure", "brandingPolicies", "priorities"], + "operation": "updateOrganizationBrandingPoliciesPriorities", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/clients/events/correlated" + resource = f"/organizations/{organizationId}/brandingPolicies/priorities" - query_params = [ - "clientId", - "category", - "networkId", - "timestamp", - "lookback", - "lookforward", + body_params = [ + "brandingPolicyIds", ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} if self._session._validate_kwargs: - all_params = query_params + all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceClientsEventsCorrelated: ignoring unrecognized kwargs: {invalid}" + f"updateOrganizationBrandingPoliciesPriorities: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.put(metadata, resource, payload) - def getOrganizationAssuranceClientsTopologyCurrent(self, organizationId: str, clientId: str, networkId: str, **kwargs): + def getOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: str): """ - **Given a client, return current topology** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-clients-topology-current + **Return a branding policy** + https://developer.cisco.com/meraki/api-v1/#!get-organization-branding-policy - organizationId (string): Organization ID - - clientId (string): ID of client to query - - networkId (string): Network ID where client is connected + - brandingPolicyId (string): Branding policy ID """ - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "clients", "topology", "current"], - "operation": "getOrganizationAssuranceClientsTopologyCurrent", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/clients/topology/current" - - query_params = [ - "clientId", - "networkId", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceClientsTopologyCurrent: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceClientsTopologyNew(self, organizationId: str, clientIds: list, networkId: str, **kwargs): - """ - **Given a client, return current topology** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-clients-topology-new - - - organizationId (string): Organization ID - - clientIds (array): List of IDs for client retrieval for a given network. Limited to 1 client for now - - networkId (string): Network ID where client is connected - - timestamp (string): Timestamp for client topology path - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "clients", "topology", "new"], - "operation": "getOrganizationAssuranceClientsTopologyNew", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/clients/topology/new" - - query_params = [ - "clientIds", - "networkId", - "timestamp", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "clientIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceClientsTopologyNew: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceDevicesStatusesOverview(self, organizationId: str, **kwargs): - """ - **Returns counts of online, offline, and recovered devices by product type, along with offline intervals for impacted devices in the organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-devices-statuses-overview - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "devices", "statuses", "overview"], - "operation": "getOrganizationAssuranceDevicesStatusesOverview", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/devices/statuses/overview" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceDevicesStatusesOverview: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceFetchTableQuery(self, organizationId: str, tableName: str, **kwargs): - """ - **Returns the table data for a given timespan** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-fetch-table-query - - - organizationId (string): Organization ID - - tableName (string): The table from which we want to get data - - t0 (string): The beginning of the timespan for the data. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 365 days, 5 hours, 49 minutes, and 12 seconds. The default is 30 days, 10 hours, 29 minutes, and 6 seconds. - - userEmail (string): The user email for whom we want to calculate lookback - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "fetchTableQuery"], - "operation": "getOrganizationAssuranceFetchTableQuery", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/fetchTableQuery" - - query_params = [ - "t0", - "timespan", - "tableName", - "userEmail", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceFetchTableQuery: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceNetworkServicesServerHealthByServer(self, organizationId: str, **kwargs): - """ - **Returns network server health in organization by server.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-network-services-server-health-by-server - - - organizationId (string): Organization ID - - networkIds (array): Filter results for these networks. - - serverTypes (array): Filter results for these server types. - - serverIps (array): Filter results for these server IP addresses. - - ssidNumbers (array): Filter results for these SSID Numbers. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "networkServices", "serverHealth", "byServer"], - "operation": "getOrganizationAssuranceNetworkServicesServerHealthByServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/networkServices/serverHealth/byServer" - - query_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceNetworkServicesServerHealthByServer: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceNetworkServicesServerHealthByServerByInterval(self, organizationId: str, **kwargs): - """ - **Returns network server health in organization by server and by interval.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-network-services-server-health-by-server-by-interval - - - organizationId (string): Organization ID - - networkIds (array): Filter results for these networks. - - serverTypes (array): Filter results for these server types. - - serverIps (array): Filter results for these server IP addresses. - - ssidNumbers (array): Filter results for these SSID Numbers. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 14400, 86400. The default is 300. Interval is calculated if time params are provided. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "networkServices", "serverHealth", "byServer", "byInterval"], - "operation": "getOrganizationAssuranceNetworkServicesServerHealthByServerByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/networkServices/serverHealth/byServer/byInterval" - - query_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceNetworkServicesServerHealthByServerByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceNetworkServicesServerHealthByServerType(self, organizationId: str, **kwargs): - """ - **Returns network server health in organization by server type.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-network-services-server-health-by-server-type - - - organizationId (string): Organization ID - - networkIds (array): Filter results for these networks. - - serverTypes (array): Filter results for these server types. - - serverIps (array): Filter results for these server IP addresses. - - ssidNumbers (array): Filter results for these SSID Numbers. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "networkServices", "serverHealth", "byServerType"], - "operation": "getOrganizationAssuranceNetworkServicesServerHealthByServerType", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/networkServices/serverHealth/byServerType" - - query_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceNetworkServicesServerHealthByServerType: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceNetworkServicesServerHealthByServerTypeByInterval(self, organizationId: str, **kwargs): - """ - **Returns network server health in organization by server type and by interval.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-network-services-server-health-by-server-type-by-interval - - - organizationId (string): Organization ID - - networkIds (array): Filter results for these networks. - - serverTypes (array): Filter results for these server types. - - serverIps (array): Filter results for these server IP addresses. - - ssidNumbers (array): Filter results for these SSID Numbers. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 14400, 86400. The default is 300. Interval is calculated if time params are provided. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "networkServices", "serverHealth", "byServerType", "byInterval"], - "operation": "getOrganizationAssuranceNetworkServicesServerHealthByServerTypeByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/networkServices/serverHealth/byServerType/byInterval" - - query_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceNetworkServicesServerHealthByServerTypeByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def checkupOrganizationAssuranceOptimization(self, organizationId: str, **kwargs): - """ - **Returns an array of checkup results for the organization** - https://developer.cisco.com/meraki/api-v1/#!checkup-organization-assurance-optimization - - - organizationId (string): Organization ID - - forceRefresh (boolean): Optional parameter to reassess best practices - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "optimization"], - "operation": "checkupOrganizationAssuranceOptimization", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/optimization/checkup" - - query_params = [ - "forceRefresh", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"checkupOrganizationAssuranceOptimization: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceOptimizationCheckupByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns an array of checkup results for the networks** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-optimization-checkup-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 - 20. Default is 7. - - 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 checkups by Network Id - - forceRefresh (boolean): Optional parameter to reassess best practices - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "optimization", "checkup", "byNetwork"], - "operation": "getOrganizationAssuranceOptimizationCheckupByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/optimization/checkup/byNetwork" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "forceRefresh", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceOptimizationCheckupByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceProductAnnouncements(self, organizationId: str, **kwargs): - """ - **Gets relevant product announcements for a user** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-product-announcements - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 365 days, 5 hours, 49 minutes, and 12 seconds. The default is 91 days, 7 hours, 27 minutes, and 18 seconds. - - onlyRelevant (boolean): Limits product announcements that are considered relevant to this user when true - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "productAnnouncements"], - "operation": "getOrganizationAssuranceProductAnnouncements", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/productAnnouncements" - - query_params = [ - "t0", - "timespan", - "onlyRelevant", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceProductAnnouncements: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceScores(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get network health scores for a list of networks.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-scores - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 5000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 2 hours and be less than or equal to 14 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "scores"], - "operation": "getOrganizationAssuranceScores", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/scores" - - query_params = [ - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationAssuranceScores: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceThousandEyesApplications(self, organizationId: str, networkIds: list, **kwargs): - """ - **Get a list of Thousand Eyes applications with their alerts.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-thousand-eyes-applications - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - clientId (string): Filter results by client. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "thousandEyes", "applications"], - "operation": "getOrganizationAssuranceThousandEyesApplications", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/thousandEyes/applications" - - query_params = [ - "networkIds", - "clientId", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceThousandEyesApplications: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wired connection successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wired-experience-successful-connections-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "wired", "experience", "successfulConnections", "byNetwork"], - "operation": "getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wired/experience/successfulConnections/byNetwork" - - query_params = [ - "networkIds", - "serials", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClient(self, organizationId: str, **kwargs): - """ - **Summarizes wired connection successes and failures by client.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wired-experience-successful-connections-by-network-by-client - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "wired", "experience", "successfulConnections", "byNetwork", "byClient"], - "operation": "getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wired/experience/successfulConnections/byNetwork/byClient" - - query_params = [ - "networkIds", - "serials", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClientOs(self, organizationId: str, **kwargs): - """ - **Summarizes wired connection successes and failures by client OS.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wired-experience-successful-connections-by-network-by-client-os - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "wired", "experience", "successfulConnections", "byNetwork", "byClientOs"], - "operation": "getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClientOs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wired/experience/successfulConnections/byNetwork/byClientOs" - - query_params = [ - "networkIds", - "serials", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClientOs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClientType( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wired connection successes and failures by client type.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wired-experience-successful-connections-by-network-by-client-type - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": [ - "organizations", - "configure", - "wired", - "experience", - "successfulConnections", - "byNetwork", - "byClientType", - ], - "operation": "getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClientType", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wired/experience/successfulConnections/byNetwork/byClientType" - - query_params = [ - "networkIds", - "serials", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClientType: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wired connection successes and failures by device.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wired-experience-successful-connections-by-network-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "wired", "experience", "successfulConnections", "byNetwork", "byDevice"], - "operation": "getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wired/experience/successfulConnections/byNetwork/byDevice" - - query_params = [ - "networkIds", - "serials", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByInterval(self, organizationId: str, **kwargs): - """ - **Time-series of wired connection successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wired-experience-successful-connections-by-network-by-interval - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 60, 300, 600, 3600, 14400, 86400. The default is 300. Interval is calculated if time params are provided. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "wired", "experience", "successfulConnections", "byNetwork", "byInterval"], - "operation": "getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wired/experience/successfulConnections/byNetwork/byInterval" - - query_params = [ - "networkIds", - "serials", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByServer(self, organizationId: str, **kwargs): - """ - **Summarizes wired connection successes and failures by server.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wired-experience-successful-connections-by-network-by-server - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "wired", "experience", "successfulConnections", "byNetwork", "byServer"], - "operation": "getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wired/experience/successfulConnections/byNetwork/byServer" - - query_params = [ - "networkIds", - "serials", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByServer: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWorkflows(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return workflows filtered by organization ID, network ID, type, and category** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-workflows - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 30. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'ascending'. - - networkIds (array): Optional parameter to filter by network ID - - types (array): Optional parameter to filter workflows by types - - categories (array): Optional parameter to filter workflows by categories - - scopeTypes (array): Optional parameter to filter workflows by scope types - - networkTags (array): Optional parameter to filter workflows by network tags - - clientTags (array): Optional parameter to filter workflows by client tags - - nodeTags (array): Optional parameter to filter workflows by node tags - - state (string): Optional parameter to filter workflows by state - - tsStart (string): Start time to filter workflows - - tsEnd (string): End time to filter workflows - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["ascending", "descending"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "workflows"], - "operation": "getOrganizationAssuranceWorkflows", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/workflows" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "sortOrder", - "networkIds", - "types", - "categories", - "scopeTypes", - "networkTags", - "clientTags", - "nodeTags", - "state", - "tsStart", - "tsEnd", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "types", - "categories", - "scopeTypes", - "networkTags", - "clientTags", - "nodeTags", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationAssuranceWorkflows: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAuthRadiusServers(self, organizationId: str): - """ - **List the organization-wide RADIUS servers in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-auth-radius-servers - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "auth", "radius", "servers"], - "operation": "getOrganizationAuthRadiusServers", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/auth/radius/servers" - - return self._session.get(metadata, resource) - - def createOrganizationAuthRadiusServer(self, organizationId: str, address: str, secret: str, **kwargs): - """ - **Add an organization-wide RADIUS server** - https://developer.cisco.com/meraki/api-v1/#!create-organization-auth-radius-server - - - organizationId (string): Organization ID - - address (string): The IP address or FQDN of the RADIUS server - - secret (string): Shared secret of the RADIUS server - - name (string): The name of the RADIUS server - - modes (array): Available server modes - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "auth", "radius", "servers"], - "operation": "createOrganizationAuthRadiusServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/auth/radius/servers" - - body_params = [ - "name", - "address", - "modes", - "secret", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationAuthRadiusServer: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationAuthRadiusServersAssignments(self, organizationId: str): - """ - **Return list of network and policies that organization-wide RADIUS servers are bing used** - https://developer.cisco.com/meraki/api-v1/#!get-organization-auth-radius-servers-assignments - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "auth", "radius", "servers", "assignments"], - "operation": "getOrganizationAuthRadiusServersAssignments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/auth/radius/servers/assignments" - - return self._session.get(metadata, resource) - - def getOrganizationAuthRadiusServer(self, organizationId: str, serverId: str): - """ - **Return an organization-wide RADIUS server** - https://developer.cisco.com/meraki/api-v1/#!get-organization-auth-radius-server - - - organizationId (string): Organization ID - - serverId (string): Server ID - """ - - metadata = { - "tags": ["organizations", "configure", "auth", "radius", "servers"], - "operation": "getOrganizationAuthRadiusServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - serverId = urllib.parse.quote(str(serverId), safe="") - resource = f"/organizations/{organizationId}/auth/radius/servers/{serverId}" - - return self._session.get(metadata, resource) - - def updateOrganizationAuthRadiusServer(self, organizationId: str, serverId: str, **kwargs): - """ - **Update an organization-wide RADIUS server** - https://developer.cisco.com/meraki/api-v1/#!update-organization-auth-radius-server - - - organizationId (string): Organization ID - - serverId (string): Server ID - - name (string): The name of the RADIUS server - - address (string): The IP address or FQDN of the RADIUS server - - modes (array): Available server modes - - secret (string): Shared secret of the RADIUS server - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "auth", "radius", "servers"], - "operation": "updateOrganizationAuthRadiusServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - serverId = urllib.parse.quote(str(serverId), safe="") - resource = f"/organizations/{organizationId}/auth/radius/servers/{serverId}" - - body_params = [ - "name", - "address", - "modes", - "secret", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationAuthRadiusServer: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationAuthRadiusServer(self, organizationId: str, serverId: str): - """ - **Delete an organization-wide RADIUS server from a organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-auth-radius-server - - - organizationId (string): Organization ID - - serverId (string): Server ID - """ - - metadata = { - "tags": ["organizations", "configure", "auth", "radius", "servers"], - "operation": "deleteOrganizationAuthRadiusServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - serverId = urllib.parse.quote(str(serverId), safe="") - resource = f"/organizations/{organizationId}/auth/radius/servers/{serverId}" - - return self._session.delete(metadata, resource) - - def codeOrganizationAutomateIdentity(self, organizationId: str): - """ - **Generate a single use short lived code that can be used to retrieve the identity of the current user in the organization.** - https://developer.cisco.com/meraki/api-v1/#!code-organization-automate-identity - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "automate", "identity"], - "operation": "codeOrganizationAutomateIdentity", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/automate/identity/code" - - return self._session.post(metadata, resource) - - def getOrganizationBrandingPolicies(self, organizationId: str): - """ - **List the branding policies of an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-branding-policies - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "brandingPolicies"], - "operation": "getOrganizationBrandingPolicies", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/brandingPolicies" - - return self._session.get(metadata, resource) - - 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 - - - organizationId (string): Organization ID - - name (string): Name of the Dashboard branding policy. - - enabled (boolean): Boolean indicating whether this policy is enabled. - - adminSettings (object): Settings for describing which kinds of admins this policy applies to. - - helpSettings (object): Settings for describing the modifications to various Help page features. Each property in this object accepts one of - 'default or inherit' (do not modify functionality), 'hide' (remove the section from Dashboard), or 'show' (always show - the section on Dashboard). Some properties in this object also accept custom HTML used to replace the section on - Dashboard; see the documentation for each property to see the allowed values. - Each property defaults to 'default or inherit' when not provided. - - customLogo (object): Properties describing the custom logo attached to the branding policy. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "brandingPolicies"], - "operation": "createOrganizationBrandingPolicy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/brandingPolicies" - - body_params = [ - "name", - "enabled", - "adminSettings", - "helpSettings", - "customLogo", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationBrandingPolicy: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationBrandingPoliciesPriorities(self, organizationId: str): - """ - **Return the branding policy IDs of an organization in priority order** - https://developer.cisco.com/meraki/api-v1/#!get-organization-branding-policies-priorities - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "brandingPolicies", "priorities"], - "operation": "getOrganizationBrandingPoliciesPriorities", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/brandingPolicies/priorities" - - return self._session.get(metadata, resource) - - def updateOrganizationBrandingPoliciesPriorities(self, organizationId: str, **kwargs): - """ - **Update the priority ordering of an organization's branding policies.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-branding-policies-priorities - - - organizationId (string): Organization ID - - brandingPolicyIds (array): An ordered list of branding policy IDs that determines the priority order of how to apply the policies - - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "brandingPolicies", "priorities"], - "operation": "updateOrganizationBrandingPoliciesPriorities", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/brandingPolicies/priorities" - - body_params = [ - "brandingPolicyIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationBrandingPoliciesPriorities: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def getOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: str): - """ - **Return a branding policy** - https://developer.cisco.com/meraki/api-v1/#!get-organization-branding-policy - - - organizationId (string): Organization ID - - brandingPolicyId (string): Branding policy ID - """ - - metadata = { - "tags": ["organizations", "configure", "brandingPolicies"], - "operation": "getOrganizationBrandingPolicy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - brandingPolicyId = urllib.parse.quote(str(brandingPolicyId), safe="") - resource = f"/organizations/{organizationId}/brandingPolicies/{brandingPolicyId}" - - return self._session.get(metadata, resource) - - 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 - - - organizationId (string): Organization ID - - brandingPolicyId (string): Branding policy ID - - name (string): Name of the Dashboard branding policy. - - enabled (boolean): Boolean indicating whether this policy is enabled. - - adminSettings (object): Settings for describing which kinds of admins this policy applies to. - - helpSettings (object): Settings for describing the modifications to various Help page features. Each property in this object accepts one of - 'default or inherit' (do not modify functionality), 'hide' (remove the section from Dashboard), or 'show' (always show - the section on Dashboard). Some properties in this object also accept custom HTML used to replace the section on - Dashboard; see the documentation for each property to see the allowed values. - - - customLogo (object): Properties describing the custom logo attached to the branding policy. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "brandingPolicies"], - "operation": "updateOrganizationBrandingPolicy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - brandingPolicyId = urllib.parse.quote(str(brandingPolicyId), safe="") - resource = f"/organizations/{organizationId}/brandingPolicies/{brandingPolicyId}" - - body_params = [ - "name", - "enabled", - "adminSettings", - "helpSettings", - "customLogo", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationBrandingPolicy: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: str): - """ - **Delete a branding policy** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-branding-policy - - - organizationId (string): Organization ID - - brandingPolicyId (string): Branding policy ID - """ - - metadata = { - "tags": ["organizations", "configure", "brandingPolicies"], - "operation": "deleteOrganizationBrandingPolicy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - brandingPolicyId = urllib.parse.quote(str(brandingPolicyId), safe="") - resource = f"/organizations/{organizationId}/brandingPolicies/{brandingPolicyId}" - - return self._session.delete(metadata, resource) - - def getOrganizationCertificates(self, organizationId: str, **kwargs): - """ - **Gets all or specific certificates for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates - - - organizationId (string): Organization ID - - certificateIds (array): List of ids for specific certificate retrieval - - certManagedBy (array): List of cert managed by types - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "certificates"], - "operation": "getOrganizationCertificates", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates" - - query_params = [ - "certificateIds", - "certManagedBy", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "certificateIds", - "certManagedBy", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationCertificates: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def getOrganizationCertificatesAuthorities(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List certificate authorities for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates-authorities - - - 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 - - authorityIds (array): Feature certificate authority IDs to filter by (exact match on each id; duplicates are ignored) - - sortBy (string): Field to sort by (default: authorityId) - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["authorityId", "featureType", "status"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "certificates", "authorities"], - "operation": "getOrganizationCertificatesAuthorities", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities" - - query_params = [ - "authorityIds", - "sortBy", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "authorityIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationCertificatesAuthority(self, organizationId: str, featureType: str, **kwargs): - """ - **Create a certificate authority for an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-certificates-authority - - - organizationId (string): Organization ID - - featureType (string): Feature this CA serves (e.g., radsec, openroaming, zigbee) - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "certificates", "authorities"], - "operation": "createOrganizationCertificatesAuthority", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities" - - body_params = [ - "featureType", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationCertificatesAuthority: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, **kwargs): - """ - **Trust a newly created certificate authority (transition from untrusted to trusted).** - https://developer.cisco.com/meraki/api-v1/#!update-organization-certificates-authorities - - - organizationId (string): Organization ID - - authorityId (string): ID of the certificate authority to trust. The CA must currently be untrusted. - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "certificates", "authorities"], - "operation": "updateOrganizationCertificatesAuthorities", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities" - - body_params = [ - "authorityId", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, name: str): - """ - **Delete a certificate authority** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-certificates-authorities - - - organizationId (string): Organization ID - - authorityId (string): ID of the certificate authority to delete - - name (string): Certificate authority name - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "certificates", "authorities"], - "operation": "deleteOrganizationCertificatesAuthorities", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities" - - return self._session.delete(metadata, resource) - - def getOrganizationCertificatesAuthoritiesJob(self, organizationId: str, jobId: str): - """ - **Return the status and result of a certificate authority job.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates-authorities-job - - - organizationId (string): Organization ID - - jobId (string): Job ID - """ - - metadata = { - "tags": ["organizations", "configure", "certificates", "authorities", "jobs"], - "operation": "getOrganizationCertificatesAuthoritiesJob", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - jobId = urllib.parse.quote(str(jobId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities/jobs/{jobId}" - - return self._session.get(metadata, resource) - - def revokeOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, **kwargs): - """ - **Revoke a trusted feature certificate authority.** - https://developer.cisco.com/meraki/api-v1/#!revoke-organization-certificates-authorities - - - organizationId (string): Organization ID - - authorityId (string): ID of the feature certificate authority to revoke - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "certificates", "authorities"], - "operation": "revokeOrganizationCertificatesAuthorities", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities/revoke" - - body_params = [ - "authorityId", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"revokeOrganizationCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def importOrganizationCertificates(self, organizationId: str, managedBy: str, contents: str, description: str, **kwargs): - """ - **Import certificate for this organization** - https://developer.cisco.com/meraki/api-v1/#!import-organization-certificates - - - organizationId (string): Organization ID - - managedBy (string): Certificate managed by type [system_manager, mr, encrypted_syslog, grpc_dial_out] - - contents (string): Certificate content in valid PEM format - - description (string): Certificate description - """ - - kwargs = locals() - - if "managedBy" in kwargs: - options = ["encrypted_syslog", "grpc_dial_out", "mr", "system_manager"] - assert kwargs["managedBy"] in options, ( - f'''"managedBy" cannot be "{kwargs["managedBy"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "certificates"], - "operation": "importOrganizationCertificates", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/import" - - body_params = [ - "managedBy", - "contents", - "description", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"importOrganizationCertificates: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationCertificatesMerakiAuthContents(self, organizationId: str): - """ - **Download the public RADIUS certificate.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates-meraki-auth-contents - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "monitor", "certificates", "merakiAuth", "contents"], - "operation": "getOrganizationCertificatesMerakiAuthContents", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/merakiAuth/contents" - - return self._session.get(metadata, resource) - - def getOrganizationCertificatesRevocationLists(self, organizationId: str, **kwargs): - """ - **Return full certificate revocation lists (CRLs) for the organization's certificate authorities** - https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates-revocation-lists - - - organizationId (string): Organization ID - - certificateAuthorityIds (array): Optional filter: feature certificate authority IDs (base-10 integers). Every value must exist for this organization; otherwise the request fails. Omit to return CRLs for all feature CAs in the organization. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "certificates", "revocationLists"], - "operation": "getOrganizationCertificatesRevocationLists", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/revocationLists" - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCertificatesRevocationLists: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def deleteOrganizationCertificate(self, organizationId: str, certificateId: str): - """ - **Delete a certificate for an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-certificate - - - organizationId (string): Organization ID - - certificateId (string): Certificate ID - """ - - metadata = { - "tags": ["organizations", "configure", "certificates"], - "operation": "deleteOrganizationCertificate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - certificateId = urllib.parse.quote(str(certificateId), safe="") - resource = f"/organizations/{organizationId}/certificates/{certificateId}" - - return self._session.delete(metadata, resource) - - def updateOrganizationCertificate(self, organizationId: str, certificateId: str, **kwargs): - """ - **Update a certificate's description for an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-certificate - - - organizationId (string): Organization ID - - certificateId (string): Certificate ID - - description (string): Description of a certificate that already exist in your org - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "certificates"], - "operation": "updateOrganizationCertificate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - certificateId = urllib.parse.quote(str(certificateId), safe="") - resource = f"/organizations/{organizationId}/certificates/{certificateId}" - - body_params = [ - "description", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationCertificate: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getOrganizationCertificateContents(self, organizationId: str, certificateId: str, **kwargs): - """ - **Download the trusted certificate by certificate id.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-certificate-contents - - - organizationId (string): Organization ID - - certificateId (string): Certificate ID - - chainId (string): chainId that represent which certificate chain is being requested - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "certificates", "contents"], - "operation": "getOrganizationCertificateContents", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - certificateId = urllib.parse.quote(str(certificateId), safe="") - resource = f"/organizations/{organizationId}/certificates/{certificateId}/contents" - - query_params = [ - "chainId", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationCertificateContents: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def claimIntoOrganization(self, organizationId: str, **kwargs): - """ - **Claim a list of devices, licenses, and/or orders into an organization inventory** - https://developer.cisco.com/meraki/api-v1/#!claim-into-organization - - - organizationId (string): Organization ID - - orders (array): The numbers of the orders that should be claimed - - serials (array): The serials of the devices that should be claimed - - licenses (array): The licenses that should be claimed - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure"], - "operation": "claimIntoOrganization", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/claim" - - body_params = [ - "orders", - "serials", - "licenses", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"claimIntoOrganization: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationClientsBandwidthUsageHistory(self, organizationId: str, **kwargs): - """ - **Return data usage (in megabits per second) over time for all clients in the given organization within a given time range.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-bandwidth-usage-history - - - organizationId (string): Organization ID - - networkTag (string): Match result to an exact network tag - - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - - ssidName (string): Filter results by ssid name - - usageUplink (string): Filter results by usage uplink - - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 186 days. The default is 1 day. - """ - - kwargs.update(locals()) - metadata = { - "tags": ["organizations", "monitor", "clients", "bandwidthUsageHistory"], - "operation": "getOrganizationClientsBandwidthUsageHistory", + "tags": ["organizations", "configure", "brandingPolicies"], + "operation": "getOrganizationBrandingPolicy", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/clients/bandwidthUsageHistory" - - query_params = [ - "networkTag", - "deviceTag", - "networkId", - "ssidName", - "usageUplink", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationClientsBandwidthUsageHistory: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) + brandingPolicyId = urllib.parse.quote(str(brandingPolicyId), safe="") + resource = f"/organizations/{organizationId}/brandingPolicies/{brandingPolicyId}" - def getOrganizationClientsOverview(self, organizationId: str, **kwargs): - """ - **Return summary information around client data usage (in kb) across the given organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-overview + return self._session.get(metadata, resource) - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. + 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 - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "clients", "overview"], - "operation": "getOrganizationClientsOverview", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/clients/overview" - - query_params = [ - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationClientsOverview: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def getOrganizationClientsSearch(self, organizationId: str, mac: str, total_pages=1, direction="next", **kwargs): - """ - **Return the client details in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-search + - organizationId (string): Organization ID + - brandingPolicyId (string): Branding policy ID + - name (string): Name of the Dashboard branding policy. + - enabled (boolean): Boolean indicating whether this policy is enabled. + - adminSettings (object): Settings for describing which kinds of admins this policy applies to. + - helpSettings (object): Settings for describing the modifications to various Help page features. Each property in this object accepts one of + 'default or inherit' (do not modify functionality), 'hide' (remove the section from Dashboard), or 'show' (always show + the section on Dashboard). Some properties in this object also accept custom HTML used to replace the section on + Dashboard; see the documentation for each property to see the allowed values. - - organizationId (string): Organization ID - - mac (string): The MAC address of the client. Required. - - 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 - 5. Default is 5. - - 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. + - customLogo (object): Properties describing the custom logo attached to the branding policy. """ kwargs.update(locals()) metadata = { - "tags": ["organizations", "configure", "clients", "search"], - "operation": "getOrganizationClientsSearch", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/clients/search" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "mac", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationClientsSearch: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def cloneOrganization(self, organizationId: str, name: str, **kwargs): - """ - **Create a new organization by cloning the addressed organization** - https://developer.cisco.com/meraki/api-v1/#!clone-organization - - - organizationId (string): Organization ID - - name (string): The name of the new organization - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure"], - "operation": "cloneOrganization", + "tags": ["organizations", "configure", "brandingPolicies"], + "operation": "updateOrganizationBrandingPolicy", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/clone" + brandingPolicyId = urllib.parse.quote(str(brandingPolicyId), safe="") + resource = f"/organizations/{organizationId}/brandingPolicies/{brandingPolicyId}" body_params = [ "name", + "enabled", + "adminSettings", + "helpSettings", + "customLogo", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -4598,109 +2079,53 @@ def cloneOrganization(self, organizationId: str, name: str, **kwargs): all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning(f"cloneOrganization: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationCloudConnectivityRequirements(self, organizationId: str): - """ - **List of source/destination traffic rules** - https://developer.cisco.com/meraki/api-v1/#!get-organization-cloud-connectivity-requirements - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "monitor", "cloud", "connectivity", "requirements"], - "operation": "getOrganizationCloudConnectivityRequirements", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/cloud/connectivity/requirements" - - return self._session.get(metadata, resource) + self._session._logger.warning(f"updateOrganizationBrandingPolicy: ignoring unrecognized kwargs: {invalid}") - def getOrganizationComputeApplicationDeployments(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the Application Deployment agent configurations for all hosts under this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-compute-application-deployments + return self._session.put(metadata, resource, payload) - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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. - - developerNames (array): Filters deployments by application developer name - - applicationNames (array): Filters deployments by application name - - enabled (boolean): Filters deployments by their enabled status + def deleteOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: str): """ + **Delete a branding policy** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-branding-policy - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "compute", "application", "deployments"], - "operation": "getOrganizationComputeApplicationDeployments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/compute/application/deployments" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "developerNames", - "applicationNames", - "enabled", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "developerNames", - "applicationNames", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationComputeApplicationDeployments: ignoring unrecognized kwargs: {invalid}" - ) + - organizationId (string): Organization ID + - brandingPolicyId (string): Branding policy ID + """ - return self._session.get_pages(metadata, resource, params, total_pages, direction) + metadata = { + "tags": ["organizations", "configure", "brandingPolicies"], + "operation": "deleteOrganizationBrandingPolicy", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + brandingPolicyId = urllib.parse.quote(str(brandingPolicyId), safe="") + resource = f"/organizations/{organizationId}/brandingPolicies/{brandingPolicyId}" - def createOrganizationComputeApplicationDeploymentsBulkCreate( - self, organizationId: str, hosts: list, application: dict, enabled: bool, **kwargs - ): + return self._session.delete(metadata, resource) + + def claimIntoOrganization(self, organizationId: str, **kwargs): """ - **Add Application Deployment agents for a list of hosts** - https://developer.cisco.com/meraki/api-v1/#!create-organization-compute-application-deployments-bulk-create + **Claim a list of devices, licenses, and/or orders into an organization inventory** + https://developer.cisco.com/meraki/api-v1/#!claim-into-organization - organizationId (string): Organization ID - - hosts (array): List of hosts to deploy applications on - - application (object): Application information - - enabled (boolean): Whether the deployment should be enabled - - applicationConfiguration (object): Optional: Generic object for application-specific configuration + - orders (array): The numbers of the orders that should be claimed + - serials (array): The serials of the devices that should be claimed + - licenses (array): The licenses that should be claimed """ kwargs.update(locals()) metadata = { - "tags": ["organizations", "configure", "compute", "application", "deployments", "bulkCreate"], - "operation": "createOrganizationComputeApplicationDeploymentsBulkCreate", + "tags": ["organizations", "configure"], + "operation": "claimIntoOrganization", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/compute/application/deployments/bulkCreate" + resource = f"/organizations/{organizationId}/claim" body_params = [ - "hosts", - "application", - "enabled", - "applicationConfiguration", + "orders", + "serials", + "licenses", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -4708,118 +2133,159 @@ def createOrganizationComputeApplicationDeploymentsBulkCreate( all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationComputeApplicationDeploymentsBulkCreate: ignoring unrecognized kwargs: {invalid}" - ) + self._session._logger.warning(f"claimIntoOrganization: ignoring unrecognized kwargs: {invalid}") return self._session.post(metadata, resource, payload) - def updateOrganizationComputeApplicationDeployment(self, organizationId: str, deploymentId: str, enabled: bool, **kwargs): + def getOrganizationClientsBandwidthUsageHistory(self, organizationId: str, **kwargs): """ - **Update a Deployment agent configuration** - https://developer.cisco.com/meraki/api-v1/#!update-organization-compute-application-deployment + **Return data usage (in megabits per second) over time for all clients in the given organization within a given time range.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-bandwidth-usage-history - organizationId (string): Organization ID - - deploymentId (string): Deployment ID - - enabled (boolean): Whether or not the Application Deployment agent is enabled for the host. + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink + - t0 (string): The beginning of the timespan for the data. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 186 days. The default is 1 day. """ - kwargs = locals() + kwargs.update(locals()) metadata = { - "tags": ["organizations", "configure", "compute", "application", "deployments"], - "operation": "updateOrganizationComputeApplicationDeployment", + "tags": ["organizations", "monitor", "clients", "bandwidthUsageHistory"], + "operation": "getOrganizationClientsBandwidthUsageHistory", } organizationId = urllib.parse.quote(str(organizationId), safe="") - deploymentId = urllib.parse.quote(str(deploymentId), safe="") - resource = f"/organizations/{organizationId}/compute/application/deployments/{deploymentId}" + resource = f"/organizations/{organizationId}/clients/bandwidthUsageHistory" - body_params = [ - "enabled", + query_params = [ + "networkTag", + "deviceTag", + "ssidName", + "usageUplink", + "t0", + "t1", + "timespan", ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} if self._session._validate_kwargs: - all_params = [] + body_params + all_params = query_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"updateOrganizationComputeApplicationDeployment: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationClientsBandwidthUsageHistory: ignoring unrecognized kwargs: {invalid}" ) - return self._session.put(metadata, resource, payload) + return self._session.get(metadata, resource, params) - def deleteOrganizationComputeApplicationDeployment(self, organizationId: str, deploymentId: str): + def getOrganizationClientsOverview(self, organizationId: str, **kwargs): """ - **Delete a Application Deployment agent from the host** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-compute-application-deployment + **Return summary information around client data usage (in kb) across the given organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-overview - organizationId (string): Organization ID - - deploymentId (string): Deployment ID + - t0 (string): The beginning of the timespan for the data. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. """ + kwargs.update(locals()) + metadata = { - "tags": ["organizations", "configure", "compute", "application", "deployments"], - "operation": "deleteOrganizationComputeApplicationDeployment", + "tags": ["organizations", "monitor", "clients", "overview"], + "operation": "getOrganizationClientsOverview", } organizationId = urllib.parse.quote(str(organizationId), safe="") - deploymentId = urllib.parse.quote(str(deploymentId), safe="") - resource = f"/organizations/{organizationId}/compute/application/deployments/{deploymentId}" + resource = f"/organizations/{organizationId}/clients/overview" - return self._session.delete(metadata, resource) + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - def getOrganizationComputeHosts( - self, organizationId: str, developerName: str, applicationName: str, total_pages=1, direction="next", **kwargs - ): + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"getOrganizationClientsOverview: ignoring unrecognized kwargs: {invalid}") + + return self._session.get(metadata, resource, params) + + def getOrganizationClientsSearch(self, organizationId: str, mac: str, total_pages=1, direction="next", **kwargs): """ - **Retrieves a list of compute hosts eligible for application deployment within a given organization, filtered by the specified application developer and application name, with optional network ID filtering.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-compute-hosts + **Return the client details in an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-search - organizationId (string): Organization ID - - developerName (string): Filters hosts by application developer name - - applicationName (string): Filters hosts by application name + - mac (string): The MAC address of the client. Required. - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 5. Default is 5. - 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): Filters hosts by the network ID they belong to """ kwargs.update(locals()) metadata = { - "tags": ["organizations", "configure", "compute", "hosts"], - "operation": "getOrganizationComputeHosts", + "tags": ["organizations", "configure", "clients", "search"], + "operation": "getOrganizationClientsSearch", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/compute/hosts" + resource = f"/organizations/{organizationId}/clients/search" query_params = [ "perPage", "startingAfter", "endingBefore", - "developerName", - "applicationName", - "networkIds", + "mac", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - array_params = [ - "networkIds", + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"getOrganizationClientsSearch: ignoring unrecognized kwargs: {invalid}") + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def cloneOrganization(self, organizationId: str, name: str, **kwargs): + """ + **Create a new organization by cloning the addressed organization** + https://developer.cisco.com/meraki/api-v1/#!clone-organization + + - organizationId (string): Organization ID + - name (string): The name of the new organization + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure"], + "operation": "cloneOrganization", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/clone" + + body_params = [ + "name", ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationComputeHosts: ignoring unrecognized kwargs: {invalid}") + self._session._logger.warning(f"cloneOrganization: ignoring unrecognized kwargs: {invalid}") - return self._session.get_pages(metadata, resource, params, total_pages, direction) + return self._session.post(metadata, resource, payload) def getOrganizationConfigTemplates(self, organizationId: str): """ @@ -5166,26 +2632,10 @@ def getOrganizationDevicesAvailabilitiesChangeHistory( - productTypes (array): Optional parameter to filter device availabilities history by device product types - networkIds (array): Optional parameter to filter device availabilities history by network IDs - statuses (array): Optional parameter to filter device availabilities history by device statuses - - categories (array): Optional parameter to filter device availabilities history by categories of status, reboot, or upgrade - - networkTags (array): Optional parameter to filter device availabilities history by network tags. The filtering is case-sensitive. If tags are included, 'networkTagsFilterType' should also be included (see below). - - networkTagsFilterType (string): An 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. - - deviceTags (array): Optional parameter to filter device availabilities history by device tags. The filtering is case-sensitive. If tags are included, 'deviceTagsFilterType' should also be included (see below). - - deviceTagsFilterType (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. """ kwargs.update(locals()) - if "networkTagsFilterType" in kwargs: - options = ["withAllTags", "withAnyTags"] - assert kwargs["networkTagsFilterType"] in options, ( - f'''"networkTagsFilterType" cannot be "{kwargs["networkTagsFilterType"]}", & must be set to one of: {options}''' - ) - if "deviceTagsFilterType" in kwargs: - options = ["withAllTags", "withAnyTags"] - assert kwargs["deviceTagsFilterType"] in options, ( - f'''"deviceTagsFilterType" cannot be "{kwargs["deviceTagsFilterType"]}", & must be set to one of: {options}''' - ) - metadata = { "tags": ["organizations", "monitor", "devices", "availabilities", "changeHistory"], "operation": "getOrganizationDevicesAvailabilitiesChangeHistory", @@ -5202,140 +2652,16 @@ def getOrganizationDevicesAvailabilitiesChangeHistory( "timespan", "serials", "productTypes", - "networkIds", - "statuses", - "categories", - "networkTags", - "networkTagsFilterType", - "deviceTags", - "deviceTagsFilterType", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "serials", - "productTypes", - "networkIds", - "statuses", - "categories", - "networkTags", - "deviceTags", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesAvailabilitiesChangeHistory: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationDevicesBootsHistory(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Returns the history of device boots in reverse chronological order (most recent first)** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-boots-history - - - 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 - - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 730 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 730 days. - - serials (array): Optional parameter to filter device by device serial numbers. This filter uses multiple exact matches. - - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, campusGateway, and secureConnect. - - mostRecentPerDevice (boolean): If true, only the most recent boot for each device is returned. - - 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. - - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'descending'. - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["ascending", "descending"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "devices", "boots", "history"], - "operation": "getOrganizationDevicesBootsHistory", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/boots/history" - - query_params = [ - "t0", - "t1", - "timespan", - "serials", - "productTypes", - "mostRecentPerDevice", - "perPage", - "startingAfter", - "endingBefore", - "sortOrder", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "serials", - "productTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationDevicesBootsHistory: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationDevicesBootsOverviewByDevice(self, organizationId: str, **kwargs): - """ - **Summarizes device reboots across an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-boots-overview-by-device - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - 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. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "devices", "boots", "overview", "byDevice"], - "operation": "getOrganizationDevicesBootsOverviewByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/boots/overview/byDevice" - - query_params = [ - "networkIds", - "productTypes", - "t0", - "t1", - "timespan", + "networkIds", + "statuses", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "networkIds", + "serials", "productTypes", + "networkIds", + "statuses", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -5347,10 +2673,10 @@ def getOrganizationDevicesBootsOverviewByDevice(self, organizationId: str, **kwa invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationDevicesBootsOverviewByDevice: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationDevicesAvailabilitiesChangeHistory: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) def getOrganizationDevicesCellularDataDevices(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ @@ -5950,64 +3276,6 @@ def getOrganizationDevicesCellularUplinksTowersByDevice( return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationDevicesCertificates(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List device certificates for the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-certificates - - - 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): Device serial numbers to filter by (exact match; duplicates are ignored) - - featureTypes (array): Feature types these device certificates serve (exact match; e.g., radsec, openroaming, zigbee) - - sortBy (string): Field to sort by (default: authorityId) - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["authorityId", "featureType", "status"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "devices", "certificates"], - "operation": "getOrganizationDevicesCertificates", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/certificates" - - query_params = [ - "serials", - "featureTypes", - "sortBy", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "serials", - "featureTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationDevicesCertificates: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def createOrganizationDevicesControllerMigration(self, organizationId: str, serials: list, target: str, **kwargs): """ **Migrate devices to another controller or management mode** @@ -6142,56 +3410,6 @@ def bulkUpdateOrganizationDevicesDetails(self, organizationId: str, serials: lis return self._session.post(metadata, resource, payload) - def getOrganizationDevicesMemoryByDevice(self, organizationId: str, networkIds: list, productTypes: list, **kwargs): - """ - **Summarizes memory status across devices of a given network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-memory-by-device - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - productTypes (array): Parameter to filter device availabilities by device product types. This filter uses multiple exact matches. - - usageThreshold (number): Threshold of device memory utilization expressed as a percent. Filters out all devices below this value. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 1 hour and be less than or equal to 7 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "devices", "memory", "byDevice"], - "operation": "getOrganizationDevicesMemoryByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/memory/byDevice" - - query_params = [ - "networkIds", - "productTypes", - "usageThreshold", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "productTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationDevicesMemoryByDevice: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - def getOrganizationDevicesOverviewByModel(self, organizationId: str, **kwargs): """ **Lists the count for each device model** @@ -6526,65 +3744,6 @@ def stopOrganizationDevicesPacketCaptureCapture(self, organizationId: str, captu return self._session.post(metadata, resource, payload) - def getOrganizationDevicesPacketCaptureOpportunisticByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the Opportunistic Pcap settings of an organization by network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-packet-capture-opportunistic-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter results by network. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'descending'. - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["ascending", "descending"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "devices", "packetCapture", "opportunistic", "byNetwork"], - "operation": "getOrganizationDevicesPacketCaptureOpportunisticByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/packetCapture/opportunistic/byNetwork" - - query_params = [ - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - "sortOrder", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesPacketCaptureOpportunisticByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationDevicesPacketCaptureSchedules(self, organizationId: str, **kwargs): """ **List the Packet Capture Schedules** @@ -6677,39 +3836,6 @@ def createOrganizationDevicesPacketCaptureSchedule(self, organizationId: str, de return self._session.post(metadata, resource, payload) - def bulkOrganizationDevicesPacketCaptureSchedulesDelete(self, organizationId: str, scheduleIds: list, **kwargs): - """ - **Delete packet capture schedules** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-devices-packet-capture-schedules-delete - - - organizationId (string): Organization ID - - scheduleIds (array): Delete the packet capture schedules of the specified schedule ids - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "devices", "packetCapture", "schedules"], - "operation": "bulkOrganizationDevicesPacketCaptureSchedulesDelete", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/packetCapture/schedules/bulkDelete" - - body_params = [ - "scheduleIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"bulkOrganizationDevicesPacketCaptureSchedulesDelete: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - def reorderOrganizationDevicesPacketCaptureSchedules(self, organizationId: str, order: list, **kwargs): """ **Bulk update priorities of pcap schedules** @@ -6796,133 +3922,20 @@ def deleteOrganizationDevicesPacketCaptureSchedule(self, organizationId: str, sc https://developer.cisco.com/meraki/api-v1/#!delete-organization-devices-packet-capture-schedule - organizationId (string): Organization ID - - scheduleId (string): Delete the capture schedules of the specified capture schedule id - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "devices", "packetCapture", "schedules"], - "operation": "deleteOrganizationDevicesPacketCaptureSchedule", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - scheduleId = urllib.parse.quote(str(scheduleId), safe="") - resource = f"/organizations/{organizationId}/devices/packetCapture/schedules/{scheduleId}" - - return self._session.delete(metadata, resource) - - def tasksOrganizationDevicesPacketCapture(self, organizationId: str, packetId: str, task: str, **kwargs): - """ - **Enqueues a task for a specific packet capture** - https://developer.cisco.com/meraki/api-v1/#!tasks-organization-devices-packet-capture - - - organizationId (string): Organization ID - - packetId (string): Packet ID - - task (string): Type of task to enqueue. It can be one of: ["analysis", "reasoning", "summary", "highlights", "title", "flow"] - - networkId (string): Parameter to validate authorization by network access - """ - - kwargs.update(locals()) - - if "task" in kwargs: - options = ["analysis", "flow", "highlights", "reasoning", "summary", "title"] - assert kwargs["task"] in options, f'''"task" cannot be "{kwargs["task"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["organizations", "configure", "devices", "packetCaptures"], - "operation": "tasksOrganizationDevicesPacketCapture", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - packetId = urllib.parse.quote(str(packetId), safe="") - resource = f"/organizations/{organizationId}/devices/packetCaptures/{packetId}/tasks" - - body_params = [ - "networkId", - "task", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"tasksOrganizationDevicesPacketCapture: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationDevicesPacketCaptureTask(self, organizationId: str, packetId: str, id: str, **kwargs): - """ - **Retrieves packet capture analysis result for a specific packet capture task.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-packet-capture-task - - - organizationId (string): Organization ID - - packetId (string): Packet ID - - id (string): ID - - networkId (string): Optional parameter to validate authorization by network access - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "devices", "packetCaptures", "tasks"], - "operation": "getOrganizationDevicesPacketCaptureTask", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - packetId = urllib.parse.quote(str(packetId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/devices/packetCaptures/{packetId}/tasks/{id}" - - query_params = [ - "networkId", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesPacketCaptureTask: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def bulkOrganizationDevicesPlacementPositionsUpdate(self, organizationId: str, serials: list, **kwargs): - """ - **Bulk update the attributes related to positions for provided devices** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-devices-placement-positions-update - - - organizationId (string): Organization ID - - serials (array): List of device serials on a floor plan to update - - height (object): Height of the devices on the floor plan - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "devices", "placement", "positions"], - "operation": "bulkOrganizationDevicesPlacementPositionsUpdate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/placement/positions/bulkUpdate" - - body_params = [ - "serials", - "height", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"bulkOrganizationDevicesPlacementPositionsUpdate: ignoring unrecognized kwargs: {invalid}" - ) + - scheduleId (string): Delete the capture schedules of the specified capture schedule id + """ - return self._session.post(metadata, resource, payload) + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "devices", "packetCapture", "schedules"], + "operation": "deleteOrganizationDevicesPacketCaptureSchedule", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + scheduleId = urllib.parse.quote(str(scheduleId), safe="") + resource = f"/organizations/{organizationId}/devices/packetCapture/schedules/{scheduleId}" + + return self._session.delete(metadata, resource) def getOrganizationDevicesPowerModulesStatusesByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs @@ -7065,216 +4078,6 @@ def getOrganizationDevicesProvisioningStatuses(self, organizationId: str, total_ return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationDevicesSoftwareUpdatesOverviewsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns details about software updates for networks within an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-software-updates-overviews-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 30. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'ascending'. - - sortKey (string): Specify key to order the list of networks. - - configSource (string): Limit the list of networks to those that contain devices with the specified config source - - networkIds (array): Limit the list of networks to those that match the provided network IDs - - networkGroupIds (array): Limit the list of networks to those that belong to one of the provided network group IDs. - - productTypes (array): Limit the list of product types included for each network - - networkName (string): Limit the list of networks to those whose name contains the given search string. - - versionIds (array): Limit the list of networks to those that are currently on one of the provided version IDs. - - firmwareStatus (string): Limit the list of networks to those whose current firmware version has the specified end-of-support status. - - firmwareType (string): Limit the list of networks to those whose current firmware version has the specified release type. - - upgradeDependencyIds (array): Limit the list of networks to those that belong to one of the provided upgrade dependencies. - - upgradeAvailable (boolean): Limit the list of networks by upgrade availability. - - templateRole (string): Limit the list of networks by config template role: non-template only, templates only, or templates and bound networks. - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["ascending", "descending"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - if "sortKey" in kwargs: - options = [ - "availability", - "currentVersion", - "firmwareStatus", - "firmwareType", - "lastUpgrade", - "networkGroup", - "networkName", - "networkType", - "scheduledTime", - "scheduledUpgradeVersion", - "upgradeDependency", - ] - assert kwargs["sortKey"] in options, ( - f'''"sortKey" cannot be "{kwargs["sortKey"]}", & must be set to one of: {options}''' - ) - if "configSource" in kwargs: - options = ["cloud", "local"] - assert kwargs["configSource"] in options, ( - f'''"configSource" cannot be "{kwargs["configSource"]}", & must be set to one of: {options}''' - ) - if "firmwareStatus" in kwargs: - options = ["critical", "good", "warning"] - assert kwargs["firmwareStatus"] in options, ( - f'''"firmwareStatus" cannot be "{kwargs["firmwareStatus"]}", & must be set to one of: {options}''' - ) - if "firmwareType" in kwargs: - options = ["beta", "candidate", "stable"] - assert kwargs["firmwareType"] in options, ( - f'''"firmwareType" cannot be "{kwargs["firmwareType"]}", & must be set to one of: {options}''' - ) - if "templateRole" in kwargs: - options = ["bound-templates", "non-template", "templates"] - assert kwargs["templateRole"] in options, ( - f'''"templateRole" cannot be "{kwargs["templateRole"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "devices", "software", "updates", "overviews", "byNetwork"], - "operation": "getOrganizationDevicesSoftwareUpdatesOverviewsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/software/updates/overviews/byNetwork" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "sortOrder", - "sortKey", - "configSource", - "networkIds", - "networkGroupIds", - "productTypes", - "networkName", - "versionIds", - "firmwareStatus", - "firmwareType", - "upgradeDependencyIds", - "upgradeAvailable", - "templateRole", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "networkGroupIds", - "productTypes", - "versionIds", - "upgradeDependencyIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesSoftwareUpdatesOverviewsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationDevicesSoftwareVersions(self, organizationId: str, releaseType: str, **kwargs): - """ - **List the available software upgrade versions for an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-software-versions - - - organizationId (string): Organization ID - - releaseType (string): Filter by release type - """ - - kwargs = locals() - - if "releaseType" in kwargs: - options = ["beta", "generallyAvailable", "recommended"] - assert kwargs["releaseType"] in options, ( - f'''"releaseType" cannot be "{kwargs["releaseType"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "devices", "software", "versions"], - "operation": "getOrganizationDevicesSoftwareVersions", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/software/versions" - - query_params = [ - "releaseType", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesSoftwareVersions: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationDevicesSoftwareVersionsChangelogs(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Provide changelogs for specified versions or, if unspecified, for all versions in the organization, including reference to the last and next versions.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-software-versions-changelogs - - - 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 - - versionIds (array): Array of version IDs for filtering - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 30. - - 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": ["organizations", "configure", "devices", "software", "versions", "changelogs"], - "operation": "getOrganizationDevicesSoftwareVersionsChangelogs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/software/versions/changelogs" - - query_params = [ - "versionIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "versionIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesSoftwareVersionsChangelogs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationDevicesStatuses(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **List the status of every Meraki device in the organization** @@ -7293,7 +4096,6 @@ def getOrganizationDevicesStatuses(self, organizationId: str, total_pages=1, dir - 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. - - configurationUpdatedAfter (string): Optional parameter to filter results by whether or not the device's configuration has been updated after the given timestamp """ kwargs.update(locals()) @@ -7322,7 +4124,6 @@ def getOrganizationDevicesStatuses(self, organizationId: str, total_pages=1, dir "models", "tags", "tagsFilterType", - "configurationUpdatedAfter", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} @@ -7536,152 +4337,22 @@ def getOrganizationDevicesSystemMemoryUsageHistoryByInterval( ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - array_params = [ - "networkIds", - "serials", - "productTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesSystemMemoryUsageHistoryByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationDevicesTopologyInterfaces(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List topology interfaces in an organization, including layer 2 and layer 3 metadata when available.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-topology-interfaces - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter interfaces by network ID. This filter uses multiple exact matches. Query array syntax follows the standard bracket form, for example: networkIds[]=L_1234&networkIds[]=L_5678. - - serials (array): Optional parameter to filter interfaces by device serial. This filter uses multiple exact matches. Query array syntax follows the standard bracket form, for example: serials[]=Q234-ABCD-5678&serials[]=Q234-ABCD-9012. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "devices", "topology", "interfaces"], - "operation": "getOrganizationDevicesTopologyInterfaces", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/topology/interfaces" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesTopologyInterfaces: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationDevicesTopologyL2Links(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List layer 2 topology links originating from devices in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-topology-l-2-links - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 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": ["organizations", "monitor", "devices", "topology", "l2", "links"], - "operation": "getOrganizationDevicesTopologyL2Links", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/topology/l2/links" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesTopologyL2Links: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationDevicesTopologyNodesDiscovered(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List topology nodes discovered by LLDP/CDP from devices in an organization, including reported metadata when available.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-topology-nodes-discovered - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 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": ["organizations", "monitor", "devices", "topology", "nodes", "discovered"], - "operation": "getOrganizationDevicesTopologyNodesDiscovered", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/topology/nodes/discovered" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - + array_params = [ + "networkIds", + "serials", + "productTypes", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + if self._session._validate_kwargs: - all_params = query_params + all_params = query_params + array_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationDevicesTopologyNodesDiscovered: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationDevicesSystemMemoryUsageHistoryByInterval: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) @@ -7941,248 +4612,6 @@ def deleteOrganizationEarlyAccessFeaturesOptIn(self, organizationId: str, optInI return self._session.delete(metadata, resource) - def updateOrganizationExtensionsSdwanmanagerInterconnect( - self, organizationId: str, interconnectId: str, name: str, status: str, **kwargs - ): - """ - **Update name and status of an Interconnect** - https://developer.cisco.com/meraki/api-v1/#!update-organization-extensions-sdwanmanager-interconnect - - - organizationId (string): Organization ID - - interconnectId (string): Interconnect ID - - name (string): Interconnect name - - status (string): Interconnect status - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "extensions", "sdwanmanager", "interconnects"], - "operation": "updateOrganizationExtensionsSdwanmanagerInterconnect", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - interconnectId = urllib.parse.quote(str(interconnectId), safe="") - resource = f"/organizations/{organizationId}/extensions/sdwanmanager/interconnects/{interconnectId}" - - body_params = [ - "name", - "status", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationExtensionsSdwanmanagerInterconnect: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def getOrganizationExtensionsThousandEyesNetworks(self, organizationId: str): - """ - **List the ThousandEyes agent configurations under this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-extensions-thousand-eyes-networks - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "extensions", "thousandEyes", "networks"], - "operation": "getOrganizationExtensionsThousandEyesNetworks", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/networks" - - return self._session.get(metadata, resource) - - def createOrganizationExtensionsThousandEyesNetwork(self, organizationId: str, enabled: bool, networkId: str, **kwargs): - """ - **Add a ThousandEyes agent for this network** - https://developer.cisco.com/meraki/api-v1/#!create-organization-extensions-thousand-eyes-network - - - organizationId (string): Organization ID - - enabled (boolean): Whether or not the ThousandEyes agent is enabled for the network. - - networkId (string): Network that will have the ThousandEyes agent installed on. - - tests (array): An array of tests to be created - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "extensions", "thousandEyes", "networks"], - "operation": "createOrganizationExtensionsThousandEyesNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/networks" - - body_params = [ - "enabled", - "networkId", - "tests", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationExtensionsThousandEyesNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationExtensionsThousandEyesNetworksSupported( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List all the networks eligible for ThousandEyes agent activation under this organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-extensions-thousand-eyes-networks-supported - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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. - - agentInstalled (boolean): Set to true to get only networks with installed ThousandEyes agent; set to false to get networks without agents. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "extensions", "thousandEyes", "networks", "supported"], - "operation": "getOrganizationExtensionsThousandEyesNetworksSupported", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/networks/supported" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "agentInstalled", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationExtensionsThousandEyesNetworksSupported: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationExtensionsThousandEyesNetwork(self, organizationId: str, networkId: str): - """ - **List the ThousandEyes agent configuration under this network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-extensions-thousand-eyes-network - - - organizationId (string): Organization ID - - networkId (string): Network ID - """ - - metadata = { - "tags": ["organizations", "configure", "extensions", "thousandEyes", "networks"], - "operation": "getOrganizationExtensionsThousandEyesNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/networks/{networkId}" - - return self._session.get(metadata, resource) - - def updateOrganizationExtensionsThousandEyesNetwork(self, organizationId: str, networkId: str, enabled: bool, **kwargs): - """ - **Update a ThousandEyes agent from this network** - https://developer.cisco.com/meraki/api-v1/#!update-organization-extensions-thousand-eyes-network - - - organizationId (string): Organization ID - - networkId (string): Network ID - - enabled (boolean): Whether or not the ThousandEyes agent is enabled for the network. - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "extensions", "thousandEyes", "networks"], - "operation": "updateOrganizationExtensionsThousandEyesNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/networks/{networkId}" - - body_params = [ - "enabled", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationExtensionsThousandEyesNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationExtensionsThousandEyesNetwork(self, organizationId: str, networkId: str): - """ - **Delete a ThousandEyes agent from this network** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-extensions-thousand-eyes-network - - - organizationId (string): Organization ID - - networkId (string): Network ID - """ - - metadata = { - "tags": ["organizations", "configure", "extensions", "thousandEyes", "networks"], - "operation": "deleteOrganizationExtensionsThousandEyesNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/networks/{networkId}" - - return self._session.delete(metadata, resource) - - def createOrganizationExtensionsThousandEyesTest(self, organizationId: str, **kwargs): - """ - **Create a ThousandEyes test based on a provided test template** - https://developer.cisco.com/meraki/api-v1/#!create-organization-extensions-thousand-eyes-test - - - organizationId (string): Organization ID - - tests (array): An array of tests to be created - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "extensions", "thousandEyes", "tests"], - "operation": "createOrganizationExtensionsThousandEyesTest", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/tests" - - body_params = [ - "tests", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationExtensionsThousandEyesTest: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - def getOrganizationFirmwareUpgrades(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Get firmware upgrade information for an organization** @@ -8384,111 +4813,23 @@ def getOrganizationFloorPlansAutoLocateStatuses(self, organizationId: str, total params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "networkIds", - "floorPlanIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationFloorPlansAutoLocateStatuses: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAccessGroups(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List effective Catalyst Center access groups for the requested Catalyst Center administrators in the specified organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-access-groups - - - 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): Number of access groups to return per page. Range: 1-50. Defaults to 50 when omitted. - - startingAfter (string): Cursor token to retrieve access groups after the specified access group identifier. - - endingBefore (string): Cursor token to retrieve access groups before the specified access group identifier. - - assignedAdminEmails (array): Catalyst Center administrator email addresses used by federation to filter access groups for the requested administrators. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "iam", "admins", "accessGroups"], - "operation": "getOrganizationAccessGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/admins/accessGroups" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "assignedAdminEmails", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "assignedAdminEmails", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationAccessGroups: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def resolveOrganizationIamAdminsAdministratorsMePermissions( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the authenticated caller admin's permissions for an organization** - https://developer.cisco.com/meraki/api-v1/#!resolve-organization-iam-admins-administrators-me-permissions - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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": ["organizations", "configure", "iam", "admins", "administrators", "me", "permissions"], - "operation": "resolveOrganizationIamAdminsAdministratorsMePermissions", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/admins/administrators/me/permissions/resolve" - - body_params = [ - "perPage", - "startingAfter", - "endingBefore", + "networkIds", + "floorPlanIds", ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) if self._session._validate_kwargs: - all_params = [] + body_params + all_params = query_params + array_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"resolveOrganizationIamAdminsAdministratorsMePermissions: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationFloorPlansAutoLocateStatuses: ignoring unrecognized kwargs: {invalid}" ) - return self._session.post(metadata, resource, payload) + return self._session.get_pages(metadata, resource, params, total_pages, direction) def getOrganizationIntegrationsDeployable(self, organizationId: str): """ @@ -8759,61 +5100,6 @@ def getOrganizationInventoryDevices(self, organizationId: str, total_pages=1, di return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationInventoryDevicesDetails(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return inventory devices with additional site, geolocation, software, licensing, lifecycle, and Catalyst Center-specific fields** - https://developer.cisco.com/meraki/api-v1/#!get-organization-inventory-devices-details - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 100. - - 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 IDs. Matches devices in any of the provided network IDs. When multiple filter parameters are provided, a device must match each provided filter. Query array syntax follows the standard bracket form, for example: networkIds[]=L_1234&networkIds[]=L_5678. Maximum 100 network IDs. - - serials (array): Optional parameter to filter devices by serials. Matches devices with any of the provided serials. When multiple filter parameters are provided, a device must match each provided filter. Query array syntax follows the standard bracket form, for example: serials[]=Q234-ABCD-5678&serials[]=Q234-ABCD-9012. Maximum 100 serials. - - productTypes (array): Optional parameter to filter devices by product type. Matches devices with any of the provided product types. When multiple filter parameters are provided, a device must match each provided filter. Query array syntax follows the standard bracket form, for example: productTypes[]=switch&productTypes[]=wireless. Maximum 100 product types. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "inventory", "devices", "details"], - "operation": "getOrganizationInventoryDevicesDetails", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/inventory/devices/details" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - "productTypes", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "productTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationInventoryDevicesDetails: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationInventoryDevicesEoxOverview(self, organizationId: str): """ **Fetch the EOX summary for an organization, including counts of devices that are end-of-sale, end-of-support, and end-of-support-soon.** @@ -9401,7 +5687,6 @@ def createOrganizationNetwork(self, organizationId: str, name: str, productTypes - timeZone (string): The timezone of the network. For a list of allowed timezones, please see the 'TZ' column in the table in this article. - copyFromNetworkId (string): The ID of the network to copy configuration from. Other provided parameters will override the copied configuration, except type which must match this network's type exactly. - notes (string): Add any notes or additional information about this network here. - - details (array): An array of details """ kwargs.update(locals()) @@ -9416,256 +5701,10 @@ def createOrganizationNetwork(self, organizationId: str, name: str, productTypes body_params = [ "name", "productTypes", - "tags", - "timeZone", - "copyFromNetworkId", - "notes", - "details", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationNetwork: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def combineOrganizationNetworks(self, organizationId: str, name: str, networkIds: list, **kwargs): - """ - **Combine multiple networks into a single network** - https://developer.cisco.com/meraki/api-v1/#!combine-organization-networks - - - organizationId (string): Organization ID - - name (string): The name of the combined network - - networkIds (array): A list of the network IDs that will be combined. If an ID of a combined network is included in this list, the other networks in the list will be grouped into that network - - enrollmentString (string): A unique identifier which can be used for device enrollment or easy access through the Meraki SM Registration page or the Self Service Portal. Please note that changing this field may cause existing bookmarks to break. All networks that are part of this combined network will have their enrollment string appended by '-network_type'. If left empty, all exisitng enrollment strings will be deleted. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "networks"], - "operation": "combineOrganizationNetworks", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/networks/combine" - - body_params = [ - "name", - "networkIds", - "enrollmentString", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"combineOrganizationNetworks: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationNetworksGroups(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the network groups in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-networks-groups - - - 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 - - groupIds (array): Optional parameter to filter network groups by ID - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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": ["organizations", "configure", "networks", "groups"], - "operation": "getOrganizationNetworksGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/networks/groups" - - query_params = [ - "groupIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "groupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationNetworksGroups: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationNetworksGroup(self, organizationId: str, name: str, **kwargs): - """ - **Create a network group** - https://developer.cisco.com/meraki/api-v1/#!create-organization-networks-group - - - organizationId (string): Organization ID - - name (string): The name of the network group - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "networks", "groups"], - "operation": "createOrganizationNetworksGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/networks/groups" - - body_params = [ - "name", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationNetworksGroup: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationNetworksGroupsOverviewByGroup(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the client and status overview information for the network groups in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-networks-groups-overview-by-group - - - 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 - - sortBy (string): Field by which to sort the results - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 5000. - - 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()) - - if "sortBy" in kwargs: - options = ["status"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "monitor", "networks", "groups", "overview", "byGroup"], - "operation": "getOrganizationNetworksGroupsOverviewByGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/networks/groups/overview/byGroup" - - query_params = [ - "sortBy", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationNetworksGroupsOverviewByGroup: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def updateOrganizationNetworksGroup(self, organizationId: str, groupId: str, name: str, **kwargs): - """ - **Update a network group** - https://developer.cisco.com/meraki/api-v1/#!update-organization-networks-group - - - organizationId (string): Organization ID - - groupId (string): Group ID - - name (string): The new name of the network group - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "networks", "groups"], - "operation": "updateOrganizationNetworksGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/networks/groups/{groupId}" - - body_params = [ - "name", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationNetworksGroup: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationNetworksGroup(self, organizationId: str, groupId: str): - """ - **Delete a network group** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-networks-group - - - organizationId (string): Organization ID - - groupId (string): Group ID - """ - - metadata = { - "tags": ["organizations", "configure", "networks", "groups"], - "operation": "deleteOrganizationNetworksGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/networks/groups/{groupId}" - - return self._session.delete(metadata, resource) - - def bulkOrganizationNetworksGroupAssign(self, organizationId: str, groupId: str, networkIds: list, **kwargs): - """ - **Add networks to a network group** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-networks-group-assign - - - organizationId (string): Organization ID - - groupId (string): Group ID - - networkIds (array): A list of network IDs to add to the network group - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "networks", "groups"], - "operation": "bulkOrganizationNetworksGroupAssign", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/networks/groups/{groupId}/bulkAssign" - - body_params = [ - "networkIds", + "tags", + "timeZone", + "copyFromNetworkId", + "notes", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -9673,32 +5712,34 @@ def bulkOrganizationNetworksGroupAssign(self, organizationId: str, groupId: str, all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning(f"bulkOrganizationNetworksGroupAssign: ignoring unrecognized kwargs: {invalid}") + self._session._logger.warning(f"createOrganizationNetwork: ignoring unrecognized kwargs: {invalid}") return self._session.post(metadata, resource, payload) - def bulkOrganizationNetworksGroupUnassign(self, organizationId: str, groupId: str, networkIds: list, **kwargs): + def combineOrganizationNetworks(self, organizationId: str, name: str, networkIds: list, **kwargs): """ - **Remove networks from a network group** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-networks-group-unassign + **Combine multiple networks into a single network** + https://developer.cisco.com/meraki/api-v1/#!combine-organization-networks - organizationId (string): Organization ID - - groupId (string): Group ID - - networkIds (array): A list of network IDs to remove from the network group + - name (string): The name of the combined network + - networkIds (array): A list of the network IDs that will be combined. If an ID of a combined network is included in this list, the other networks in the list will be grouped into that network + - enrollmentString (string): A unique identifier which can be used for device enrollment or easy access through the Meraki SM Registration page or the Self Service Portal. Please note that changing this field may cause existing bookmarks to break. All networks that are part of this combined network will have their enrollment string appended by '-network_type'. If left empty, all exisitng enrollment strings will be deleted. """ - kwargs = locals() + kwargs.update(locals()) metadata = { - "tags": ["organizations", "configure", "networks", "groups"], - "operation": "bulkOrganizationNetworksGroupUnassign", + "tags": ["organizations", "configure", "networks"], + "operation": "combineOrganizationNetworks", } organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/networks/groups/{groupId}/bulkUnassign" + resource = f"/organizations/{organizationId}/networks/combine" body_params = [ + "name", "networkIds", + "enrollmentString", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -9706,9 +5747,7 @@ def bulkOrganizationNetworksGroupUnassign(self, organizationId: str, groupId: st all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning( - f"bulkOrganizationNetworksGroupUnassign: ignoring unrecognized kwargs: {invalid}" - ) + self._session._logger.warning(f"combineOrganizationNetworks: ignoring unrecognized kwargs: {invalid}") return self._session.post(metadata, resource, payload) @@ -9794,25 +5833,6 @@ def getNetworkMoves(self, organizationId: str, total_pages=1, direction="next", return self._session.get_pages(metadata, resource, params, total_pages, direction) - def deleteOrganizationOpenRoamingCertificate(self, organizationId: str, id: str): - """ - **Delete an open roaming certificate.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-open-roaming-certificate - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["organizations", "configure", "openRoaming", "certificates"], - "operation": "deleteOrganizationOpenRoamingCertificate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/openRoaming/certificates/{id}" - - return self._session.delete(metadata, resource) - def getOrganizationOpenapiSpec(self, organizationId: str, **kwargs): """ **Return the OpenAPI Specification of the organization's API documentation in JSON** @@ -9934,7 +5954,6 @@ def getOrganizationPoliciesGlobalFirewallRulesets(self, organizationId: str, tot - direction (string): direction to paginate, either "next" (default) or "prev" page - rulesetIds (array): Filter rulesets by IDs - name (string): Filter rulesets by name (partial match, case-insensitive). If multiple instances are provided, only the last one is used. - - excludedPolicyIds (array): Filter out rulesets that are associated with the specified policy IDs - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 100. - 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. @@ -9952,7 +5971,6 @@ def getOrganizationPoliciesGlobalFirewallRulesets(self, organizationId: str, tot query_params = [ "rulesetIds", "name", - "excludedPolicyIds", "perPage", "startingAfter", "endingBefore", @@ -9961,7 +5979,6 @@ def getOrganizationPoliciesGlobalFirewallRulesets(self, organizationId: str, tot array_params = [ "rulesetIds", - "excludedPolicyIds", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10482,7 +6499,6 @@ def getOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments( - rulesetIds (array): Filter assignments by ruleset IDs - policyIds (array): Filter assignments by policy IDs - assignmentIds (array): Filter assignments by assignment IDs - - staged (boolean): Filter assignments by whether or not they are staged - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 100. - 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. @@ -10501,7 +6517,6 @@ def getOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments( "rulesetIds", "policyIds", "assignmentIds", - "staged", "perPage", "startingAfter", "endingBefore", @@ -10539,7 +6554,6 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( - rulesetId (string): ID of the ruleset to assign - policyId (string): ID of the policy to assign the ruleset to - priority (integer): Priority of the ruleset assignment (lower numbers = higher priority) - - staged (boolean): Stage an assignment without applying it immediately to the policy """ kwargs.update(locals()) @@ -10555,7 +6569,6 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( "rulesetId", "policyId", "priority", - "staged", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -10569,41 +6582,6 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( return self._session.post(metadata, resource, payload) - def commitOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments( - self, organizationId: str, policy: dict, **kwargs - ): - """ - **Commit staged Organization-Wide Policy Ruleset Assignments** - https://developer.cisco.com/meraki/api-v1/#!commit-organization-policies-global-group-policies-firewall-rulesets-assignments - - - organizationId (string): Organization ID - - policy (object): Policy in which all staged rulesets will be committed - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "policies", "global", "group", "firewall", "rulesets", "assignments"], - "operation": "commitOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/policies/global/group/policies/firewall/rulesets/assignments/commit" - - body_params = [ - "policy", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"commitOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - def updateOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( self, organizationId: str, assignmentId: str, **kwargs ): @@ -11036,185 +7014,6 @@ def deleteOrganizationPolicyObject(self, organizationId: str, policyObjectId: st return self._session.delete(metadata, resource) - def getOrganizationRoutingVrfs(self, organizationId: str, **kwargs): - """ - **List existing organization-wide VRFs (Virtual Routing and Forwarding).** - https://developer.cisco.com/meraki/api-v1/#!get-organization-routing-vrfs - - - organizationId (string): Organization ID - - vrfIds (array): IDs of the desired VRFs. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "routing", "vrfs"], - "operation": "getOrganizationRoutingVrfs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/routing/vrfs" - - query_params = [ - "vrfIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "vrfIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationRoutingVrfs: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def createOrganizationRoutingVrf(self, organizationId: str, name: str, **kwargs): - """ - **Add an organization-wide VRF (Virtual Routing and Forwarding)** - https://developer.cisco.com/meraki/api-v1/#!create-organization-routing-vrf - - - organizationId (string): Organization ID - - name (string): The name of the VRF (Virtual Routing and Forwarding) - - description (string): Description of the VRF (Virtual Routing and Forwarding) - - routeDistinguisher (string): RD (Route Distinguisher) for the VRF (Virtual Routing and Forwarding) - - routeTarget (string): Route target are used to control the import and export of routes between VRFs - - appliance (object): This parameter is used to enable or disable the VRF on the WAN appliance - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "routing", "vrfs"], - "operation": "createOrganizationRoutingVrf", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/routing/vrfs" - - body_params = [ - "name", - "description", - "routeDistinguisher", - "routeTarget", - "appliance", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationRoutingVrf: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationRoutingVrfsOverviewByVrf(self, organizationId: str, **kwargs): - """ - **List existing organization-wide VRFs (Virtual Routing and Forwarding) overviews.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-routing-vrfs-overview-by-vrf - - - organizationId (string): Organization ID - - vrfIds (array): IDs of the desired VRFs. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "routing", "vrfs", "overview", "byVrf"], - "operation": "getOrganizationRoutingVrfsOverviewByVrf", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/routing/vrfs/overview/byVrf" - - query_params = [ - "vrfIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "vrfIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationRoutingVrfsOverviewByVrf: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def updateOrganizationRoutingVrf(self, organizationId: str, vrfId: str, **kwargs): - """ - **Update an organization-wide VRF (Virtual Routing and Forwarding)** - https://developer.cisco.com/meraki/api-v1/#!update-organization-routing-vrf - - - organizationId (string): Organization ID - - vrfId (string): Vrf ID - - name (string): The name of the VRF (Virtual Routing and Forwarding) - - description (string): Description of the VRF (Virtual Routing and Forwarding) - - routeDistinguisher (string): RD (Route Distinguisher) for the VRF (Virtual Routing and Forwarding) - - routeTarget (string): Route target are used to control the import and export of routes between VRFs - - appliance (object): This parameter is used to enable or disable the VRF on the WAN appliance - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "routing", "vrfs"], - "operation": "updateOrganizationRoutingVrf", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - vrfId = urllib.parse.quote(str(vrfId), safe="") - resource = f"/organizations/{organizationId}/routing/vrfs/{vrfId}" - - body_params = [ - "name", - "description", - "routeDistinguisher", - "routeTarget", - "appliance", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationRoutingVrf: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationRoutingVrf(self, organizationId: str, vrfId: str): - """ - **Delete a VRF (Virtual Routing and Forwarding) from a organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-routing-vrf - - - organizationId (string): Organization ID - - vrfId (string): Vrf ID - """ - - metadata = { - "tags": ["organizations", "configure", "routing", "vrfs"], - "operation": "deleteOrganizationRoutingVrf", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - vrfId = urllib.parse.quote(str(vrfId), safe="") - resource = f"/organizations/{organizationId}/routing/vrfs/{vrfId}" - - return self._session.delete(metadata, resource) - def getOrganizationSaml(self, organizationId: str): """ **Returns the SAML SSO enabled settings for an organization.** @@ -11888,114 +7687,9 @@ def updateOrganizationSaseSite(self, organizationId: str, siteId: str, **kwargs) all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationSaseSite: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getOrganizationSites(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Lists unified site resources for an organization across Meraki networks and Catalyst Center sites** - https://developer.cisco.com/meraki/api-v1/#!get-organization-sites - - - 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 - 500. Default is 500. - - 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. - - ids (array): Optional parameter to filter resources by unified resource ID. This filter uses multiple exact matches. - - resourceTypes (array): Optional parameter to filter resources by returned resource type. - - resourceTags (array): Optional parameter to filter resources by tag. By default all provided tags must match. - - resourceName (string): Optional parameter to filter resources by case-insensitive partial name match. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "sites"], - "operation": "getOrganizationSites", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sites" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "ids", - "resourceTypes", - "resourceTags", - "resourceName", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "ids", - "resourceTypes", - "resourceTags", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSites: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSitesBuildings(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the buildings belonging to the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-sites-buildings - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter buildings by one or more network IDs - - buildingIds (array): Optional parameter to filter buildings by one or more building IDs - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "sites", "buildings"], - "operation": "getOrganizationSitesBuildings", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sites/buildings" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "buildingIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "buildingIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSitesBuildings: ignoring unrecognized kwargs: {invalid}") + self._session._logger.warning(f"updateOrganizationSaseSite: ignoring unrecognized kwargs: {invalid}") - return self._session.get_pages(metadata, resource, params, total_pages, direction) + return self._session.put(metadata, resource, payload) def getOrganizationSnmp(self, organizationId: str): """ @@ -12068,45 +7762,6 @@ def updateOrganizationSnmp(self, organizationId: str, **kwargs): return self._session.put(metadata, resource, payload) - def getOrganizationSnmpTrapsByNetwork(self, organizationId: str, **kwargs): - """ - **Retrieve the SNMP trap configuration for the networks in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-snmp-traps-by-network - - - organizationId (string): Organization ID - - networkIds (array): An optional parameter to filter SNMP trap configs by network IDs - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "snmp", "traps", "byNetwork"], - "operation": "getOrganizationSnmpTrapsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/snmp/traps/byNetwork" - - query_params = [ - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSnmpTrapsByNetwork: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - def getOrganizationSplashAsset(self, organizationId: str, id: str): """ **Get a Splash Theme Asset** @@ -12257,7 +7912,6 @@ def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, - organizationId (string): Organization ID - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12278,7 +7932,6 @@ def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12404,7 +8057,6 @@ def getOrganizationSummaryTopClientsByUsage(self, organizationId: str, **kwargs) - organizationId (string): Organization ID - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12425,7 +8077,6 @@ def getOrganizationSummaryTopClientsByUsage(self, organizationId: str, **kwargs) query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12453,7 +8104,6 @@ def getOrganizationSummaryTopClientsManufacturersByUsage(self, organizationId: s - organizationId (string): Organization ID - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12474,7 +8124,6 @@ def getOrganizationSummaryTopClientsManufacturersByUsage(self, organizationId: s query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12502,7 +8151,6 @@ def getOrganizationSummaryTopDevicesByUsage(self, organizationId: str, **kwargs) - organizationId (string): Organization ID - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12523,7 +8171,6 @@ def getOrganizationSummaryTopDevicesByUsage(self, organizationId: str, **kwargs) query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12551,7 +8198,6 @@ def getOrganizationSummaryTopDevicesModelsByUsage(self, organizationId: str, **k - organizationId (string): Organization ID - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12572,7 +8218,6 @@ def getOrganizationSummaryTopDevicesModelsByUsage(self, organizationId: str, **k query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12602,7 +8247,6 @@ def getOrganizationSummaryTopNetworksByStatus(self, organizationId: str, total_p - direction (string): direction to paginate, either "next" (default) or "prev" page - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12623,7 +8267,6 @@ def getOrganizationSummaryTopNetworksByStatus(self, organizationId: str, total_p query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12651,7 +8294,6 @@ def getOrganizationSummaryTopSsidsByUsage(self, organizationId: str, **kwargs): - organizationId (string): Organization ID - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12672,7 +8314,6 @@ def getOrganizationSummaryTopSsidsByUsage(self, organizationId: str, **kwargs): query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12700,7 +8341,6 @@ def getOrganizationSummaryTopSwitchesByEnergyUsage(self, organizationId: str, ** - organizationId (string): Organization ID - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12721,7 +8361,6 @@ def getOrganizationSummaryTopSwitchesByEnergyUsage(self, organizationId: str, ** query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12850,137 +8489,6 @@ def getOrganizationWebhooksCallbacksStatus(self, organizationId: str, callbackId return self._session.get(metadata, resource) - def getOrganizationWebhooksHttpServers(self, organizationId: str): - """ - **List the HTTP servers for this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-webhooks-http-servers - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "webhooks", "httpServers"], - "operation": "getOrganizationWebhooksHttpServers", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/webhooks/httpServers" - - return self._session.get(metadata, resource) - - def createOrganizationWebhooksHttpServer(self, organizationId: str, name: str, url: str, **kwargs): - """ - **Add an HTTP server to an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-webhooks-http-server - - - organizationId (string): Organization ID - - name (string): A name for easy reference to the HTTP server - - url (string): The URL of the HTTP server - - sharedSecret (string): A shared secret that will be included in POSTs sent to the HTTP server. This secret can be used to verify that the request was sent by Meraki. - - payloadTemplate (object): The payload template to use when posting data to the HTTP server. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "webhooks", "httpServers"], - "operation": "createOrganizationWebhooksHttpServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/webhooks/httpServers" - - body_params = [ - "name", - "url", - "sharedSecret", - "payloadTemplate", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationWebhooksHttpServer: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationWebhooksHttpServer(self, organizationId: str, id: str): - """ - **Return an HTTP server for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-webhooks-http-server - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["organizations", "configure", "webhooks", "httpServers"], - "operation": "getOrganizationWebhooksHttpServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/webhooks/httpServers/{id}" - - return self._session.get(metadata, resource) - - def updateOrganizationWebhooksHttpServer(self, organizationId: str, id: str, **kwargs): - """ - **Update an HTTP server for an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-webhooks-http-server - - - organizationId (string): Organization ID - - id (string): ID - - name (string): A name for easy reference to the HTTP server - - url (string): The URL of the HTTP server - - sharedSecret (string): A shared secret that will be included in POSTs sent to the HTTP server. This secret can be used to verify that the request was sent by Meraki. - - payloadTemplate (object): The payload template to use when posting data to the HTTP server. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "webhooks", "httpServers"], - "operation": "updateOrganizationWebhooksHttpServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/webhooks/httpServers/{id}" - - body_params = [ - "name", - "url", - "sharedSecret", - "payloadTemplate", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationWebhooksHttpServer: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationWebhooksHttpServer(self, organizationId: str, id: str): - """ - **Delete an HTTP server from an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-webhooks-http-server - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["organizations", "configure", "webhooks", "httpServers"], - "operation": "deleteOrganizationWebhooksHttpServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/webhooks/httpServers/{id}" - - return self._session.delete(metadata, resource) - def getOrganizationWebhooksLogs(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Return the log of webhook POSTs sent** @@ -13025,206 +8533,3 @@ def getOrganizationWebhooksLogs(self, organizationId: str, total_pages=1, direct self._session._logger.warning(f"getOrganizationWebhooksLogs: ignoring unrecognized kwargs: {invalid}") return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWebhooksPayloadTemplates(self, organizationId: str): - """ - **List the webhook payload templates for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-webhooks-payload-templates - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "webhooks", "payloadTemplates"], - "operation": "getOrganizationWebhooksPayloadTemplates", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/webhooks/payloadTemplates" - - return self._session.get(metadata, resource) - - def createOrganizationWebhooksPayloadTemplate(self, organizationId: str, name: str, **kwargs): - """ - **Create a webhook payload template for an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-webhooks-payload-template - - - organizationId (string): Organization ID - - name (string): The name of the new template - - body (string): The liquid template used for the body of the webhook message. Either `body` or `bodyFile` must be specified. - - headers (array): The liquid template used with the webhook headers. - - bodyFile (string): A file containing liquid template used for the body of the webhook message. Either `body` or `bodyFile` must be specified. - - headersFile (string): A file containing the liquid template used with the webhook headers. - - sharing (object): Information on which entities have access to the template - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "webhooks", "payloadTemplates"], - "operation": "createOrganizationWebhooksPayloadTemplate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/webhooks/payloadTemplates" - - body_params = [ - "name", - "body", - "headers", - "bodyFile", - "headersFile", - "sharing", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationWebhooksPayloadTemplate: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationWebhooksPayloadTemplate(self, organizationId: str, payloadTemplateId: str): - """ - **Get the webhook payload template for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-webhooks-payload-template - - - organizationId (string): Organization ID - - payloadTemplateId (string): Payload template ID - """ - - metadata = { - "tags": ["organizations", "configure", "webhooks", "payloadTemplates"], - "operation": "getOrganizationWebhooksPayloadTemplate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - payloadTemplateId = urllib.parse.quote(str(payloadTemplateId), safe="") - resource = f"/organizations/{organizationId}/webhooks/payloadTemplates/{payloadTemplateId}" - - return self._session.get(metadata, resource) - - def deleteOrganizationWebhooksPayloadTemplate(self, organizationId: str, payloadTemplateId: str): - """ - **Destroy a webhook payload template for an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-webhooks-payload-template - - - organizationId (string): Organization ID - - payloadTemplateId (string): Payload template ID - """ - - metadata = { - "tags": ["organizations", "configure", "webhooks", "payloadTemplates"], - "operation": "deleteOrganizationWebhooksPayloadTemplate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - payloadTemplateId = urllib.parse.quote(str(payloadTemplateId), safe="") - resource = f"/organizations/{organizationId}/webhooks/payloadTemplates/{payloadTemplateId}" - - return self._session.delete(metadata, resource) - - def updateOrganizationWebhooksPayloadTemplate(self, organizationId: str, payloadTemplateId: str, **kwargs): - """ - **Update a webhook payload template for an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-webhooks-payload-template - - - organizationId (string): Organization ID - - payloadTemplateId (string): Payload template ID - - name (string): The name of the template - - body (string): The liquid template used for the body of the webhook message. - - headers (array): The liquid template used with the webhook headers. - - bodyFile (string): A file containing liquid template used for the body of the webhook message. - - headersFile (string): A file containing the liquid template used with the webhook headers. - - sharing (object): Information on which entities have access to the template - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "webhooks", "payloadTemplates"], - "operation": "updateOrganizationWebhooksPayloadTemplate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - payloadTemplateId = urllib.parse.quote(str(payloadTemplateId), safe="") - resource = f"/organizations/{organizationId}/webhooks/payloadTemplates/{payloadTemplateId}" - - body_params = [ - "name", - "body", - "headers", - "bodyFile", - "headersFile", - "sharing", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationWebhooksPayloadTemplate: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def createOrganizationWebhooksWebhookTest(self, organizationId: str, url: str, **kwargs): - """ - **Send a test webhook for an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-webhooks-webhook-test - - - organizationId (string): Organization ID - - url (string): The URL where the test webhook will be sent - - sharedSecret (string): The shared secret the test webhook will send. Optional. Defaults to HTTP server's shared secret. Otherwise, defaults to an empty string. - - payloadTemplateId (string): The ID of the payload template of the test webhook. Defaults to the HTTP server's template ID if one exists for the given URL, or Generic template ID otherwise - - payloadTemplateName (string): The name of the payload template. - - alertTypeId (string): The type of alert which the test webhook will send. Optional. Defaults to insight_app_outage_start. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "webhooks", "webhookTests"], - "operation": "createOrganizationWebhooksWebhookTest", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/webhooks/webhookTests" - - body_params = [ - "url", - "sharedSecret", - "payloadTemplateId", - "payloadTemplateName", - "alertTypeId", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationWebhooksWebhookTest: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationWebhooksWebhookTest(self, organizationId: str, webhookTestId: str): - """ - **Return the status of a webhook test for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-webhooks-webhook-test - - - organizationId (string): Organization ID - - webhookTestId (string): Webhook test ID - """ - - metadata = { - "tags": ["organizations", "configure", "webhooks", "webhookTests"], - "operation": "getOrganizationWebhooksWebhookTest", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - webhookTestId = urllib.parse.quote(str(webhookTestId), safe="") - resource = f"/organizations/{organizationId}/webhooks/webhookTests/{webhookTestId}" - - return self._session.get(metadata, resource) diff --git a/meraki/aio/api/secureConnect.py b/meraki/aio/api/secureConnect.py deleted file mode 100644 index 4700317..0000000 --- a/meraki/aio/api/secureConnect.py +++ /dev/null @@ -1,1084 +0,0 @@ -import urllib - - -class AsyncSecureConnect: - def __init__(self, session): - super().__init__() - self._session = session - - def getOrganizationSecureConnectPrivateApplicationGroups( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Provides a list of private application groups for an Organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-private-application-groups - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - nameIncludes (string): Optional parameter to search the application group list by group name, case is ignored - - applicationGroupIds (array): List of application group ids attached to fetch - - sortBy (string): Optional parameter to specify the field used to sort objects. - - sortOrder (string): Optional parameter to specify the sort order. Default value is asc. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["applicationGroupId", "modifiedAt", "name"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplicationGroups"], - "operation": "getOrganizationSecureConnectPrivateApplicationGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplicationGroups" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "nameIncludes", - "applicationGroupIds", - "sortBy", - "sortOrder", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "applicationGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSecureConnectPrivateApplicationGroups: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSecureConnectPrivateApplicationGroup(self, organizationId: str, name: str, **kwargs): - """ - **Creates a group of private applications to apply to policy** - https://developer.cisco.com/meraki/api-v1/#!create-organization-secure-connect-private-application-group - - - organizationId (string): Organization ID - - name (string): Application Group Name. This is required and cannot have any special characters other than spaces and hyphens - - description (string): Optional short description for application group - - applicationIds (array): List of application ids attached to this Private Application Group - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplicationGroups"], - "operation": "createOrganizationSecureConnectPrivateApplicationGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplicationGroups" - - body_params = [ - "name", - "description", - "applicationIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSecureConnectPrivateApplicationGroup: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationSecureConnectPrivateApplicationGroup(self, organizationId: str, id: str, name: str, **kwargs): - """ - **Update an application group in an Organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-secure-connect-private-application-group - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Application Group Name. This is required and cannot have any special characters other than spaces and hyphens - - description (string): Optional short description for application group - - applicationIds (array): List of application ids attached to this Private Application Group - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplicationGroups"], - "operation": "updateOrganizationSecureConnectPrivateApplicationGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplicationGroups/{id}" - - body_params = [ - "name", - "description", - "applicationIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSecureConnectPrivateApplicationGroup: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSecureConnectPrivateApplicationGroup(self, organizationId: str, id: str, **kwargs): - """ - **Deletes private application group from an Organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-secure-connect-private-application-group - - - organizationId (string): Organization ID - - id (string): ID - - force (boolean): Boolean flag to force delete application group, even if application group is in use by one or more rules. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplicationGroups"], - "operation": "deleteOrganizationSecureConnectPrivateApplicationGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplicationGroups/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationSecureConnectPrivateApplicationGroup(self, organizationId: str, id: str): - """ - **Return the details of a specific private application group** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-private-application-group - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["secureConnect", "configure", "privateApplicationGroups"], - "operation": "getOrganizationSecureConnectPrivateApplicationGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplicationGroups/{id}" - - return self._session.get(metadata, resource) - - def getOrganizationSecureConnectPrivateApplications(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Provides a list of private applications for an Organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-private-applications - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - nameIncludes (string): Optional parameter to filter the private applications list by application and associated application group names, case is ignored - - applicationGroupIds (array): Optional parameter for filtering the list of private applications belonging to the application group identified by the given IDs. - - appTypes (array): Optional parameter for filtering the list of private applications by applications that contain at least one destination with the specified accessType value. - - sortBy (string): Optional parameter to specify the field used to sort objects. - - sortOrder (string): Optional parameter to specify the sort order. Default value is asc. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["modifiedAt", "name"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplications"], - "operation": "getOrganizationSecureConnectPrivateApplications", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplications" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "nameIncludes", - "applicationGroupIds", - "appTypes", - "sortBy", - "sortOrder", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "applicationGroupIds", - "appTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSecureConnectPrivateApplications: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSecureConnectPrivateApplication(self, organizationId: str, name: str, destinations: list, **kwargs): - """ - **Adds a new private application to the Organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-secure-connect-private-application - - - organizationId (string): Organization ID - - name (string): Name of Application. This is required and should be unique across all applications for a given organization. Name cannot have any special characters other than spaces and hyphens. - - destinations (array): List of IP address destinations. - - description (string): Optional Text description for Application - - appProtocol (string): Protocol for communication between proxy to private application. Applicable for Browser Based Access only. - - sni (string): Optional SNI. Applicable for Browser Based Access only. SNI should be a valid domain. - - externalFQDN (string): Cisco or Customer Managed URL for Application. Applicable for Browser Based Access only. This field is system generated based on the application name and organization ID and overrides user input in payload. This value must be unique across all applications for a given organization. - - sslVerificationEnabled (boolean): Enable Upstream SSL verification for the internally hosted URL by the customer. Applicable for Browser Based Access only. Default is true. - - applicationGroupIds (array): List of application group ids attached to this Private Application - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplications"], - "operation": "createOrganizationSecureConnectPrivateApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplications" - - body_params = [ - "name", - "description", - "destinations", - "appProtocol", - "sni", - "externalFQDN", - "sslVerificationEnabled", - "applicationGroupIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSecureConnectPrivateApplication: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationSecureConnectPrivateApplication( - self, organizationId: str, id: str, name: str, destinations: list, **kwargs - ): - """ - **Updates a specific private application** - https://developer.cisco.com/meraki/api-v1/#!update-organization-secure-connect-private-application - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of Application. This is required and should be unique across all applications for a given organization. Name cannot have any special characters other than spaces and hyphens. - - destinations (array): List of IP address destinations. - - description (string): Optional Text description for Application - - appProtocol (string): Protocol for communication between proxy to private application. Applicable for Browser Based Access only. - - sni (string): Optional SNI. Applicable for Browser Based Access only. SNI should be a valid domain. - - externalFQDN (string): Cisco or Customer Managed URL for Application. Applicable for Browser Based Access only. This field is system generated based on the application name and organization ID and overrides user input in payload. This value must be unique across all applications for a given organization. - - sslVerificationEnabled (boolean): Enable Upstream SSL verification for the internally hosted URL by the customer. Applicable for Browser Based Access only. Default is true. - - applicationGroupIds (array): List of application group ids attached to this Private Application - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplications"], - "operation": "updateOrganizationSecureConnectPrivateApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplications/{id}" - - body_params = [ - "name", - "description", - "destinations", - "appProtocol", - "sni", - "externalFQDN", - "sslVerificationEnabled", - "applicationGroupIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSecureConnectPrivateApplication: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSecureConnectPrivateApplication(self, organizationId: str, id: str, **kwargs): - """ - **Deletes a specific private application** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-secure-connect-private-application - - - organizationId (string): Organization ID - - id (string): ID - - force (boolean): Boolean flag to force delete application, even if application is in use by one or more rules. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplications"], - "operation": "deleteOrganizationSecureConnectPrivateApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplications/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationSecureConnectPrivateApplication(self, organizationId: str, id: str): - """ - **Return the details of a specific private application** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-private-application - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["secureConnect", "configure", "privateApplications"], - "operation": "getOrganizationSecureConnectPrivateApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplications/{id}" - - return self._session.get(metadata, resource) - - def getOrganizationSecureConnectPrivateResourceGroups(self, organizationId: str): - """ - **Provides a list of the private resource groups in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-private-resource-groups - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["secureConnect", "configure", "privateResourceGroups"], - "operation": "getOrganizationSecureConnectPrivateResourceGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResourceGroups" - - return self._session.get(metadata, resource) - - def createOrganizationSecureConnectPrivateResourceGroup(self, organizationId: str, name: str, **kwargs): - """ - **Adds a new private resource group to an organization.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-secure-connect-private-resource-group - - - organizationId (string): Organization ID - - name (string): Name of group. This is required and should be unique across all groups for a given organization. Name cannot have any special characters other than spaces and hyphens. - - description (string): Optional text description for a group. - - resourceIds (array): List of resource ids assigned to this group. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateResourceGroups"], - "operation": "createOrganizationSecureConnectPrivateResourceGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResourceGroups" - - body_params = [ - "name", - "description", - "resourceIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSecureConnectPrivateResourceGroup: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationSecureConnectPrivateResourceGroup(self, organizationId: str, id: str, name: str, **kwargs): - """ - **Updates a specific private resource group.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-secure-connect-private-resource-group - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of group. This is required and should be unique across all groups for a given organization. Name cannot have any special characters other than spaces and hyphens. - - description (string): Optional text description for a group. - - resourceIds (array): List of resource ids assigned to this group. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateResourceGroups"], - "operation": "updateOrganizationSecureConnectPrivateResourceGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResourceGroups/{id}" - - body_params = [ - "name", - "description", - "resourceIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSecureConnectPrivateResourceGroup: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSecureConnectPrivateResourceGroup(self, organizationId: str, id: str): - """ - **Deletes a specific private resource group.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-secure-connect-private-resource-group - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["secureConnect", "configure", "privateResourceGroups"], - "operation": "deleteOrganizationSecureConnectPrivateResourceGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResourceGroups/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationSecureConnectPrivateResources(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Provides a list of private resources for an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-private-resources - - - 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 (string): Number of resources to return for a paginated response. - - startingAfter (string): The name of the resource to start after for a paginated response. Use '' for the first page. - - endingBefore (string): The name of the resource to end before for a paginated response. Use '' for the final page. - - sortBy (string): Parameter to specify the field used to sort objects, by default, resources are returned by name asc. - - sortOrder (string): Parameter to specify the direction used to sort objects, by default, resources are returned by name asc. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateResources"], - "operation": "getOrganizationSecureConnectPrivateResources", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResources" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "sortBy", - "sortOrder", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSecureConnectPrivateResources: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSecureConnectPrivateResource( - self, organizationId: str, name: str, accessTypes: list, resourceAddresses: list, **kwargs - ): - """ - **Adds a new private resource to the organization.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-secure-connect-private-resource - - - organizationId (string): Organization ID - - name (string): Name of resource. This is required and should be unique across all resources for a given organization. Name cannot have any special characters other than spaces and hyphens. - - accessTypes (array): List of access types. - - resourceAddresses (array): List of resource addresses Protocols must be unique in this list. - - description (string): Optional text description for a resource. - - resourceGroupIds (array): List of resource group ids attached to this resource. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateResources"], - "operation": "createOrganizationSecureConnectPrivateResource", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResources" - - body_params = [ - "name", - "description", - "accessTypes", - "resourceAddresses", - "resourceGroupIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSecureConnectPrivateResource: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationSecureConnectPrivateResource( - self, organizationId: str, id: str, name: str, accessTypes: list, resourceAddresses: list, **kwargs - ): - """ - **Updates a specific private resource.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-secure-connect-private-resource - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of resource. This is required and should be unique across all resources for a given organization.Name cannot have any special characters other than spaces and hyphens. - - accessTypes (array): List of access types. - - resourceAddresses (array): List of resource addresses Protocols must be unique in this list. - - description (string): Optional text description for resource. - - resourceGroupIds (array): List of resource group ids attached to this resource. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateResources"], - "operation": "updateOrganizationSecureConnectPrivateResource", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResources/{id}" - - body_params = [ - "name", - "description", - "accessTypes", - "resourceAddresses", - "resourceGroupIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSecureConnectPrivateResource: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSecureConnectPrivateResource(self, organizationId: str, id: str): - """ - **Deletes a specific private resource** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-secure-connect-private-resource - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["secureConnect", "configure", "privateResources"], - "operation": "deleteOrganizationSecureConnectPrivateResource", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResources/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationSecureConnectPublicApplications(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Provides a list of public applications for an Organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-public-applications - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - nameIncludes (string): Optional parameter to filter the public applications list by application name, case is ignored - - risks (array): List of risk levels to filter by - - categories (array): List of categories to filter by - - appTypes (array): List of app types to filter by - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - - sortBy (string): Optional parameter to specify the field used to sort objects, by default, applications are returned by lastDetected desc - - sortOrder (string): Optional parameter to specify the sort order. Default value is desc. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["appType", "category", "lastDetected", "name", "risk"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["secureConnect", "configure", "publicApplications"], - "operation": "getOrganizationSecureConnectPublicApplications", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/publicApplications" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "nameIncludes", - "risks", - "categories", - "appTypes", - "t0", - "t1", - "timespan", - "sortBy", - "sortOrder", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "risks", - "categories", - "appTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSecureConnectPublicApplications: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSecureConnectRegions(self, organizationId: str, **kwargs): - """ - **List deployed cloud hubs and regions in this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-regions - - - organizationId (string): Organization ID - - regionType (string): Filter results by region type - """ - - kwargs.update(locals()) - - if "regionType" in kwargs: - options = ["CNHE", "CloudHub", "Region", "ThirdParty"] - assert kwargs["regionType"] in options, ( - f'''"regionType" cannot be "{kwargs["regionType"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["secureConnect", "configure", "regions"], - "operation": "getOrganizationSecureConnectRegions", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/regions" - - query_params = [ - "regionType", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSecureConnectRegions: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def getOrganizationSecureConnectRemoteAccessLog(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the latest 5000 events logged by remote access.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-remote-access-log - - - 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 - 5000. 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. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - - identityids (string): An identity ID or comma-delimited list of identity ID. - - identitytypes (string): An identity type or comma-delimited list of identity type. - - connectionevent (string): Specify the type of connection event. - - anyconnectversions (string): Specify a comma-separated list of AnyConnect Roaming Security module - versions to filter the data. - - osversions (string): Specify a comma-separated list of OS versions to filter the data. - """ - - kwargs.update(locals()) - - if "connectionevent" in kwargs: - options = ["connected", "disconnected", "failed"] - assert kwargs["connectionevent"] in options, ( - f'''"connectionevent" cannot be "{kwargs["connectionevent"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["secureConnect", "monitor", "remoteAccessLog"], - "operation": "getOrganizationSecureConnectRemoteAccessLog", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/remoteAccessLog" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "identityids", - "identitytypes", - "connectionevent", - "anyconnectversions", - "osversions", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSecureConnectRemoteAccessLog: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSecureConnectRemoteAccessLogsExports( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Provides a list of remote access logs exports for an Organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-remote-access-logs-exports - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - status (string): Filter exports by status. - """ - - kwargs.update(locals()) - - if "status" in kwargs: - options = ["complete", "continue", "error", "in_progress", "new", "zip"] - assert kwargs["status"] in options, ( - f'''"status" cannot be "{kwargs["status"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["secureConnect", "configure", "remoteAccessLogsExports"], - "operation": "getOrganizationSecureConnectRemoteAccessLogsExports", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/remoteAccessLogsExports" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "status", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSecureConnectRemoteAccessLogsExports: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSecureConnectRemoteAccessLogsExport(self, organizationId: str, **kwargs): - """ - **Creates an export for a provided timestamp interval.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-secure-connect-remote-access-logs-export - - - organizationId (string): Organization ID - - t0 (string): The start of the interval, must be within the past 30 days. Must be provided with t1. - - t1 (string): The end of the interval, must not exceed the current date. Must be provided with t0. - - from (integer): Legacy start of the interval in epoch seconds, must be within the past 30 days. Must be provided with to. - - to (integer): Legacy end of the interval in epoch seconds, must not exceed the current date. Must be provided with from. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "remoteAccessLogsExports"], - "operation": "createOrganizationSecureConnectRemoteAccessLogsExport", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/remoteAccessLogsExports" - - body_params = [ - "t0", - "t1", - "from", - "to", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSecureConnectRemoteAccessLogsExport: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSecureConnectRemoteAccessLogsExportsDownload( - self, organizationId: str, id: str, fileType: str, **kwargs - ): - """ - **Redirects to the download link of the completed export.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-remote-access-logs-exports-download - - - organizationId (string): Organization ID - - id (string): Export ID. - - fileType (string): Export download file type. - """ - - kwargs = locals() - - metadata = { - "tags": ["secureConnect", "configure", "remoteAccessLogsExports", "download"], - "operation": "getOrganizationSecureConnectRemoteAccessLogsExportsDownload", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/remoteAccessLogsExports/download" - - query_params = [ - "id", - "fileType", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSecureConnectRemoteAccessLogsExportsDownload: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationSecureConnectRemoteAccessLogsExport(self, organizationId: str, id: str): - """ - **Return the details of a specific remote access logs export** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-remote-access-logs-export - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["secureConnect", "configure", "remoteAccessLogsExports"], - "operation": "getOrganizationSecureConnectRemoteAccessLogsExport", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/remoteAccessLogsExports/{id}" - - return self._session.get(metadata, resource) - - def getOrganizationSecureConnectSites(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List sites in this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-sites - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - search (string): If provided, filters results by search string - - enrolledState (string): Filter results by sites that have already been enrolled or can be enrolled. Acceptable values are 'enrolled' or 'enrollable - """ - - kwargs.update(locals()) - - if "enrolledState" in kwargs: - options = ["enrollable", "enrolled"] - assert kwargs["enrolledState"] in options, ( - f'''"enrolledState" cannot be "{kwargs["enrolledState"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["secureConnect", "configure", "sites"], - "operation": "getOrganizationSecureConnectSites", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/sites" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "search", - "enrolledState", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSecureConnectSites: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSecureConnectSite(self, organizationId: str, **kwargs): - """ - **Enroll sites in this organization to Secure Connect** - https://developer.cisco.com/meraki/api-v1/#!create-organization-secure-connect-site - - - organizationId (string): Organization ID - - enrollments (array): List of Meraki SD-WAN sites with the associated regions to be enrolled. - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "sites"], - "operation": "createOrganizationSecureConnectSite", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/sites" - - body_params = [ - "enrollments", - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationSecureConnectSite: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def deleteOrganizationSecureConnectSites(self, organizationId: str, **kwargs): - """ - **Detach given sites from Secure Connect** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-secure-connect-sites - - - organizationId (string): Organization ID - - sites (array): List of site IDs to detach - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "sites"], - "operation": "deleteOrganizationSecureConnectSites", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/sites" - - return self._session.delete(metadata, resource) diff --git a/meraki/aio/api/sensor.py b/meraki/aio/api/sensor.py index 9e18e0d..115465f 100644 --- a/meraki/aio/api/sensor.py +++ b/meraki/aio/api/sensor.py @@ -74,10 +74,9 @@ def createDeviceSensorCommand(self, serial: str, operation: str, **kwargs): - serial (string): Serial - operation (string): Operation to run on the sensor. 'enableDownstreamPower', 'disableDownstreamPower', and 'cycleDownstreamPower' turn power on/off to the device that is connected downstream of an MT40 power monitor. 'refreshData' causes an MT15 or MT40 device to upload its latest readings so that they are immediately available in the Dashboard API. - - arguments (array): Additional options to provide to commands run on the sensor, each with a corresponding 'name' and 'value'. """ - kwargs.update(locals()) + kwargs = locals() if "operation" in kwargs: options = ["cycleDownstreamPower", "disableDownstreamPower", "enableDownstreamPower", "refreshData"] @@ -93,7 +92,6 @@ def createDeviceSensorCommand(self, serial: str, operation: str, **kwargs): resource = f"/devices/{serial}/sensor/commands" body_params = [ - "arguments", "operation", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -458,103 +456,6 @@ def getNetworkSensorRelationships(self, networkId: str): return self._session.get(metadata, resource) - def getNetworkSensorSchedules(self, networkId: str): - """ - **Returns a list of all sensor schedules.** - https://developer.cisco.com/meraki/api-v1/#!get-network-sensor-schedules - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["sensor", "configure", "schedules"], - "operation": "getNetworkSensorSchedules", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sensor/schedules" - - return self._session.get(metadata, resource) - - def getOrganizationSensorAlerts(self, organizationId: str, networkIds: list, total_pages=1, direction="next", **kwargs): - """ - **Return a list of sensor alert events** - https://developer.cisco.com/meraki/api-v1/#!get-organization-sensor-alerts - - - organizationId (string): Organization ID - - networkIds (array): Filters alerts by network. For now, this must be a single network ID. - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 365 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 365 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 365 days. The default is 365 days. - - sensorSerial (string): Filters alerts to those triggered by this sensor. - - triggerMetric (string): Filters alerts to those triggered by this metric. - """ - - kwargs.update(locals()) - - if "triggerMetric" in kwargs: - options = [ - "apparentPower", - "co2", - "current", - "door", - "frequency", - "humidity", - "indoorAirQuality", - "noise", - "pm25", - "powerFactor", - "realPower", - "temperature", - "tvoc", - "upstreamPower", - "voltage", - "water", - ] - assert kwargs["triggerMetric"] in options, ( - f'''"triggerMetric" cannot be "{kwargs["triggerMetric"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["sensor", "monitor", "alerts"], - "operation": "getOrganizationSensorAlerts", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sensor/alerts" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "sensorSerial", - "networkIds", - "triggerMetric", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSensorAlerts: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationSensorGatewaysConnectionsLatest(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Returns latest sensor-gateway connectivity data.** @@ -663,72 +564,6 @@ def getOrganizationSensorReadingsHistory(self, organizationId: str, total_pages= return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationSensorReadingsHistoryByInterval(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return all reported readings from sensors in a given timespan, summarized as a series of intervals, sorted by interval start time in descending order** - https://developer.cisco.com/meraki/api-v1/#!get-organization-sensor-readings-history-by-interval - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days, 11 hours, 38 minutes, and 24 seconds from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 730 days, 11 hours, 38 minutes, and 24 seconds after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 730 days, 11 hours, 38 minutes, and 24 seconds. The default is 7 days. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 15, 120, 300, 900, 3600, 14400, 86400, 604800. The default is 86400. Interval is calculated if time params are provided. - - networkIds (array): Optional parameter to filter readings by network. - - serials (array): Optional parameter to filter readings by sensor. - - metrics (array): Types of sensor readings to retrieve. If no metrics are supplied, all available types of readings will be retrieved. - - models (array): Optional parameter to filter readings by one or more models. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["sensor", "monitor", "readings", "history", "byInterval"], - "operation": "getOrganizationSensorReadingsHistoryByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sensor/readings/history/byInterval" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - "networkIds", - "serials", - "metrics", - "models", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "metrics", - "models", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSensorReadingsHistoryByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationSensorReadingsLatest(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Return the latest available reading for each metric from each sensor, sorted by sensor serial** diff --git a/meraki/aio/api/sm.py b/meraki/aio/api/sm.py index 263da77..26075e3 100644 --- a/meraki/aio/api/sm.py +++ b/meraki/aio/api/sm.py @@ -894,379 +894,6 @@ def getNetworkSmProfiles(self, networkId: str, **kwargs): return self._session.get(metadata, resource, params) - def getNetworkSmScripts(self, networkId: str): - """ - **List the scripts for this network** - https://developer.cisco.com/meraki/api-v1/#!get-network-sm-scripts - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["sm", "configure", "scripts"], - "operation": "getNetworkSmScripts", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sm/scripts" - - return self._session.get(metadata, resource) - - def createNetworkSmScript(self, networkId: str, name: str, platform: str, **kwargs): - """ - **Create a new script** - https://developer.cisco.com/meraki/api-v1/#!create-network-sm-script - - - networkId (string): Network ID - - name (string): Unique name to identify this script. - - platform (string): Platform that this script will run on. - - scope (string): The target scope of the script. (Either scope or targetGroupId must be present.) - - tags (array): The target tags of the script as an array of strings. Required if scope is one of withAny, withoutAny, withAll, withoutAll. - - targetGroupId (string): The tag target group ID that should be used to scope devices. Either scope or targetGroupId must be present. - - description (string): Description of this script. - - runAsUsername (string): Username that script should run as. - - externalSource (object): Properties for a script provided by a url instead of an upload - - upload (object): Properties for a script provided as an upload instead of a url - - schedule (object): When the script is intended to run - """ - - kwargs.update(locals()) - - if "platform" in kwargs and kwargs["platform"] is not None: - options = ["Windows", "macOS"] - assert kwargs["platform"] in options, ( - f'''"platform" cannot be "{kwargs["platform"]}", & must be set to one of: {options}''' - ) - if "scope" in kwargs: - options = ["all", "none", "withAll", "withAny", "withoutAll", "withoutAny"] - assert kwargs["scope"] in options, f'''"scope" cannot be "{kwargs["scope"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["sm", "configure", "scripts"], - "operation": "createNetworkSmScript", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sm/scripts" - - body_params = [ - "name", - "platform", - "scope", - "tags", - "targetGroupId", - "description", - "runAsUsername", - "externalSource", - "upload", - "schedule", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createNetworkSmScript: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def createNetworkSmScriptsJob(self, networkId: str, scriptId: str, **kwargs): - """ - **Create a job that will run a script on a set of devices** - https://developer.cisco.com/meraki/api-v1/#!create-network-sm-scripts-job - - - networkId (string): Network ID - - scriptId (string): ID of script that should be run on the matching devices - - deviceIds (array): List of device IDs to run that should run this script - - deviceFilter (string): Create job on all devices in-scope or devices that have failed to run this script - """ - - kwargs.update(locals()) - - if "deviceFilter" in kwargs: - options = ["All", "Failed"] - assert kwargs["deviceFilter"] in options, ( - f'''"deviceFilter" cannot be "{kwargs["deviceFilter"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["sm", "configure", "scripts", "jobs"], - "operation": "createNetworkSmScriptsJob", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sm/scripts/jobs" - - body_params = [ - "scriptId", - "deviceIds", - "deviceFilter", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createNetworkSmScriptsJob: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getNetworkSmScriptsJobsStatusesLatestByScriptByInterval(self, networkId: str, **kwargs): - """ - **List the latest script job statuses by script and by interval** - https://developer.cisco.com/meraki/api-v1/#!get-network-sm-scripts-jobs-statuses-latest-by-script-by-interval - - - networkId (string): Network ID - - scriptIds (array): List of script IDs to fetch statuses - - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 180 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 180 days. The default is 1 day. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["sm", "configure", "scripts", "jobs", "statuses", "latest", "byScript", "byInterval"], - "operation": "getNetworkSmScriptsJobsStatusesLatestByScriptByInterval", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sm/scripts/jobs/statuses/latest/byScript/byInterval" - - query_params = [ - "scriptIds", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "scriptIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getNetworkSmScriptsJobsStatusesLatestByScriptByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getNetworkSmScriptsJobsStatusesLatestByScriptAndDevice( - self, networkId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List jobs for a given script and/or device** - https://developer.cisco.com/meraki/api-v1/#!get-network-sm-scripts-jobs-statuses-latest-by-script-and-device - - - networkId (string): Network ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - deviceId (string): Query parameter for filtering the list of script job statuses to those belonging to the specified deviceId. - - scriptId (string): Query parameter for filtering the list of script job statuses to those belonging to the specified script. - - inScopeOnly (boolean): If true, show only job statuses for scripts or devices that are in scope. This only applies when either deviceId or scriptId are given. - - status (string): Query parameter for filtering the list of job statuses to those having the specified status. - - sortOrder (string): Query parameter for specifying the direction of sorting to use for the given sortKey. This param is overridden if startingAfter or endingBefore is provided. - - sortKey (string): Query parameter to sort the script tasks by the value of the specified key. This param is overridden if startingAfter or endingBefore is provided. - - perPage (integer): Number of results to show per page. - - startingAfter (string): A statusId. Start the search cursor after the specified Status record. - - endingBefore (string): A statusId. Search backward with the cursor starting before the specified Status record. - """ - - kwargs.update(locals()) - - if "status" in kwargs: - options = [ - "cancelled", - "command failed", - "completed", - "created", - "enqueued", - "error", - "failed", - "pending", - "running", - "success", - "unknown", - ] - assert kwargs["status"] in options, ( - f'''"status" cannot be "{kwargs["status"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["ascending", "descending"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - if "sortKey" in kwargs: - options = ["completedAt", "createdAt", "enqueuedAt", "status", "updatedAt"] - assert kwargs["sortKey"] in options, ( - f'''"sortKey" cannot be "{kwargs["sortKey"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["sm", "configure", "scripts", "jobs", "statuses", "latest", "byScriptAndDevice"], - "operation": "getNetworkSmScriptsJobsStatusesLatestByScriptAndDevice", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sm/scripts/jobs/statuses/latest/byScriptAndDevice" - - query_params = [ - "deviceId", - "scriptId", - "inScopeOnly", - "status", - "sortOrder", - "sortKey", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getNetworkSmScriptsJobsStatusesLatestByScriptAndDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createNetworkSmScriptsUpload(self, networkId: str, size: str, **kwargs): - """ - **Creates an upload URL that can be used to upload a script** - https://developer.cisco.com/meraki/api-v1/#!create-network-sm-scripts-upload - - - networkId (string): Network ID - - size (string): Size of the file in bytes that will be uploaded. - """ - - kwargs = locals() - - metadata = { - "tags": ["sm", "configure", "scripts", "uploads"], - "operation": "createNetworkSmScriptsUpload", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sm/scripts/uploads" - - body_params = [ - "size", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createNetworkSmScriptsUpload: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getNetworkSmScript(self, networkId: str, scriptId: str): - """ - **Return a script** - https://developer.cisco.com/meraki/api-v1/#!get-network-sm-script - - - networkId (string): Network ID - - scriptId (string): Script ID - """ - - metadata = { - "tags": ["sm", "configure", "scripts"], - "operation": "getNetworkSmScript", - } - networkId = urllib.parse.quote(str(networkId), safe="") - scriptId = urllib.parse.quote(str(scriptId), safe="") - resource = f"/networks/{networkId}/sm/scripts/{scriptId}" - - return self._session.get(metadata, resource) - - def updateNetworkSmScript(self, networkId: str, scriptId: str, **kwargs): - """ - **Update an existing script** - https://developer.cisco.com/meraki/api-v1/#!update-network-sm-script - - - networkId (string): Network ID - - scriptId (string): Script ID - - name (string): Unique name to identify this script. - - platform (string): Platform that this script will run on. - - scope (string): The target scope of the script. (Either scope or targetGroupId must be present.) - - tags (array): The target tags of the script as an array of strings. Required if scope is one of withAny, withoutAny, withAll, withoutAll. - - targetGroupId (string): The tag target group ID that should be used to scope devices. Either scope or targetGroupId must be present. - - description (string): Description of this script. - - runAsUsername (string): Username that script should run as. - - externalSource (object): Properties for a script provided by a url instead of an upload - - upload (object): Properties for a script provided as an upload instead of a url - - schedule (object): When the script is intended to run - """ - - kwargs.update(locals()) - - if "platform" in kwargs and kwargs["platform"] is not None: - options = ["Windows", "macOS"] - assert kwargs["platform"] in options, ( - f'''"platform" cannot be "{kwargs["platform"]}", & must be set to one of: {options}''' - ) - if "scope" in kwargs: - options = ["all", "none", "withAll", "withAny", "withoutAll", "withoutAny"] - assert kwargs["scope"] in options, f'''"scope" cannot be "{kwargs["scope"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["sm", "configure", "scripts"], - "operation": "updateNetworkSmScript", - } - networkId = urllib.parse.quote(str(networkId), safe="") - scriptId = urllib.parse.quote(str(scriptId), safe="") - resource = f"/networks/{networkId}/sm/scripts/{scriptId}" - - body_params = [ - "name", - "platform", - "scope", - "tags", - "targetGroupId", - "description", - "runAsUsername", - "externalSource", - "upload", - "schedule", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkSmScript: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteNetworkSmScript(self, networkId: str, scriptId: str): - """ - **Delete a script** - https://developer.cisco.com/meraki/api-v1/#!delete-network-sm-script - - - networkId (string): Network ID - - scriptId (string): Script ID - """ - - metadata = { - "tags": ["sm", "configure", "scripts"], - "operation": "deleteNetworkSmScript", - } - networkId = urllib.parse.quote(str(networkId), safe="") - scriptId = urllib.parse.quote(str(scriptId), safe="") - resource = f"/networks/{networkId}/sm/scripts/{scriptId}" - - return self._session.delete(metadata, resource) - def getNetworkSmTargetGroups(self, networkId: str, **kwargs): """ **List the target groups in this network** @@ -1769,187 +1396,6 @@ def getOrganizationSmApnsCert(self, organizationId: str): return self._session.get(metadata, resource) - def createOrganizationSmAppleCloudEnrollmentSyncJob(self, organizationId: str, **kwargs): - """ - **Enqueue a sync job for an ADE account** - https://developer.cisco.com/meraki/api-v1/#!create-organization-sm-apple-cloud-enrollment-sync-job - - - organizationId (string): Organization ID - - adeAccountId (string): ADE Account ID - - fullSync (boolean): Whether or not job is full sync (defaults to full sync) - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["sm", "configure", "apple", "cloudEnrollment", "syncJobs"], - "operation": "createOrganizationSmAppleCloudEnrollmentSyncJob", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sm/apple/cloudEnrollment/syncJobs" - - body_params = [ - "adeAccountId", - "fullSync", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSmAppleCloudEnrollmentSyncJob: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSmAppleCloudEnrollmentSyncJob(self, organizationId: str, syncJobId: str): - """ - **Retrieve the status of an ADE sync job** - https://developer.cisco.com/meraki/api-v1/#!get-organization-sm-apple-cloud-enrollment-sync-job - - - organizationId (string): Organization ID - - syncJobId (string): Sync job ID - """ - - metadata = { - "tags": ["sm", "configure", "apple", "cloudEnrollment", "syncJobs"], - "operation": "getOrganizationSmAppleCloudEnrollmentSyncJob", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - syncJobId = urllib.parse.quote(str(syncJobId), safe="") - resource = f"/organizations/{organizationId}/sm/apple/cloudEnrollment/syncJobs/{syncJobId}" - - return self._session.get(metadata, resource) - - def createOrganizationSmBulkEnrollmentToken(self, organizationId: str, networkId: str, expiresAt: str, **kwargs): - """ - **Create a PccBulkEnrollmentToken** - https://developer.cisco.com/meraki/api-v1/#!create-organization-sm-bulk-enrollment-token - - - organizationId (string): Organization ID - - networkId (string): The id of the associated node_group. - - expiresAt (string): The expiration date. - """ - - kwargs = locals() - - metadata = { - "tags": ["sm", "configure", "bulkEnrollment", "token"], - "operation": "createOrganizationSmBulkEnrollmentToken", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sm/bulkEnrollment/token" - - body_params = [ - "networkId", - "expiresAt", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSmBulkEnrollmentToken: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSmBulkEnrollmentToken(self, organizationId: str, tokenId: str): - """ - **Return a BulkEnrollmentToken** - https://developer.cisco.com/meraki/api-v1/#!get-organization-sm-bulk-enrollment-token - - - organizationId (string): Organization ID - - tokenId (string): Token ID - """ - - metadata = { - "tags": ["sm", "configure", "bulkEnrollment", "token"], - "operation": "getOrganizationSmBulkEnrollmentToken", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - tokenId = urllib.parse.quote(str(tokenId), safe="") - resource = f"/organizations/{organizationId}/sm/bulkEnrollment/token/{tokenId}" - - return self._session.get(metadata, resource) - - def updateOrganizationSmBulkEnrollmentToken(self, organizationId: str, tokenId: str, **kwargs): - """ - **Update a PccBulkEnrollmentToken** - https://developer.cisco.com/meraki/api-v1/#!update-organization-sm-bulk-enrollment-token - - - organizationId (string): Organization ID - - tokenId (string): Token ID - - networkId (string): The id of the associated node_group. - - expiresAt (string): The expiration date. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["sm", "configure", "bulkEnrollment", "token"], - "operation": "updateOrganizationSmBulkEnrollmentToken", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - tokenId = urllib.parse.quote(str(tokenId), safe="") - resource = f"/organizations/{organizationId}/sm/bulkEnrollment/token/{tokenId}" - - body_params = [ - "networkId", - "expiresAt", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSmBulkEnrollmentToken: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSmBulkEnrollmentToken(self, organizationId: str, tokenId: str): - """ - **Delete a PccBulkEnrollmentToken** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-sm-bulk-enrollment-token - - - organizationId (string): Organization ID - - tokenId (string): Token ID - """ - - metadata = { - "tags": ["sm", "configure", "bulkEnrollment", "token"], - "operation": "deleteOrganizationSmBulkEnrollmentToken", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - tokenId = urllib.parse.quote(str(tokenId), safe="") - resource = f"/organizations/{organizationId}/sm/bulkEnrollment/token/{tokenId}" - - return self._session.delete(metadata, resource) - - def getOrganizationSmBulkEnrollmentTokens(self, organizationId: str): - """ - **List all BulkEnrollmentTokens for an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-sm-bulk-enrollment-tokens - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["sm", "configure", "bulkEnrollment", "tokens"], - "operation": "getOrganizationSmBulkEnrollmentTokens", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sm/bulkEnrollment/tokens" - - return self._session.get(metadata, resource) - def updateOrganizationSmSentryPoliciesAssignments(self, organizationId: str, items: list, **kwargs): """ **Update an Organizations Sentry Policies using the provided list** diff --git a/meraki/aio/api/support.py b/meraki/aio/api/support.py deleted file mode 100644 index 721ee80..0000000 --- a/meraki/aio/api/support.py +++ /dev/null @@ -1,24 +0,0 @@ -import urllib - - -class AsyncSupport: - def __init__(self, session): - super().__init__() - self._session = session - - def getOrganizationSupportSalesRepresentatives(self, organizationId: str): - """ - **Returns the organization's sales representatives** - https://developer.cisco.com/meraki/api-v1/#!get-organization-support-sales-representatives - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["support", "monitor", "salesRepresentatives"], - "operation": "getOrganizationSupportSalesRepresentatives", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/support/salesRepresentatives" - - return self._session.get(metadata, resource) diff --git a/meraki/aio/api/switch.py b/meraki/aio/api/switch.py index e443672..21dcc76 100644 --- a/meraki/aio/api/switch.py +++ b/meraki/aio/api/switch.py @@ -6,17 +6,14 @@ def __init__(self, session): super().__init__() self._session = session - def getDeviceSwitchPorts(self, serial: str, **kwargs): + def getDeviceSwitchPorts(self, serial: str): """ **List the switch ports for a switch** https://developer.cisco.com/meraki/api-v1/#!get-device-switch-ports - serial (string): Serial - - hideDefaultPorts (boolean): Optional flag that, when true, will hide modular switchports that may not be connected to the device at the moment """ - kwargs.update(locals()) - metadata = { "tags": ["switch", "configure", "ports"], "operation": "getDeviceSwitchPorts", @@ -24,18 +21,7 @@ def getDeviceSwitchPorts(self, serial: str, **kwargs): serial = urllib.parse.quote(str(serial), safe="") resource = f"/devices/{serial}/switch/ports" - query_params = [ - "hideDefaultPorts", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getDeviceSwitchPorts: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) + return self._session.get(metadata, resource) def cycleDeviceSwitchPorts(self, serial: str, ports: list, **kwargs): """ @@ -68,46 +54,6 @@ def cycleDeviceSwitchPorts(self, serial: str, ports: list, **kwargs): return self._session.post(metadata, resource, payload) - def updateDeviceSwitchPortsMirror(self, serial: str, source: dict, destination: dict, **kwargs): - """ - **Update a port mirror** - https://developer.cisco.com/meraki/api-v1/#!update-device-switch-ports-mirror - - - serial (string): The switch identifier - - source (object): Source ports mirror configuration - - destination (object): Destination port mirror configuration - - tags (array): Port mirror tags - - role (string): Switch role can be source or destination - - comment (string): My pretty comment - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "mirror"], - "operation": "updateDeviceSwitchPortsMirror", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/switch/ports/mirror" - - body_params = [ - "serial", - "source", - "destination", - "tags", - "role", - "comment", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateDeviceSwitchPortsMirror: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def getDeviceSwitchPortsStatuses(self, serial: str, **kwargs): """ **Return the status for all the ports of a switch** @@ -208,7 +154,6 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - vlan (integer): The VLAN of the switch port. For a trunk port, this is the native VLAN. A null value will clear the value set for trunk ports. - voiceVlan (integer): The voice VLAN of the switch port. Only applicable to access ports. - allowedVlans (string): The VLANs allowed on the switch port. Only applicable to trunk ports. - - activeVlans (string): The VLANs that are active on the switch port. Only applicable to trunk ports. - isolationEnabled (boolean): The isolation status of the switch port. - rstpEnabled (boolean): The rapid spanning tree protocol status. - stpGuard (string): The state of the STP guard ('disabled', 'root guard', 'bpdu guard' or 'loop guard'). @@ -269,7 +214,6 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): "vlan", "voiceVlan", "allowedVlans", - "activeVlans", "isolationEnabled", "rstpEnabled", "stpGuard", @@ -359,12 +303,6 @@ def createDeviceSwitchRoutingInterface(self, serial: str, name: str, **kwargs): - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. - vlanId (integer): The VLAN this L3 interface is on. VLAN must be between 1 and 4094. - defaultGateway (string): The next hop for any traffic that isn't going to a directly connected subnet or over a static route. This IP address must exist in a subnet with a L3 interface. Required if this is the first IPv4 interface. - - isSwitchDefaultGateway (boolean): When true, the switch uses the IPv4 uplink gateway as its IPv4 default gateway. This can only be set if the interface is designated as the IPv4 uplink and the switch is running IOS XE version >= 17.18.3. - - uplinkV4 (boolean): When true, this interface is used as static IPv4 uplink. - - candidateUplinkV4 (boolean): When true, this interface is a UAC candidate for IPv4 Uplink. - - uplinkV6 (boolean): When true, this interface is used as static IPv6 uplink. - - staticV4Dns1 (string): Primary IPv4 DNS server address - - staticV4Dns2 (string): Secondary IPv4 DNS server address - ospfSettings (object): The OSPF routing settings of the interface. - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher @@ -399,12 +337,6 @@ def createDeviceSwitchRoutingInterface(self, serial: str, name: str, **kwargs): "multicastRouting", "vlanId", "defaultGateway", - "isSwitchDefaultGateway", - "uplinkV4", - "candidateUplinkV4", - "uplinkV6", - "staticV4Dns1", - "staticV4Dns2", "ospfSettings", "ipv6", "vrf", @@ -454,12 +386,6 @@ def updateDeviceSwitchRoutingInterface(self, serial: str, interfaceId: str, **kw - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. - vlanId (integer): The VLAN this L3 interface is on. VLAN must be between 1 and 4094. - defaultGateway (string): The next hop for any traffic that isn't going to a directly connected subnet or over a static route. This IP address must exist in a subnet with a L3 interface. Required if this is the first IPv4 interface. - - isSwitchDefaultGateway (boolean): When true, the switch uses the IPv4 uplink gateway as its IPv4 default gateway. This can only be set if the interface is designated as the IPv4 uplink and the switch is running IOS XE version >= 17.18.3. - - uplinkV4 (boolean): When true, this interface is used as static IPv4 uplink. - - candidateUplinkV4 (boolean): When true, this interface is a UAC candidate for IPv4 Uplink. - - uplinkV6 (boolean): When true, this interface is used as static IPv6 uplink. - - staticV4Dns1 (string): Primary IPv4 DNS server address - - staticV4Dns2 (string): Secondary IPv4 DNS server address - ospfSettings (object): The OSPF routing settings of the interface. - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher @@ -491,12 +417,6 @@ def updateDeviceSwitchRoutingInterface(self, serial: str, interfaceId: str, **kw "multicastRouting", "vlanId", "defaultGateway", - "isSwitchDefaultGateway", - "uplinkV4", - "candidateUplinkV4", - "uplinkV6", - "staticV4Dns1", - "staticV4Dns2", "ospfSettings", "ipv6", "vrf", @@ -1468,17 +1388,14 @@ def updateNetworkSwitchDscpToCosMappings(self, networkId: str, mappings: list, * return self._session.put(metadata, resource, payload) - def getNetworkSwitchLinkAggregations(self, networkId: str, **kwargs): + def getNetworkSwitchLinkAggregations(self, networkId: str): """ **List link aggregation groups** https://developer.cisco.com/meraki/api-v1/#!get-network-switch-link-aggregations - networkId (string): Network ID - - serials (array): Optional parameter to filter by device serial numbers. Matches multiple exact serials. """ - kwargs.update(locals()) - metadata = { "tags": ["switch", "configure", "linkAggregations"], "operation": "getNetworkSwitchLinkAggregations", @@ -1486,26 +1403,7 @@ def getNetworkSwitchLinkAggregations(self, networkId: str, **kwargs): networkId = urllib.parse.quote(str(networkId), safe="") resource = f"/networks/{networkId}/switch/linkAggregations" - query_params = [ - "serials", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getNetworkSwitchLinkAggregations: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) + return self._session.get(metadata, resource) def createNetworkSwitchLinkAggregation(self, networkId: str, **kwargs): """ @@ -1515,7 +1413,6 @@ def createNetworkSwitchLinkAggregation(self, networkId: str, **kwargs): - networkId (string): Network ID - switchPorts (array): Array of switch or stack ports for creating aggregation group. Minimum 2 and maximum 8 ports are supported. - switchProfilePorts (array): Array of switch profile ports for creating aggregation group. Minimum 2 and maximum 8 ports are supported. - - esiMhPairId (string): ESI-MH pair ID. Required when creating a downstream aggregation across ESI-MH pair member switches. """ kwargs.update(locals()) @@ -1530,7 +1427,6 @@ def createNetworkSwitchLinkAggregation(self, networkId: str, **kwargs): body_params = [ "switchPorts", "switchProfilePorts", - "esiMhPairId", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1756,126 +1652,6 @@ def updateNetworkSwitchPortSchedule(self, networkId: str, portScheduleId: str, * return self._session.put(metadata, resource, payload) - def getNetworkSwitchPortsProfiles(self, networkId: str): - """ - **List the port profiles in a network** - https://developer.cisco.com/meraki/api-v1/#!get-network-switch-ports-profiles - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "getNetworkSwitchPortsProfiles", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/switch/ports/profiles" - - return self._session.get(metadata, resource) - - def createNetworkSwitchPortsProfile(self, networkId: str, **kwargs): - """ - **Create a port profile in a network** - https://developer.cisco.com/meraki/api-v1/#!create-network-switch-ports-profile - - - networkId (string): Network ID - - name (string): The name of the profile. - - description (string): Text describing the profile. - - tags (array): Space-seperated list of tags - - defaultRadiusProfileName (string): When present, the default RADIUS attribute value for RADIUS-based port profile application - - authentication (object): Authentication settings for RADIUS-based port profile application. - - port (object): Configuration settings for port profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "createNetworkSwitchPortsProfile", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/switch/ports/profiles" - - body_params = [ - "name", - "description", - "tags", - "defaultRadiusProfileName", - "authentication", - "port", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createNetworkSwitchPortsProfile: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def updateNetworkSwitchPortsProfile(self, networkId: str, id: str, **kwargs): - """ - **Update a port profile in a network** - https://developer.cisco.com/meraki/api-v1/#!update-network-switch-ports-profile - - - networkId (string): Network ID - - id (string): ID - - name (string): The name of the profile. - - description (string): Text describing the profile. - - tags (array): Space-seperated list of tags - - defaultRadiusProfileName (string): When present, the default RADIUS attribute value for RADIUS-based port profile application - - authentication (object): Authentication settings for RADIUS-based port profile application. - - port (object): Configuration settings for port profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "updateNetworkSwitchPortsProfile", - } - networkId = urllib.parse.quote(str(networkId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/networks/{networkId}/switch/ports/profiles/{id}" - - body_params = [ - "name", - "description", - "tags", - "defaultRadiusProfileName", - "authentication", - "port", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkSwitchPortsProfile: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteNetworkSwitchPortsProfile(self, networkId: str, id: str): - """ - **Delete a port profile from a network** - https://developer.cisco.com/meraki/api-v1/#!delete-network-switch-ports-profile - - - networkId (string): Network ID - - id (string): ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "deleteNetworkSwitchPortsProfile", - } - networkId = urllib.parse.quote(str(networkId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/networks/{networkId}/switch/ports/profiles/{id}" - - return self._session.delete(metadata, resource) - def getNetworkSwitchQosRules(self, networkId: str): """ **List quality of service rules** @@ -2079,64 +1855,6 @@ def updateNetworkSwitchQosRule(self, networkId: str, qosRuleId: str, **kwargs): return self._session.put(metadata, resource, payload) - def getNetworkSwitchRaGuardPolicy(self, networkId: str): - """ - **Return RA Guard settings** - https://developer.cisco.com/meraki/api-v1/#!get-network-switch-ra-guard-policy - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["switch", "configure", "raGuardPolicy"], - "operation": "getNetworkSwitchRaGuardPolicy", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/switch/raGuardPolicy" - - return self._session.get(metadata, resource) - - def updateNetworkSwitchRaGuardPolicy(self, networkId: str, **kwargs): - """ - **Update RA Guard settings** - https://developer.cisco.com/meraki/api-v1/#!update-network-switch-ra-guard-policy - - - networkId (string): Network ID - - defaultPolicy (string): New Router Advertisers are 'allowed' or 'blocked'. Default value is 'allowed'. - - allowedServers (array): List the MAC addresses of Router Advertisers to permit on the network when defaultPolicy is set to blocked. - - blockedServers (array): List the MAC addresses of Router Advertisers to block on the network when defaultPolicy is set to allowed. - """ - - kwargs.update(locals()) - - if "defaultPolicy" in kwargs: - options = ["allowed", "blocked"] - assert kwargs["defaultPolicy"] in options, ( - f'''"defaultPolicy" cannot be "{kwargs["defaultPolicy"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["switch", "configure", "raGuardPolicy"], - "operation": "updateNetworkSwitchRaGuardPolicy", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/switch/raGuardPolicy" - - body_params = [ - "defaultPolicy", - "allowedServers", - "blockedServers", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkSwitchRaGuardPolicy: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def getNetworkSwitchRoutingMulticast(self, networkId: str): """ **Return multicast settings for a network** @@ -2457,45 +2175,6 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): return self._session.put(metadata, resource, payload) - def updateNetworkSwitchSpanningTree(self, networkId: str, **kwargs): - """ - **Updates Spanning Tree configuration** - https://developer.cisco.com/meraki/api-v1/#!update-network-switch-spanning-tree - - - networkId (string): Network ID - - enabled (boolean): Network-level spanning Tree enable - - mode (string): Catalyst Spanning Tree Protocol mode (mst, rpvst+) - - priorities (array): Spanning tree priority for switches/stacks or switch templates. An empty array will clear the priority settings. - """ - - kwargs.update(locals()) - - if "mode" in kwargs: - options = ["mst", "rpvst+"] - assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["switch", "configure", "spanningTree"], - "operation": "updateNetworkSwitchSpanningTree", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/switch/spanningTree" - - body_params = [ - "enabled", - "mode", - "priorities", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkSwitchSpanningTree: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def getNetworkSwitchStacks(self, networkId: str): """ **List the switch stacks in a network** @@ -2652,49 +2331,6 @@ def addNetworkSwitchStack(self, networkId: str, switchStackId: str, serial: str, return self._session.post(metadata, resource, payload) - def updateNetworkSwitchStackPortsMirror( - self, networkId: str, switchStackId: str, source: dict, destination: dict, **kwargs - ): - """ - **Update switch port mirrors for switch stacks** - https://developer.cisco.com/meraki/api-v1/#!update-network-switch-stack-ports-mirror - - - networkId (string): Network ID - - switchStackId (string): Switch stack ID - - source (object): Source port details - - destination (object): Destination port Details - - tags (array): Port mirror tags - - role (string): Switch role can be source or destination - - comment (string): My pretty comment - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "stacks", "ports", "mirror"], - "operation": "updateNetworkSwitchStackPortsMirror", - } - networkId = urllib.parse.quote(str(networkId), safe="") - switchStackId = urllib.parse.quote(str(switchStackId), safe="") - resource = f"/networks/{networkId}/switch/stacks/{switchStackId}/ports/mirror" - - body_params = [ - "source", - "destination", - "tags", - "role", - "comment", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkSwitchStackPortsMirror: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def removeNetworkSwitchStack(self, networkId: str, switchStackId: str, serial: str, **kwargs): """ **Remove a switch from a stack** @@ -2790,12 +2426,6 @@ def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. - vlanId (integer): The VLAN this L3 interface is on. VLAN must be between 1 and 4094. - defaultGateway (string): The next hop for any traffic that isn't going to a directly connected subnet or over a static route. This IP address must exist in a subnet with a L3 interface. Required if this is the first IPv4 interface. - - isSwitchDefaultGateway (boolean): When true, the switch uses the IPv4 uplink gateway as its IPv4 default gateway. This can only be set if the interface is designated as the IPv4 uplink and the switch is running IOS XE version >= 17.18.3. - - uplinkV4 (boolean): When true, this interface is used as static IPv4 uplink. - - candidateUplinkV4 (boolean): When true, this interface is a UAC candidate for IPv4 Uplink. - - uplinkV6 (boolean): When true, this interface is used as static IPv6 uplink. - - staticV4Dns1 (string): Primary IPv4 DNS server address - - staticV4Dns2 (string): Secondary IPv4 DNS server address - ospfSettings (object): The OSPF routing settings of the interface. - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher @@ -2831,12 +2461,6 @@ def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId "multicastRouting", "vlanId", "defaultGateway", - "isSwitchDefaultGateway", - "uplinkV4", - "candidateUplinkV4", - "uplinkV6", - "staticV4Dns1", - "staticV4Dns2", "ospfSettings", "ipv6", "vrf", @@ -2891,12 +2515,6 @@ def updateNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. - vlanId (integer): The VLAN this L3 interface is on. VLAN must be between 1 and 4094. - defaultGateway (string): The next hop for any traffic that isn't going to a directly connected subnet or over a static route. This IP address must exist in a subnet with a L3 interface. Required if this is the first IPv4 interface. - - isSwitchDefaultGateway (boolean): When true, the switch uses the IPv4 uplink gateway as its IPv4 default gateway. This can only be set if the interface is designated as the IPv4 uplink and the switch is running IOS XE version >= 17.18.3. - - uplinkV4 (boolean): When true, this interface is used as static IPv4 uplink. - - candidateUplinkV4 (boolean): When true, this interface is a UAC candidate for IPv4 Uplink. - - uplinkV6 (boolean): When true, this interface is used as static IPv6 uplink. - - staticV4Dns1 (string): Primary IPv4 DNS server address - - staticV4Dns2 (string): Secondary IPv4 DNS server address - ospfSettings (object): The OSPF routing settings of the interface. - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher @@ -2929,12 +2547,6 @@ def updateNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId "multicastRouting", "vlanId", "defaultGateway", - "isSwitchDefaultGateway", - "uplinkV4", - "candidateUplinkV4", - "uplinkV6", - "staticV4Dns1", - "staticV4Dns2", "ospfSettings", "ipv6", "vrf", @@ -3334,83 +2946,29 @@ def updateNetworkSwitchStp(self, networkId: str, **kwargs): return self._session.put(metadata, resource, payload) - def getOrganizationConfigTemplatesSwitchProfilesPortsMirrorsBySwitchProfile( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationConfigTemplateSwitchProfiles(self, organizationId: str, configTemplateId: str): """ - **list the port mirror configurations in an organization by switch profile** - https://developer.cisco.com/meraki/api-v1/#!get-organization-config-templates-switch-profiles-ports-mirrors-by-switch-profile + **List the switch templates for your switch template configuration** + https://developer.cisco.com/meraki/api-v1/#!get-organization-config-template-switch-profiles - 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 - - configTemplateIds (array): Optional parameter to filter the result set by the included set of config template IDs - - ids (array): A list of switch profile ids. The returned profiles will be filtered to only include these ids. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. - - 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. + - configTemplateId (string): Config template ID """ - kwargs.update(locals()) - metadata = { - "tags": ["switch", "configure", "configTemplates", "profiles", "ports", "mirrors", "bySwitchProfile"], - "operation": "getOrganizationConfigTemplatesSwitchProfilesPortsMirrorsBySwitchProfile", + "tags": ["switch", "configure", "configTemplates", "profiles"], + "operation": "getOrganizationConfigTemplateSwitchProfiles", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/configTemplates/switch/profiles/ports/mirrors/bySwitchProfile" + configTemplateId = urllib.parse.quote(str(configTemplateId), safe="") + resource = f"/organizations/{organizationId}/configTemplates/{configTemplateId}/switch/profiles" - query_params = [ - "configTemplateIds", - "ids", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + return self._session.get(metadata, resource) - array_params = [ - "configTemplateIds", - "ids", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationConfigTemplatesSwitchProfilesPortsMirrorsBySwitchProfile: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationConfigTemplateSwitchProfiles(self, organizationId: str, configTemplateId: str): - """ - **List the switch templates for your switch template configuration** - https://developer.cisco.com/meraki/api-v1/#!get-organization-config-template-switch-profiles - - - organizationId (string): Organization ID - - configTemplateId (string): Config template ID - """ - - metadata = { - "tags": ["switch", "configure", "configTemplates", "profiles"], - "operation": "getOrganizationConfigTemplateSwitchProfiles", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - configTemplateId = urllib.parse.quote(str(configTemplateId), safe="") - resource = f"/organizations/{organizationId}/configTemplates/{configTemplateId}/switch/profiles" - - return self._session.get(metadata, resource) - - def getOrganizationConfigTemplateSwitchProfilePorts(self, organizationId: str, configTemplateId: str, profileId: str): - """ - **Return all the ports of a switch template** - https://developer.cisco.com/meraki/api-v1/#!get-organization-config-template-switch-profile-ports + def getOrganizationConfigTemplateSwitchProfilePorts(self, organizationId: str, configTemplateId: str, profileId: str): + """ + **Return all the ports of a switch template** + https://developer.cisco.com/meraki/api-v1/#!get-organization-config-template-switch-profile-ports - organizationId (string): Organization ID - configTemplateId (string): Config template ID @@ -3428,55 +2986,6 @@ def getOrganizationConfigTemplateSwitchProfilePorts(self, organizationId: str, c return self._session.get(metadata, resource) - def updateOrganizationConfigTemplateSwitchProfilePortsMirror( - self, organizationId: str, configTemplateId: str, profileId: str, source: dict, destination: dict, **kwargs - ): - """ - **Update a port mirror** - https://developer.cisco.com/meraki/api-v1/#!update-organization-config-template-switch-profile-ports-mirror - - - organizationId (string): Organization ID - - configTemplateId (string): Config template ID - - profileId (string): Profile ID - - source (object): Source ports mirror configuration - - destination (object): Destination port mirror configuration - - tags (array): Port mirror tags - - role (string): Switch role can be source or destination - - comment (string): My pretty comment - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "configTemplates", "profiles", "ports", "mirror"], - "operation": "updateOrganizationConfigTemplateSwitchProfilePortsMirror", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - configTemplateId = urllib.parse.quote(str(configTemplateId), safe="") - profileId = urllib.parse.quote(str(profileId), safe="") - resource = ( - f"/organizations/{organizationId}/configTemplates/{configTemplateId}/switch/profiles/{profileId}/ports/mirror" - ) - - body_params = [ - "source", - "destination", - "tags", - "role", - "comment", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationConfigTemplateSwitchProfilePortsMirror: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - def getOrganizationConfigTemplateSwitchProfilePort( self, organizationId: str, configTemplateId: str, profileId: str, portId: str ): @@ -3523,7 +3032,6 @@ def updateOrganizationConfigTemplateSwitchProfilePort( - vlan (integer): The VLAN of the switch template port. For a trunk port, this is the native VLAN. A null value will clear the value set for trunk ports. - voiceVlan (integer): The voice VLAN of the switch template port. Only applicable to access ports. - allowedVlans (string): The VLANs allowed on the switch template port. Only applicable to trunk ports. - - activeVlans (string): The VLANs that are active on the switch template port. Only applicable to trunk ports. - isolationEnabled (boolean): The isolation status of the switch template port. - rstpEnabled (boolean): The rapid spanning tree protocol status. - stpGuard (string): The state of the STP guard ('disabled', 'root guard', 'bpdu guard' or 'loop guard'). @@ -3586,7 +3094,6 @@ def updateOrganizationConfigTemplateSwitchProfilePort( "vlan", "voiceVlan", "allowedVlans", - "activeVlans", "isolationEnabled", "rstpEnabled", "stpGuard", @@ -3656,37 +3163,89 @@ def getOrganizationSummarySwitchPowerHistory(self, organizationId: str, **kwargs return self._session.get(metadata, resource, params) - def getOrganizationSwitchAlertsPoeByDevice(self, organizationId: str, networkIds: list, **kwargs): + def cloneOrganizationSwitchDevices(self, organizationId: str, sourceSerial: str, targetSerials: list, **kwargs): + """ + **Clone port-level and some switch-level configuration settings from a source switch to one or more target switches** + https://developer.cisco.com/meraki/api-v1/#!clone-organization-switch-devices + + - organizationId (string): Organization ID + - sourceSerial (string): Serial number of the source switch (must be on a network not bound to a template) + - targetSerials (array): Array of serial numbers of one or more target switches (must be on a network not bound to a template) + """ + + kwargs = locals() + + metadata = { + "tags": ["switch", "configure", "devices"], + "operation": "cloneOrganizationSwitchDevices", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/switch/devices/clone" + + body_params = [ + "sourceSerial", + "targetSerials", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"cloneOrganizationSwitchDevices: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) + + def getOrganizationSwitchPortsBySwitch(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Gets all poe related alerts over a given network and returns information by device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-alerts-poe-by-device + **List the switchports in an organization by switch** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-by-switch - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. + - 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 - 50. 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. + - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. + - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. + - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. + - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. + - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. + - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. + - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. + - serials (array): Optional parameter to filter items to switches that have one of the provided serials. """ kwargs.update(locals()) metadata = { - "tags": ["switch", "monitor", "alerts", "poe", "byDevice"], - "operation": "getOrganizationSwitchAlertsPoeByDevice", + "tags": ["switch", "configure", "ports", "bySwitch"], + "operation": "getOrganizationSwitchPortsBySwitch", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/alerts/poe/byDevice" + resource = f"/organizations/{organizationId}/switch/ports/bySwitch" query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "configurationUpdatedAfter", + "mac", + "macs", + "name", "networkIds", - "t0", - "t1", - "timespan", + "portProfileIds", + "serial", + "serials", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ + "macs", "networkIds", + "portProfileIds", + "serials", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -3697,60 +3256,66 @@ def getOrganizationSwitchAlertsPoeByDevice(self, organizationId: str, networkIds all_params = query_params + array_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchAlertsPoeByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def aurora2OrganizationSwitchSwitchTemplates(self, organizationId: str): - """ - **List switch templates running IOS XE Catalyst firmware.** - https://developer.cisco.com/meraki/api-v1/#!aurora-2-organization-switch-switch-templates - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["switch", "configure"], - "operation": "aurora2OrganizationSwitchSwitchTemplates", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/aurora2SwitchTemplates" + self._session._logger.warning(f"getOrganizationSwitchPortsBySwitch: ignoring unrecognized kwargs: {invalid}") - return self._session.get(metadata, resource) + return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationSwitchClientsConnectionsAuthenticationByClient(self, organizationId: str, **kwargs): + def getOrganizationSwitchPortsClientsOverviewByDevice( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): """ - **Summarizes authentication outcomes per switch client across an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-clients-connections-authentication-by-client + **List the number of clients for all switchports with at least one online client in an organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-clients-overview-by-device - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. + - 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 + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 20. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. + - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. + - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. + - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. + - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. + - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. + - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. + - serials (array): Optional parameter to filter items to switches that have one of the provided serials. """ kwargs.update(locals()) metadata = { - "tags": ["switch", "monitor", "clients", "connections", "authentication", "byClient"], - "operation": "getOrganizationSwitchClientsConnectionsAuthenticationByClient", + "tags": ["switch", "monitor", "ports", "clients", "overview", "byDevice"], + "operation": "getOrganizationSwitchPortsClientsOverviewByDevice", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/clients/connections/authentication/byClient" + resource = f"/organizations/{organizationId}/switch/ports/clients/overview/byDevice" query_params = [ - "networkIds", "t0", - "t1", "timespan", + "perPage", + "startingAfter", + "endingBefore", + "configurationUpdatedAfter", + "mac", + "macs", + "name", + "networkIds", + "portProfileIds", + "serial", + "serials", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ + "macs", "networkIds", + "portProfileIds", + "serials", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -3762,89 +3327,96 @@ def getOrganizationSwitchClientsConnectionsAuthenticationByClient(self, organiza invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationSwitchClientsConnectionsAuthenticationByClient: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationSwitchPortsClientsOverviewByDevice: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationSwitchClientsConnectionsDhcpByClient(self, organizationId: str, **kwargs): + def getOrganizationSwitchPortsOverview(self, organizationId: str, **kwargs): """ - **Get IP assignment for all clients in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-clients-connections-dhcp-by-client + **Returns the counts of all active ports for the requested timespan, grouped by speed** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-overview - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 2 hours. + - t0 (string): The beginning of the timespan for the data. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 12 hours and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) metadata = { - "tags": ["switch", "monitor", "clients", "connections", "dhcp", "byClient"], - "operation": "getOrganizationSwitchClientsConnectionsDhcpByClient", + "tags": ["switch", "monitor", "ports", "overview"], + "operation": "getOrganizationSwitchPortsOverview", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/clients/connections/dhcp/byClient" + resource = f"/organizations/{organizationId}/switch/ports/overview" query_params = [ - "networkIds", "t0", "t1", "timespan", ] 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()) - if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = query_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchClientsConnectionsDhcpByClient: ignoring unrecognized kwargs: {invalid}" - ) + self._session._logger.warning(f"getOrganizationSwitchPortsOverview: ignoring unrecognized kwargs: {invalid}") return self._session.get(metadata, resource, params) - def getOrganizationSwitchClientsConnectionsSwitchPortStatusByClient(self, organizationId: str, **kwargs): + def getOrganizationSwitchPortsStatusesBySwitch(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Switch port status by client.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-clients-connections-switch-port-status-by-client + **List the switchports in an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-statuses-by-switch - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. + - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. + - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. + - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. + - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. + - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. + - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. + - serials (array): Optional parameter to filter items to switches that have one of the provided serials. """ kwargs.update(locals()) metadata = { - "tags": ["switch", "monitor", "clients", "connections", "switchPortStatus", "byClient"], - "operation": "getOrganizationSwitchClientsConnectionsSwitchPortStatusByClient", + "tags": ["switch", "monitor", "ports", "statuses", "bySwitch"], + "operation": "getOrganizationSwitchPortsStatusesBySwitch", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/clients/connections/switchPortStatus/byClient" + resource = f"/organizations/{organizationId}/switch/ports/statuses/bySwitch" query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "configurationUpdatedAfter", + "mac", + "macs", + "name", "networkIds", - "t0", - "t1", - "timespan", + "portProfileIds", + "serial", + "serials", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ + "macs", "networkIds", + "portProfileIds", + "serials", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -3856,296 +3428,26 @@ def getOrganizationSwitchClientsConnectionsSwitchPortStatusByClient(self, organi invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationSwitchClientsConnectionsSwitchPortStatusByClient: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationSwitchPortsStatusesBySwitch: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) - def cloneOrganizationSwitchProfilesToTemplateNetwork(self, organizationId: str, **kwargs): + def getOrganizationSwitchPortsTopologyDiscoveryByDevice( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): """ - **Clone existing switch templates into a destination template network.** - https://developer.cisco.com/meraki/api-v1/#!clone-organization-switch-profiles-to-template-network - - - organizationId (string): Organization ID - - profileIds (array): Switch profile IDs to clone - - templateNodeGroupId (string): Destination template network ID - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure"], - "operation": "cloneOrganizationSwitchProfilesToTemplateNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/cloneProfilesToTemplateNetwork" - - body_params = [ - "profileIds", - "templateNodeGroupId", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"cloneOrganizationSwitchProfilesToTemplateNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchConnectivityLanLinkErrorsByDeviceByPort(self, organizationId: str, networkIds: list, **kwargs): - """ - **Lan link errors by device and port.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-connectivity-lan-link-errors-by-device-by-port - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "connectivity", "lanLink", "errors", "byDevice", "byPort"], - "operation": "getOrganizationSwitchConnectivityLanLinkErrorsByDeviceByPort", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/connectivity/lanLink/errors/byDevice/byPort" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchConnectivityLanLinkErrorsByDeviceByPort: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationSwitchConnectivityLanStpErrorsByDeviceByPort(self, organizationId: str, networkIds: list, **kwargs): - """ - **Lan STP errors by device and port.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-connectivity-lan-stp-errors-by-device-by-port - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "connectivity", "lanStp", "errors", "byDevice", "byPort"], - "operation": "getOrganizationSwitchConnectivityLanStpErrorsByDeviceByPort", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/connectivity/lanStp/errors/byDevice/byPort" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchConnectivityLanStpErrorsByDeviceByPort: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationSwitchConnectivityVrrpFailuresByDevice(self, organizationId: str, networkIds: list, **kwargs): - """ - **Gets all vrrp related alerts over a given network and returns information by device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-connectivity-vrrp-failures-by-device - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "connectivity", "vrrp", "failures", "byDevice"], - "operation": "getOrganizationSwitchConnectivityVrrpFailuresByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/connectivity/vrrp/failures/byDevice" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchConnectivityVrrpFailuresByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def cloneOrganizationSwitchDevices(self, organizationId: str, sourceSerial: str, targetSerials: list, **kwargs): - """ - **Clone port-level and some switch-level configuration settings from a source switch to one or more target switches** - https://developer.cisco.com/meraki/api-v1/#!clone-organization-switch-devices - - - organizationId (string): Organization ID - - sourceSerial (string): Serial number of the source switch (must be on a network not bound to a template) - - targetSerials (array): Array of serial numbers of one or more target switches (must be on a network not bound to a template) - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "devices"], - "operation": "cloneOrganizationSwitchDevices", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/devices/clone" - - body_params = [ - "sourceSerial", - "targetSerials", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"cloneOrganizationSwitchDevices: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchDevicesSystemQueuesHistoryBySwitchByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Return a historical record of packet transmission and loss, broken down by protocol, for insight into switch device health.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-devices-system-queues-history-by-switch-by-interval + **List most recently seen LLDP/CDP discovery and topology information per switch port in an organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-topology-discovery-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 - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 1200, 14400, 86400. The default is 1200. Interval is calculated if time params are provided. - - networkIds (array): Optional parameter to filter connectivity history by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter connectivity history by switch. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "devices", "system", "queues", "history", "bySwitch", "byInterval"], - "operation": "getOrganizationSwitchDevicesSystemQueuesHistoryBySwitchByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/devices/system/queues/history/bySwitch/byInterval" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - "networkIds", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchDevicesSystemQueuesHistoryBySwitchByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsBySwitch(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the switchports in an organization by switch** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-by-switch - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 50. Default is 50. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - extendedParams (boolean): Optional flag to return all of the switchport data vs smaller dataset - - hideDefaultPorts (boolean): Optional flag that, when true, will hide modular switchports that may not be connected to the device at the moment - - type (array): Optional parameter to filter switchports by type ('access', 'trunk', 'stack', 'routed', 'svl' or 'dad'). All types are selected if not supplied. - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. @@ -4159,19 +3461,18 @@ def getOrganizationSwitchPortsBySwitch(self, organizationId: str, total_pages=1, kwargs.update(locals()) metadata = { - "tags": ["switch", "configure", "ports", "bySwitch"], - "operation": "getOrganizationSwitchPortsBySwitch", + "tags": ["switch", "monitor", "ports", "topology", "discovery", "byDevice"], + "operation": "getOrganizationSwitchPortsTopologyDiscoveryByDevice", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/bySwitch" + resource = f"/organizations/{organizationId}/switch/ports/topology/discovery/byDevice" query_params = [ + "t0", + "timespan", "perPage", "startingAfter", "endingBefore", - "extendedParams", - "hideDefaultPorts", - "type", "configurationUpdatedAfter", "mac", "macs", @@ -4184,7 +3485,6 @@ def getOrganizationSwitchPortsBySwitch(self, organizationId: str, total_pages=1, params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "type", "macs", "networkIds", "portProfileIds", @@ -4199,23 +3499,27 @@ def getOrganizationSwitchPortsBySwitch(self, organizationId: str, total_pages=1, all_params = query_params + array_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSwitchPortsBySwitch: ignoring unrecognized kwargs: {invalid}") + self._session._logger.warning( + f"getOrganizationSwitchPortsTopologyDiscoveryByDevice: ignoring unrecognized kwargs: {invalid}" + ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationSwitchPortsClientsOverviewByDevice( + def getOrganizationSwitchPortsUsageHistoryByDeviceByInterval( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **List the number of clients for all switchports with at least one online client in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-clients-overview-by-device + **List the historical usage and traffic data of switchports in an organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-usage-history-by-device-by-interval - 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 - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 20. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. If interval is provided, the timespan will be autocalculated. + - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 1200, 14400, 86400. The default is 1200. Interval is calculated if time params are provided. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 50. Default is 10. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. @@ -4231,15 +3535,17 @@ def getOrganizationSwitchPortsClientsOverviewByDevice( kwargs.update(locals()) metadata = { - "tags": ["switch", "monitor", "ports", "clients", "overview", "byDevice"], - "operation": "getOrganizationSwitchPortsClientsOverviewByDevice", + "tags": ["switch", "monitor", "ports", "usage", "history", "byDevice", "byInterval"], + "operation": "getOrganizationSwitchPortsUsageHistoryByDeviceByInterval", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/clients/overview/byDevice" + resource = f"/organizations/{organizationId}/switch/ports/usage/history/byDevice/byInterval" query_params = [ "t0", + "t1", "timespan", + "interval", "perPage", "startingAfter", "endingBefore", @@ -4270,2962 +3576,7 @@ def getOrganizationSwitchPortsClientsOverviewByDevice( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationSwitchPortsClientsOverviewByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsMirrorsBySwitch(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **list the port mirror configurations in an organization by switch** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-mirrors-by-switch - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter the result set by the included set of network IDs - - 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 - 100. - - 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": ["switch", "configure", "ports", "mirrors", "bySwitch"], - "operation": "getOrganizationSwitchPortsMirrorsBySwitch", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/mirrors/bySwitch" - - query_params = [ - "networkIds", - "serials", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsMirrorsBySwitch: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsOverview(self, organizationId: str, **kwargs): - """ - **Returns the counts of all active ports for the requested timespan, grouped by speed** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-overview - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 12 hours and be less than or equal to 186 days. The default is 1 day. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "ports", "overview"], - "operation": "getOrganizationSwitchPortsOverview", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/overview" - - query_params = [ - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSwitchPortsOverview: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def getOrganizationSwitchPortsProfiles(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the port profiles in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Return the port profiles for the specified network(s) - - formattedStaticAssignments (boolean): Returns the list of static switchports that are assigned to the switchport profile - - searchQuery (string): Optional parameter to filter the result set by the search query - - radiusProfileEnabled (boolean): Optional parameter. If true, only return port profiles with a radius profile enabled - - 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": ["switch", "configure", "ports", "profiles"], - "operation": "getOrganizationSwitchPortsProfiles", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles" - - query_params = [ - "networkIds", - "formattedStaticAssignments", - "searchQuery", - "radiusProfileEnabled", - "perPage", - "startingAfter", - "endingBefore", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSwitchPortsProfiles: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchPortsProfile(self, organizationId: str, **kwargs): - """ - **Create a port profile in an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-ports-profile - - - organizationId (string): Organization ID - - name (string): The name of the profile. - - description (string): Text describing the profile. - - isOrganizationWide (boolean): The scope of the profile whether it is organization level or network level - - networks (object): The networks which are included/excluded in the profile - - networkId (string): The network identifier - - tags (array): Space-seperated list of tags - - defaultRadiusProfileName (string): When present, the default RADIUS attribute value for RADIUS-based port profile application - - authentication (object): Authentication settings for RADIUS-based port profile application. - - port (object): Configuration settings for port profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "createOrganizationSwitchPortsProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles" - - body_params = [ - "name", - "description", - "isOrganizationWide", - "networks", - "networkId", - "tags", - "defaultRadiusProfileName", - "authentication", - "port", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationSwitchPortsProfile: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def batchOrganizationSwitchPortsProfilesAssignmentsAssign(self, organizationId: str, items: list, **kwargs): - """ - **Batch assign or unassign port profiles to switch ports** - https://developer.cisco.com/meraki/api-v1/#!batch-organization-switch-ports-profiles-assignments-assign - - - organizationId (string): Organization ID - - items (array): Array of assignment operations (max 100) - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "assignments"], - "operation": "batchOrganizationSwitchPortsProfilesAssignmentsAssign", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/assignments/batchAssign" - - body_params = [ - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"batchOrganizationSwitchPortsProfilesAssignmentsAssign: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchPortsProfilesAssignmentsByPort( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the port profile assignments in an organization, grouped by port** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles-assignments-by-port - - - 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 - - profileIds (array): Filter by specific profile IDs - - serials (array): Filter by switch serials - - networkIds (array): Filter by network IDs - - templateIds (array): Filter by template (node_profile) IDs - - types (array): Filter by port type: switch, template - - assignmentTypes (array): Filter by assignment type: direct, template, exception - - isActive (boolean): Filter by assignment status. true: only ports with active assignments, showing only active assignments per port. false: only ports with inactive assignments, showing only inactive assignments per port. Omit: all ports with all assignment layers. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "assignments", "byPort"], - "operation": "getOrganizationSwitchPortsProfilesAssignmentsByPort", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/assignments/byPort" - - query_params = [ - "profileIds", - "serials", - "networkIds", - "templateIds", - "types", - "assignmentTypes", - "isActive", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "profileIds", - "serials", - "networkIds", - "templateIds", - "types", - "assignmentTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsProfilesAssignmentsByPort: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsProfilesAssignmentsBySwitch( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the port profile assignments in an organization, grouped by switch** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles-assignments-by-switch - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - profileIds (array): Filter by specific profile IDs - - serials (array): Filter by switch serials - - networkIds (array): Filter by network IDs - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 50. 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. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "assignments", "bySwitch"], - "operation": "getOrganizationSwitchPortsProfilesAssignmentsBySwitch", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/assignments/bySwitch" - - query_params = [ - "profileIds", - "serials", - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "profileIds", - "serials", - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsProfilesAssignmentsBySwitch: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsProfilesAutomations(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **list the automation port profiles in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles-automations - - - 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 - - ids (array): Optional parameter to filter the result set by the included set of automation IDs - - networkIds (array): Optional parameter to filter the result set by the associated networks. - - isOrganizationWide (string): Optional parameter to filter the result set by automations org-wide flag. - - searchQuery (string): Optional parameter to filter the result set by the search query - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "automations"], - "operation": "getOrganizationSwitchPortsProfilesAutomations", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/automations" - - query_params = [ - "ids", - "networkIds", - "isOrganizationWide", - "searchQuery", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "ids", - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsProfilesAutomations: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchPortsProfilesAutomation(self, organizationId: str, **kwargs): - """ - **Create a port profile automation for an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-ports-profiles-automation - - - organizationId (string): Organization ID - - name (string): Name of the port profile automation. - - description (string): Text describing the port profile automation. - - fallbackProfile (object): Configuration settings for port profile - - rules (array): Configuration settings for port profile automation rules - - assignedSwitchPorts (array): assigned switch ports - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "automations"], - "operation": "createOrganizationSwitchPortsProfilesAutomation", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/automations" - - body_params = [ - "name", - "description", - "fallbackProfile", - "rules", - "assignedSwitchPorts", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchPortsProfilesAutomation: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationSwitchPortsProfilesAutomation(self, organizationId: str, id: str, **kwargs): - """ - **Update a port profile automation in an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-switch-ports-profiles-automation - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of the port profile automation. - - description (string): Text describing the port profile automation. - - fallbackProfile (object): Configuration settings for port profile - - rules (array): Configuration settings for port profile automation rules - - assignedSwitchPorts (array): assigned switch ports - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "automations"], - "operation": "updateOrganizationSwitchPortsProfilesAutomation", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/automations/{id}" - - body_params = [ - "name", - "description", - "fallbackProfile", - "rules", - "assignedSwitchPorts", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSwitchPortsProfilesAutomation: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSwitchPortsProfilesAutomation(self, organizationId: str, id: str): - """ - **Delete an automation port profile from an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-ports-profiles-automation - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "automations"], - "operation": "deleteOrganizationSwitchPortsProfilesAutomation", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/automations/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchPortsProfilesNetworksAssignments( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Fetch all Network - Smart Port Profile associations for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles-networks-assignments - - - 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): Number of records per page - - page (integer): Page number - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "networks", "assignments"], - "operation": "getOrganizationSwitchPortsProfilesNetworksAssignments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/networks/assignments" - - query_params = [ - "perPage", - "page", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsProfilesNetworksAssignments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchPortsProfilesNetworksAssignment( - self, organizationId: str, type: str, profile: dict, network: dict, **kwargs - ): - """ - **Create Network and Smart Ports Profile association for a specific profile** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-ports-profiles-networks-assignment - - - organizationId (string): Organization ID - - type (string): Type of association - - profile (object): Smart Port Profile object - - network (object): Network object - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "networks", "assignments"], - "operation": "createOrganizationSwitchPortsProfilesNetworksAssignment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/networks/assignments" - - body_params = [ - "type", - "profile", - "network", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchPortsProfilesNetworksAssignment: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def batchOrganizationSwitchPortsProfilesNetworksAssignmentsCreate(self, organizationId: str, items: list, **kwargs): - """ - **Batch Create Network and Smart Ports Profile associations for a specific profile** - https://developer.cisco.com/meraki/api-v1/#!batch-organization-switch-ports-profiles-networks-assignments-create - - - organizationId (string): Organization ID - - items (array): Array of network and profile associations - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "networks", "assignments"], - "operation": "batchOrganizationSwitchPortsProfilesNetworksAssignmentsCreate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/networks/assignments/batchCreate" - - body_params = [ - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"batchOrganizationSwitchPortsProfilesNetworksAssignmentsCreate: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def bulkOrganizationSwitchPortsProfilesNetworksAssignmentsDelete(self, organizationId: str, items: list, **kwargs): - """ - **Bulk delete Network and Smart Port Profile associations** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-switch-ports-profiles-networks-assignments-delete - - - organizationId (string): Organization ID - - items (array): Array of assignments to delete - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "networks", "assignments"], - "operation": "bulkOrganizationSwitchPortsProfilesNetworksAssignmentsDelete", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/networks/assignments/bulkDelete" - - body_params = [ - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"bulkOrganizationSwitchPortsProfilesNetworksAssignmentsDelete: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def deleteOrganizationSwitchPortsProfilesNetworksAssignment(self, organizationId: str, assignmentId: str): - """ - **Delete Network and Smart Port profile association for a specific profile** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-ports-profiles-networks-assignment - - - organizationId (string): Organization ID - - assignmentId (string): Assignment ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "networks", "assignments"], - "operation": "deleteOrganizationSwitchPortsProfilesNetworksAssignment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - assignmentId = urllib.parse.quote(str(assignmentId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/networks/assignments/{assignmentId}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchPortsProfilesOverviewByProfile( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the port profiles in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles-overview-by-profile - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Return the port profiles for the specified network(s) - - formattedStaticAssignments (boolean): Returns the list of static switchports that are assgined to the switchport profile - - searchQuery (string): Optional parameter to filter the result set by the search query - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "overview", "byProfile"], - "operation": "getOrganizationSwitchPortsProfilesOverviewByProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/overview/byProfile" - - query_params = [ - "networkIds", - "formattedStaticAssignments", - "searchQuery", - "perPage", - "startingAfter", - "endingBefore", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsProfilesOverviewByProfile: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsProfilesRadiusAssignments( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the port profile RADIUS assignments** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles-radius-assignments - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): If present, the networks to limit the assignments to - - portProfileIds (array): If present, the port profiles to limit the assignments to - - 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": ["switch", "configure", "ports", "profiles", "radius", "assignments"], - "operation": "getOrganizationSwitchPortsProfilesRadiusAssignments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/radius/assignments" - - query_params = [ - "networkIds", - "portProfileIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "portProfileIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsProfilesRadiusAssignments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchPortsProfilesRadiusAssignment(self, organizationId: str, network: dict, **kwargs): - """ - **Create a port profile RADIUS assignment** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-ports-profiles-radius-assignment - - - organizationId (string): Organization ID - - network (object): The network where the RADIUS name is assigned - - portProfile (object): The assigned port profile - - radius (object): The RADIUS options for this assignment - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "radius", "assignments"], - "operation": "createOrganizationSwitchPortsProfilesRadiusAssignment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/radius/assignments" - - body_params = [ - "network", - "portProfile", - "radius", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchPortsProfilesRadiusAssignment: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchPortsProfilesRadiusAssignment(self, organizationId: str, id: str): - """ - **Return a port profile RADIUS assignment** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles-radius-assignment - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "radius", "assignments"], - "operation": "getOrganizationSwitchPortsProfilesRadiusAssignment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/radius/assignments/{id}" - - return self._session.get(metadata, resource) - - def updateOrganizationSwitchPortsProfilesRadiusAssignment(self, organizationId: str, id: str, **kwargs): - """ - **Update a port profile RADIUS assignment** - https://developer.cisco.com/meraki/api-v1/#!update-organization-switch-ports-profiles-radius-assignment - - - organizationId (string): Organization ID - - id (string): ID - - network (object): The network where the RADIUS name is assigned - - portProfile (object): The assigned port profile - - radius (object): The RADIUS options for this assignment - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "radius", "assignments"], - "operation": "updateOrganizationSwitchPortsProfilesRadiusAssignment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/radius/assignments/{id}" - - body_params = [ - "network", - "portProfile", - "radius", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSwitchPortsProfilesRadiusAssignment: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSwitchPortsProfilesRadiusAssignment(self, organizationId: str, id: str): - """ - **Deletes a port profile RADIUS assignment** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-ports-profiles-radius-assignment - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "radius", "assignments"], - "operation": "deleteOrganizationSwitchPortsProfilesRadiusAssignment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/radius/assignments/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchPortsProfile(self, organizationId: str, id: str): - """ - **Get detailed information about a port profile** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profile - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "getOrganizationSwitchPortsProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/{id}" - - return self._session.get(metadata, resource) - - def updateOrganizationSwitchPortsProfile(self, organizationId: str, id: str, **kwargs): - """ - **Update a port profile in an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-switch-ports-profile - - - organizationId (string): Organization ID - - id (string): ID - - name (string): The name of the profile. - - description (string): Text describing the profile. - - isOrganizationWide (boolean): The scope of the profile whether it is organization level or network level - - networks (object): The networks which are included/excluded in the profile - - networkId (string): The network identifier - - tags (array): Space-seperated list of tags - - defaultRadiusProfileName (string): When present, the default RADIUS attribute value for RADIUS-based port profile application - - authentication (object): Authentication settings for RADIUS-based port profile application. - - port (object): Configuration settings for port profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "updateOrganizationSwitchPortsProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/{id}" - - body_params = [ - "name", - "description", - "isOrganizationWide", - "networks", - "networkId", - "tags", - "defaultRadiusProfileName", - "authentication", - "port", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationSwitchPortsProfile: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSwitchPortsProfile(self, organizationId: str, id: str): - """ - **Delete a port profile from an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-ports-profile - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "deleteOrganizationSwitchPortsProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchPortsStatusesBySwitch(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the switchports in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-statuses-by-switch - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. - - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. - - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. - - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. - - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. - - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. - - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. - - serials (array): Optional parameter to filter items to switches that have one of the provided serials. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "ports", "statuses", "bySwitch"], - "operation": "getOrganizationSwitchPortsStatusesBySwitch", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/statuses/bySwitch" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "configurationUpdatedAfter", - "mac", - "macs", - "name", - "networkIds", - "portProfileIds", - "serial", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "macs", - "networkIds", - "portProfileIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsStatusesBySwitch: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsStatusesPacketsByDeviceByPort(self, organizationId: str, networkIds: list, **kwargs): - """ - **Switch port packets by device and port.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-statuses-packets-by-device-by-port - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 1 day. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 1200, 14400, 86400. The default is 14400. Interval is calculated if time params are provided. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "ports", "statuses", "packets", "byDevice", "byPort"], - "operation": "getOrganizationSwitchPortsStatusesPacketsByDeviceByPort", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/statuses/packets/byDevice/byPort" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - "interval", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsStatusesPacketsByDeviceByPort: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationSwitchPortsTopologyDiscoveryByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List most recently seen LLDP/CDP discovery and topology information per switch port in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-topology-discovery-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 - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. - - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. - - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. - - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. - - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. - - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. - - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. - - serials (array): Optional parameter to filter items to switches that have one of the provided serials. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "ports", "topology", "discovery", "byDevice"], - "operation": "getOrganizationSwitchPortsTopologyDiscoveryByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/topology/discovery/byDevice" - - query_params = [ - "t0", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - "configurationUpdatedAfter", - "mac", - "macs", - "name", - "networkIds", - "portProfileIds", - "serial", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "macs", - "networkIds", - "portProfileIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsTopologyDiscoveryByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsTransceiversReadingsHistoryBySwitch( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Return time-series digital optical monitoring (DOM) readings for ports on each DOM-enabled switch in an organization, in addition to thresholds for each relevant Small Form Factor Pluggable (SFP) module.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-transceivers-readings-history-by-switch - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 1 day. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 1200, 14400, 86400. The default is 1200. Interval is calculated if time params are provided. - - networkIds (array): Networks for which information should be gathered. - - serials (array): Optional parameter to filter usage by switch. - - portIds (array): Optional parameter to filter usage by port ID. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "ports", "transceivers", "readings", "history", "bySwitch"], - "operation": "getOrganizationSwitchPortsTransceiversReadingsHistoryBySwitch", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/transceivers/readings/history/bySwitch" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - "networkIds", - "serials", - "portIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "portIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsTransceiversReadingsHistoryBySwitch: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsUsageHistoryByDeviceByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the historical usage and traffic data of switchports in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-usage-history-by-device-by-interval - - - 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 - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 1200, 14400, 86400. The default is 1200. Interval is calculated if time params are provided. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 50. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. - - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. - - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. - - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. - - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. - - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. - - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. - - serials (array): Optional parameter to filter items to switches that have one of the provided serials. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "ports", "usage", "history", "byDevice", "byInterval"], - "operation": "getOrganizationSwitchPortsUsageHistoryByDeviceByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/usage/history/byDevice/byInterval" - - query_params = [ - "t0", - "t1", - "timespan", - "interval", - "perPage", - "startingAfter", - "endingBefore", - "configurationUpdatedAfter", - "mac", - "macs", - "name", - "networkIds", - "portProfileIds", - "serial", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "macs", - "networkIds", - "portProfileIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsUsageHistoryByDeviceByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpAutonomousSystems(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the autonomous systems configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-autonomous-systems - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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. - - numbers (array): Optional parameter to filter autonomous systems by number. This filter uses multiple exact matches. - - autonomousSystemIds (array): Optional parameter to filter autonomous systems by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "autonomousSystems"], - "operation": "getOrganizationSwitchRoutingBgpAutonomousSystems", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/autonomousSystems" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "numbers", - "autonomousSystemIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "numbers", - "autonomousSystemIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpAutonomousSystems: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchRoutingBgpAutonomousSystem(self, organizationId: str, number: int, **kwargs): - """ - **Create an autonomous system** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-autonomous-system - - - organizationId (string): Organization ID - - number (integer): The autonomous system number (CLI: 'router bgp ') - - description (string): A description for the autonomous system - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "autonomousSystems"], - "operation": "createOrganizationSwitchRoutingBgpAutonomousSystem", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/autonomousSystems" - - body_params = [ - "number", - "description", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchRoutingBgpAutonomousSystem: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchRoutingBgpAutonomousSystemsOverviewByAutonomousSystem( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the overview of the autonomous systems configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-autonomous-systems-overview-by-autonomous-system - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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. - - numbers (array): Optional parameter to filter autonomous systems by number. This filter uses multiple exact matches. - - autonomousSystemIds (array): Optional parameter to filter autonomous systems by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "autonomousSystems", "overview", "byAutonomousSystem"], - "operation": "getOrganizationSwitchRoutingBgpAutonomousSystemsOverviewByAutonomousSystem", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/autonomousSystems/overview/byAutonomousSystem" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "numbers", - "autonomousSystemIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "numbers", - "autonomousSystemIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpAutonomousSystemsOverviewByAutonomousSystem: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def updateOrganizationSwitchRoutingBgpAutonomousSystem(self, organizationId: str, autonomousSystemId: str, **kwargs): - """ - **Update an autonomous system** - https://developer.cisco.com/meraki/api-v1/#!update-organization-switch-routing-bgp-autonomous-system - - - organizationId (string): Organization ID - - autonomousSystemId (string): Autonomous system ID - - number (integer): The autonomous system number (CLI: 'router bgp ') - - description (string): A description for the autonomous system - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "autonomousSystems"], - "operation": "updateOrganizationSwitchRoutingBgpAutonomousSystem", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - autonomousSystemId = urllib.parse.quote(str(autonomousSystemId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/autonomousSystems/{autonomousSystemId}" - - body_params = [ - "number", - "description", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSwitchRoutingBgpAutonomousSystem: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSwitchRoutingBgpAutonomousSystem(self, organizationId: str, autonomousSystemId: str): - """ - **Delete an autonomous system from an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-routing-bgp-autonomous-system - - - organizationId (string): Organization ID - - autonomousSystemId (string): Autonomous system ID - """ - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "autonomousSystems"], - "operation": "deleteOrganizationSwitchRoutingBgpAutonomousSystem", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - autonomousSystemId = urllib.parse.quote(str(autonomousSystemId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/autonomousSystems/{autonomousSystemId}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchRoutingBgpFiltersFilterLists( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the filter lists configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-filters-filter-lists - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 'filter lists' by network ID. This filter uses multiple exact matches. - - listIds (array): Optional parameter to filter 'filter lists' by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "filterLists"], - "operation": "getOrganizationSwitchRoutingBgpFiltersFilterLists", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/filterLists" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "listIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "listIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpFiltersFilterLists: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchRoutingBgpFiltersFilterListsDeploy( - self, organizationId: str, filterList: dict, network: dict, rules: list, **kwargs - ): - """ - **Create or update a filter list, in addition to its associated rules** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-filters-filter-lists-deploy - - - organizationId (string): Organization ID - - filterList (object): Information regarding the filter list - - network (object): Information regarding the network the filter list belongs to - - rules (array): Information regarding the filter list rules - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "filterLists", "deploy"], - "operation": "createOrganizationSwitchRoutingBgpFiltersFilterListsDeploy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/filterLists/deploy" - - body_params = [ - "filterList", - "network", - "rules", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchRoutingBgpFiltersFilterListsDeploy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchRoutingBgpFiltersFilterListsOverviewByFilterList( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the overview of the filter lists configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-filters-filter-lists-overview-by-filter-list - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 'filter list' overviews by network ID. This filter uses multiple exact matches. - - listIds (array): Optional parameter to filter 'filter list' overviews by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "routing", "bgp", "filters", "filterLists", "overview", "byFilterList"], - "operation": "getOrganizationSwitchRoutingBgpFiltersFilterListsOverviewByFilterList", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/filterLists/overview/byFilterList" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "listIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "listIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpFiltersFilterListsOverviewByFilterList: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpFiltersFilterListsRules( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the filter list rules configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-filters-filter-lists-rules - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 'filter list' rules by network ID. This filter uses multiple exact matches. - - ruleIds (array): Optional parameter to filter 'filter list' rules by ID. This filter uses multiple exact matches. - - filterListIds (array): Optional parameter to filter 'filter lists' by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "filterLists", "rules"], - "operation": "getOrganizationSwitchRoutingBgpFiltersFilterListsRules", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/filterLists/rules" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "ruleIds", - "filterListIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "ruleIds", - "filterListIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpFiltersFilterListsRules: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def deleteOrganizationSwitchRoutingBgpFiltersFilterList(self, organizationId: str, listId: str): - """ - **Delete a filter list** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-routing-bgp-filters-filter-list - - - organizationId (string): Organization ID - - listId (string): List ID - """ - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "filterLists"], - "operation": "deleteOrganizationSwitchRoutingBgpFiltersFilterList", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - listId = urllib.parse.quote(str(listId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/filterLists/{listId}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchRoutingBgpFiltersPrefixLists( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the prefix lists configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-filters-prefix-lists - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 prefix lists by network ID. This filter uses multiple exact matches. - - listIds (array): Optional parameter to filter prefix lists by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "prefixLists"], - "operation": "getOrganizationSwitchRoutingBgpFiltersPrefixLists", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/prefixLists" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "listIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "listIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpFiltersPrefixLists: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchRoutingBgpFiltersPrefixListsDeploy( - self, organizationId: str, network: dict, prefixList: dict, rules: list, **kwargs - ): - """ - **Create or update a prefix list, in addition to its associated rules** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-filters-prefix-lists-deploy - - - organizationId (string): Organization ID - - network (object): Information regarding the network the prefix list belongs to - - prefixList (object): Information regarding the prefix list - - rules (array): Information regarding the prefix list rules - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "prefixLists", "deploy"], - "operation": "createOrganizationSwitchRoutingBgpFiltersPrefixListsDeploy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/prefixLists/deploy" - - body_params = [ - "network", - "prefixList", - "rules", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchRoutingBgpFiltersPrefixListsDeploy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchRoutingBgpFiltersPrefixListsOverviewByPrefixList( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the overview of the prefix lists configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-filters-prefix-lists-overview-by-prefix-list - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 prefix list overviews by network ID. This filter uses multiple exact matches. - - listIds (array): Optional parameter to filter prefix list overviews by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "routing", "bgp", "filters", "prefixLists", "overview", "byPrefixList"], - "operation": "getOrganizationSwitchRoutingBgpFiltersPrefixListsOverviewByPrefixList", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/prefixLists/overview/byPrefixList" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "listIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "listIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpFiltersPrefixListsOverviewByPrefixList: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpFiltersPrefixListsRules( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the prefix list rules configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-filters-prefix-lists-rules - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 prefix list rules by network ID. This filter uses multiple exact matches. - - prefixListIds (array): Optional parameter to filter prefix list rules by prefix list ID. This filter uses multiple exact matches. - - ruleIds (array): Optional parameter to filter prefix list rules by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "prefixLists", "rules"], - "operation": "getOrganizationSwitchRoutingBgpFiltersPrefixListsRules", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/prefixLists/rules" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "prefixListIds", - "ruleIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "prefixListIds", - "ruleIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpFiltersPrefixListsRules: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def deleteOrganizationSwitchRoutingBgpFiltersPrefixList(self, organizationId: str, listId: str): - """ - **Delete a prefix list** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-routing-bgp-filters-prefix-list - - - organizationId (string): Organization ID - - listId (string): List ID - """ - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "prefixLists"], - "operation": "deleteOrganizationSwitchRoutingBgpFiltersPrefixList", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - listId = urllib.parse.quote(str(listId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/prefixLists/{listId}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchRoutingBgpPeersGroups(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the BGP peer groups configured in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-peers-groups - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 peer groups by network ID. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter peer groups by router ID. This filter uses multiple exact matches. - - profileIds (array): Optional parameter to filter peer groups by profile ID. This filter uses multiple exact matches. - - peerGroupIds (array): Optional parameter to filter peer groups by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "groups"], - "operation": "getOrganizationSwitchRoutingBgpPeersGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/groups" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "routerIds", - "profileIds", - "peerGroupIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "routerIds", - "profileIds", - "peerGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpPeersGroups: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpPeersGroupsAddressFamiliesDeployments( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List all BGP deployment information for multiple peer groups or address families configured in the given organization, including profile information, peer group address family information, neighbors, and listen ranges** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-peers-groups-address-families-deployments - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 peer group address family deployments by network ID. This filter uses multiple exact matches. - - peerGroupIds (array): Optional parameter to filter peer group address family deployments by peer group - - addressFamilyIds (array): Optional parameter to filter peer group address family deployments by address family - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "groups", "addressFamilies", "deployments"], - "operation": "getOrganizationSwitchRoutingBgpPeersGroupsAddressFamiliesDeployments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/groups/addressFamilies/deployments" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "peerGroupIds", - "addressFamilyIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "peerGroupIds", - "addressFamilyIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpPeersGroupsAddressFamiliesDeployments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchRoutingBgpPeersGroupsDeploy( - self, - organizationId: str, - addressFamily: dict, - network: dict, - peerGroup: dict, - peerGroupAddressFamilyBindingProfile: dict, - peerGroupProfile: dict, - policies: list, - router: dict, - **kwargs, - ): - """ - **Create or update a peer group, in addition to an associated peer group profile, peer group address family binding, peer group address family binding profile and routing policies associated with the peer group** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-peers-groups-deploy - - - organizationId (string): Organization ID - - addressFamily (object): Information regarding the address family the peer group address family binding belongs to - - network (object): Information regarding the network the peer group profile belongs to - - peerGroup (object): Information regarding the peer group - - peerGroupAddressFamilyBindingProfile (object): Information regarding the peer group address family binding profile - - peerGroupProfile (object): Information regarding the peer group profile - - policies (array): Information regarding the routing policies - - router (object): Information regarding the router this peer group belongs to - - peerGroupAddressFamilyBinding (object): Information regarding the peer group address family binding. Only required when updating. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "groups", "deploy"], - "operation": "createOrganizationSwitchRoutingBgpPeersGroupsDeploy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/groups/deploy" - - body_params = [ - "addressFamily", - "network", - "peerGroup", - "peerGroupAddressFamilyBinding", - "peerGroupAddressFamilyBindingProfile", - "peerGroupProfile", - "policies", - "router", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchRoutingBgpPeersGroupsDeploy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchRoutingBgpPeersGroupsDeployments( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List all BGP deployment information for peer groups configured in the given organization, including peer group address family information, as well as routing policies** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-peers-groups-deployments - - - 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 - 50. Default is 20. - - 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 peer group deployments by network ID. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter peer group deployments by router ID. This filter uses multiple exact matches. - - profileIds (array): Optional parameter to filter peer group deployments by profile ID. This filter uses multiple exact matches. - - peerGroupIds (array): Optional parameter to filter peer group deployments by peer group ID. This filter uses multiple exact matches. - - afi (string): Optional parameter to filter deployments on each peer group by address family identifier (AFI). - - safi (string): Optional parameter to filter deployments on each peer group by subsequent address family identifier (SAFI). - """ - - kwargs.update(locals()) - - if "afi" in kwargs: - options = ["ipv4"] - assert kwargs["afi"] in options, f'''"afi" cannot be "{kwargs["afi"]}", & must be set to one of: {options}''' - if "safi" in kwargs: - options = ["unicast"] - assert kwargs["safi"] in options, f'''"safi" cannot be "{kwargs["safi"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "groups", "deployments"], - "operation": "getOrganizationSwitchRoutingBgpPeersGroupsDeployments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/groups/deployments" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "routerIds", - "profileIds", - "peerGroupIds", - "afi", - "safi", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "routerIds", - "profileIds", - "peerGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpPeersGroupsDeployments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpPeersGroupsOverviewByPeerGroup( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the overview of the BGP peer groups configured in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-peers-groups-overview-by-peer-group - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 peer group overviews by network ID. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter peer group overviews by router ID. This filter uses multiple exact matches. - - profileIds (array): Optional parameter to filter peer group overviews by profile ID. This filter uses multiple exact matches. - - peerGroupIds (array): Optional parameter to filter peer group overviews by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "routing", "bgp", "peers", "groups", "overview", "byPeerGroup"], - "operation": "getOrganizationSwitchRoutingBgpPeersGroupsOverviewByPeerGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/groups/overview/byPeerGroup" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "routerIds", - "profileIds", - "peerGroupIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "routerIds", - "profileIds", - "peerGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpPeersGroupsOverviewByPeerGroup: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpPeersListenRanges(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the listen ranges configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-peers-listen-ranges - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 listen ranges by network ID. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter listen ranges by router ID. This filter uses multiple exact matches. - - peerGroupIds (array): Optional parameter to filter listen ranges by peer group ID. This filter uses multiple exact matches. - - listenRangeIds (array): Optional parameter to filter listen ranges by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "listenRanges"], - "operation": "getOrganizationSwitchRoutingBgpPeersListenRanges", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/listenRanges" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "routerIds", - "peerGroupIds", - "listenRangeIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "routerIds", - "peerGroupIds", - "listenRangeIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpPeersListenRanges: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpPeersNeighbors(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the neighbors configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-peers-neighbors - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 neighbors by network ID. This filter uses multiple exact matches. - - peerGroupIds (array): Optional parameter to filter neighbors by peer group ID. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter neighbors by router ID. This filter uses multiple exact matches. - - neighborIds (array): Optional parameter to filter neighbors by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "neighbors"], - "operation": "getOrganizationSwitchRoutingBgpPeersNeighbors", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/neighbors" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "peerGroupIds", - "routerIds", - "neighborIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "peerGroupIds", - "routerIds", - "neighborIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpPeersNeighbors: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchRoutingBgpPeersNeighborsDeploy( - self, - organizationId: str, - addressFamily: dict, - neighbor: dict, - neighborAddressFamilyBinding: dict, - peerGroup: dict, - policies: list, - router: dict, - **kwargs, - ): - """ - **Create or update a neighor, in addition to an associated neighbor address family binding and routing policies associated with the neighbor** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-peers-neighbors-deploy - - - organizationId (string): Organization ID - - addressFamily (object): Information regarding the address family this binding is bound to - - neighbor (object): Information regarding the BPG neighbor - - neighborAddressFamilyBinding (object): Information regarding the neighbor address family binding - - peerGroup (object): Information regarding the peer group this neighbor belongs to - - policies (array): Information regarding the routing policies related to the neighbor - - router (object): Information regarding the router this neighbor peers with - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "neighbors", "deploy"], - "operation": "createOrganizationSwitchRoutingBgpPeersNeighborsDeploy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/neighbors/deploy" - - body_params = [ - "addressFamily", - "neighbor", - "neighborAddressFamilyBinding", - "peerGroup", - "policies", - "router", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchRoutingBgpPeersNeighborsDeploy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchRoutingBgpPeersNeighborsDeployments( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List all BGP deployment information for neighbors configured in the given organization, including address family information, as well as routing policies** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-peers-neighbors-deployments - - - 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 - 50. Default is 20. - - 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 neighbor deployments by network ID. This filter uses multiple exact matches. - - peerGroupIds (array): Optional parameter to filter neighbor deployments by peer group ID. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter neighbor deployments by router ID. This filter uses multiple exact matches. - - neighborIds (array): Optional parameter to filter neighbor deployments by neighbor ID. This filter uses multiple exact matches. - - afi (string): Optional parameter to filter deployments on each neighbor by address family identifier (AFI). - - safi (string): Optional parameter to filter deployments on each neighbor by subsequent address family identifier (SAFI). - """ - - kwargs.update(locals()) - - if "afi" in kwargs: - options = ["ipv4"] - assert kwargs["afi"] in options, f'''"afi" cannot be "{kwargs["afi"]}", & must be set to one of: {options}''' - if "safi" in kwargs: - options = ["unicast"] - assert kwargs["safi"] in options, f'''"safi" cannot be "{kwargs["safi"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "neighbors", "deployments"], - "operation": "getOrganizationSwitchRoutingBgpPeersNeighborsDeployments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/neighbors/deployments" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "peerGroupIds", - "routerIds", - "neighborIds", - "afi", - "safi", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "peerGroupIds", - "routerIds", - "neighborIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpPeersNeighborsDeployments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpRouters(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the routers configured in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-routers - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 50. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter routers by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter routers by serial. This filter uses multiple exact matches. - - switchNames (array): Optional parameter to filter routers by switch name. The filter uses multiple exact matches. - - asNumbers (array): Optional parameter to filter routers by autonomous system number. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter routers by ID. This filter uses multiple exact matches. - - switchStackIds (array): Optional parameter to filter routers by switch stack id. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "routers"], - "operation": "getOrganizationSwitchRoutingBgpRouters", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/routers" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - "switchNames", - "asNumbers", - "routerIds", - "switchStackIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "switchNames", - "asNumbers", - "routerIds", - "switchStackIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpRouters: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchRoutingBgpRoutersDeploy( - self, - organizationId: str, - addressFamily: dict, - addressFamilyPrefixes: list, - addressFamilyProfile: dict, - autonomousSystem: dict, - router: dict, - switch: dict, - **kwargs, - ): - """ - **Create a BGP router, in addition to an associated address family, address family prefixes, and address family profile** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-routers-deploy - - - organizationId (string): Organization ID - - addressFamily (object): Information regarding the address family - - addressFamilyPrefixes (array): The list of network prefixes to which the address family applies - - addressFamilyProfile (object): Information regarding the profile applied to the address family - - autonomousSystem (object): Information regarding the router's autonomous system - - router (object): Information regarding the BPG router - - switch (object): The router's switch node. When the router is part of a switch stack, this is the switch stack's active node - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "routers", "deploy"], - "operation": "createOrganizationSwitchRoutingBgpRoutersDeploy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/routers/deploy" - - body_params = [ - "addressFamily", - "addressFamilyPrefixes", - "addressFamilyProfile", - "autonomousSystem", - "router", - "switch", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchRoutingBgpRoutersDeploy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchRoutingBgpRoutersDeployments( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List all BGP deployment information for routers configured in a given organization, including all address families** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-routers-deployments - - - 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 - 50. Default is 20. - - 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 router deployments by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter router deployments by serial. This filter uses multiple exact matches. - - switchNames (array): Optional parameter to filter router deployments by switch name. The filter uses multiple exact matches. - - asNumbers (array): Optional parameter to filter router deployments by autonomous system number. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter router deployments by router ID. This filter uses multiple exact matches. - - switchStackIds (array): Optional parameter to filter router deployments by switch stack id. This filter uses multiple exact matches. - - afi (string): Optional parameter to filter deployments on each router by address family identifier (AFI). - - safi (string): Optional parameter to filter deployments on each router by subsequent address family identifier (SAFI). - """ - - kwargs.update(locals()) - - if "afi" in kwargs: - options = ["ipv4"] - assert kwargs["afi"] in options, f'''"afi" cannot be "{kwargs["afi"]}", & must be set to one of: {options}''' - if "safi" in kwargs: - options = ["unicast"] - assert kwargs["safi"] in options, f'''"safi" cannot be "{kwargs["safi"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "routers", "deployments"], - "operation": "getOrganizationSwitchRoutingBgpRoutersDeployments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/routers/deployments" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - "switchNames", - "asNumbers", - "routerIds", - "switchStackIds", - "afi", - "safi", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "switchNames", - "asNumbers", - "routerIds", - "switchStackIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpRoutersDeployments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpRoutersOverviewByRouter( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the overview of the routers configured in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-routers-overview-by-router - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 router overviews by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter router overviews by serial. This filter uses multiple exact matches. - - switchNames (array): Optional parameter to filter router overviews by switch name. This filter uses multiple exact matches. - - asNumbers (array): Optional parameter to filter router overviews by autonomous system number. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter router overviews by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "routing", "bgp", "routers", "overview", "byRouter"], - "operation": "getOrganizationSwitchRoutingBgpRoutersOverviewByRouter", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/routers/overview/byRouter" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - "switchNames", - "asNumbers", - "routerIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "switchNames", - "asNumbers", - "routerIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpRoutersOverviewByRouter: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchRoutingBgpRoutersPeersDeploy( - self, organizationId: str, addressFamily: dict, peerGroups: list, router: dict, **kwargs - ): - """ - **Create and update listen ranges, update peers' enabled flag, and delete peer groups for a BGP router** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-routers-peers-deploy - - - organizationId (string): Organization ID - - addressFamily (object): Information regarding the address family - - peerGroups (array): Information regarding the peer group peers for a router's peer group - - router (object): Information regarding the BPG router - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "routers", "peers", "deploy"], - "operation": "createOrganizationSwitchRoutingBgpRoutersPeersDeploy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/routers/peers/deploy" - - body_params = [ - "addressFamily", - "peerGroups", - "router", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchRoutingBgpRoutersPeersDeploy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def deleteOrganizationSwitchRoutingBgpRouter(self, organizationId: str, routerId: str): - """ - **Delete a router from an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-routing-bgp-router - - - organizationId (string): Organization ID - - routerId (string): Router ID - """ - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "routers"], - "operation": "deleteOrganizationSwitchRoutingBgpRouter", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - routerId = urllib.parse.quote(str(routerId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/routers/{routerId}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchRoutingStaticRoutes(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List layer 3 static routes for switches within an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-static-routes - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter the result set by the included set of network IDs - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 20. - - 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": ["switch", "monitor", "routing", "staticRoutes"], - "operation": "getOrganizationSwitchRoutingStaticRoutes", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/staticRoutes" - - query_params = [ - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingStaticRoutes: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchSpanningTree(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Returns Spanning Tree configuration settings** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-spanning-tree - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter by network ID. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "spanningTree"], - "operation": "getOrganizationSwitchSpanningTree", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/spanningTree" - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSwitchSpanningTree: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchStacksPortsMirrorsByStack(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the port mirror configurations in an organization by switch** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-stacks-ports-mirrors-by-stack - - - 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 - - ids (array): Return the port mirror configuration for the specified stack(s) - - networkIds (array): Return the port mirror configurations for the specified network(s) - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. - - 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": ["switch", "configure", "stacks", "ports", "mirrors", "byStack"], - "operation": "getOrganizationSwitchStacksPortsMirrorsByStack", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/stacks/ports/mirrors/byStack" - - query_params = [ - "ids", - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "ids", - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchStacksPortsMirrorsByStack: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationSwitchPortsUsageHistoryByDeviceByInterval: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) diff --git a/meraki/aio/api/users.py b/meraki/aio/api/users.py deleted file mode 100644 index c65a5ec..0000000 --- a/meraki/aio/api/users.py +++ /dev/null @@ -1,838 +0,0 @@ -import urllib - - -class AsyncUsers: - def __init__(self, session): - super().__init__() - self._session = session - - def getOrganizationIamUsersAuthorizations( - self, organizationId: str, userIds: list, total_pages=1, direction="next", **kwargs - ): - """ - **List specific authorizations for the list of Meraki end users.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-authorizations - - - organizationId (string): Organization ID - - userIds (array): Meraki end user IDs - - 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 - 50. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "authorizations"], - "operation": "getOrganizationIamUsersAuthorizations", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "userIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "userIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationIamUsersAuthorizations: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationIamUsersAuthorization(self, organizationId: str, authZone: dict, **kwargs): - """ - **Authorize a Meraki end user for an auth zone.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-authorization - - - organizationId (string): Organization ID - - authZone (object): Auth zone - - email (string): Meraki end user's email - - idpUserId (string): Meraki end user's ID - - startsAt (string): Start time of the desired access for the authorization. Defaults to now. - - expiresAt (string): Expiration time of the desired access for the authorization - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "authorizations"], - "operation": "createOrganizationIamUsersAuthorization", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations" - - body_params = [ - "email", - "idpUserId", - "authZone", - "startsAt", - "expiresAt", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationIamUsersAuthorization: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationIamUsersAuthorizations(self, organizationId: str, **kwargs): - """ - **Update a Meraki end user's access to an auth zone.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-iam-users-authorizations - - - organizationId (string): Organization ID - - authorizationId (string): Authorization ID - - email (string): Meraki end user's email - - authZone (object): Auth zone - - startsAt (string): Start time of the desired access for the authorization - - expiresAt (string): Expiration time of the desired access for the authorization - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "authorizations"], - "operation": "updateOrganizationIamUsersAuthorizations", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations" - - body_params = [ - "authorizationId", - "email", - "authZone", - "startsAt", - "expiresAt", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationIamUsersAuthorizations: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def revokeOrganizationIamUsersAuthorizationsAuthorization(self, organizationId: str, authZone: dict, **kwargs): - """ - **Revoke a Meraki end user's access to an auth zone.** - https://developer.cisco.com/meraki/api-v1/#!revoke-organization-iam-users-authorizations-authorization - - - organizationId (string): Organization ID - - authZone (object): Auth zone - - email (string): Meraki end user's email - - authorizationId (string): Authorization ID - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "authorizations", "authorization"], - "operation": "revokeOrganizationIamUsersAuthorizationsAuthorization", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations/authorization/revoke" - - body_params = [ - "email", - "authorizationId", - "authZone", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"revokeOrganizationIamUsersAuthorizationsAuthorization: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationIamUsersAuthorizationsZones(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List all of the available auth zones for an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-authorizations-zones - - - 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 10 - 1000. Default is 100. - - 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": ["users", "configure", "iam", "authorizations", "zones"], - "operation": "getOrganizationIamUsersAuthorizationsZones", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations/zones" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationIamUsersAuthorizationsZones: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def deleteOrganizationIamUsersAuthorization(self, organizationId: str, authorizationId: str): - """ - **Delete an authorization for a Meraki end user.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-iam-users-authorization - - - organizationId (string): Organization ID - - authorizationId (string): Authorization ID - """ - - metadata = { - "tags": ["users", "configure", "iam", "authorizations"], - "operation": "deleteOrganizationIamUsersAuthorization", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - authorizationId = urllib.parse.quote(str(authorizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations/{authorizationId}" - - return self._session.delete(metadata, resource) - - def createOrganizationIamUsersIdp(self, organizationId: str, name: str, type: str, idpConfig: dict, **kwargs): - """ - **Create an identity provider for an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-idp - - - organizationId (string): Organization ID - - name (string): Name of the identity provider - - type (string): Type of the identity provider - - idpConfig (object): Identity provider configuration. Required for external identity providers. - - description (string): Optional. Description of the identity provider - - syncType (string): The synchronization method for the identity provider. Set to 'proactive' to sync all users and groups from your identity provider. - """ - - kwargs.update(locals()) - - if "type" in kwargs: - options = ["Azure AD"] - assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' - if "syncType" in kwargs and kwargs["syncType"] is not None: - options = ["proactive"] - assert kwargs["syncType"] in options, ( - f'''"syncType" cannot be "{kwargs["syncType"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["users", "configure", "iam", "idps"], - "operation": "createOrganizationIamUsersIdp", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps" - - body_params = [ - "name", - "type", - "description", - "idpConfig", - "syncType", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationIamUsersIdp: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def searchOrganizationIdpGroups(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Search all IdP groups for an organization** - https://developer.cisco.com/meraki/api-v1/#!search-organization-idp-groups - - - 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 - - idpIds (array): Filter IdP groups by IdP ID(s). Multiple IdP IDs can be passed as a comma separated list. - - authZone (object): Auth zone - - searchQuery (string): Fuzzy filter by group name - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "idps", "groups", "search"], - "operation": "searchOrganizationIdpGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/groups/search" - - body_params = [ - "idpIds", - "authZone", - "searchQuery", - "perPage", - "startingAfter", - "endingBefore", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"searchOrganizationIdpGroups: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationIamUsersIdpsProductIntegrations(self, organizationId: str): - """ - **List all available IdP Product Integration urls for the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-idps-product-integrations - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["users", "configure", "iam", "idps", "productIntegrations"], - "operation": "getOrganizationIamUsersIdpsProductIntegrations", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/productIntegrations" - - return self._session.get(metadata, resource) - - def createOrganizationIamUsersIdpsSearch(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Search all IdPs for an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-idps-search - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - idpIds (array): Filter identity providers by id(s). Multiple ids can be passed as a comma separated list. - - type (string): Filter identity providers by idp type. - - authZone (object): Filter by auth zone - """ - - kwargs.update(locals()) - - if "type" in kwargs: - options = ["Azure AD"] - assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["users", "configure", "iam", "idps", "search"], - "operation": "createOrganizationIamUsersIdpsSearch", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/search" - - body_params = [ - "perPage", - "startingAfter", - "endingBefore", - "idpIds", - "type", - "authZone", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationIamUsersIdpsSearch: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationIamUsersIdpsSyncHistory(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get the IdP sync status records for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-idps-sync-history - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - idpId (string): Identity provider ID. Optional. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "idps", "sync", "history"], - "operation": "getOrganizationIamUsersIdpsSyncHistory", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/sync/history" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "idpId", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationIamUsersIdpsSyncHistory: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationIamUsersIdpsSyncLatest(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get the latest IdP sync status records for all IdPs in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-idps-sync-latest - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - idpIds (array): Identity provider IDs. Optional. - - authZoneId (string): Auth Zone ID - - authZoneType (string): Auth Zone type - """ - - kwargs.update(locals()) - - if "authZoneType" in kwargs: - options = ["access_policy", "node_group", "product", "ssid"] - assert kwargs["authZoneType"] in options, ( - f'''"authZoneType" cannot be "{kwargs["authZoneType"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["users", "configure", "iam", "idps", "sync", "latest"], - "operation": "getOrganizationIamUsersIdpsSyncLatest", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/sync/latest" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "idpIds", - "authZoneId", - "authZoneType", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "idpIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationIamUsersIdpsSyncLatest: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationIamUsersIdpsTestConnectivity(self, organizationId: str, **kwargs): - """ - **Test connectivity to an Entra ID identity provider.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-idps-test-connectivity - - - organizationId (string): Organization ID - - idpId (string): Id of the identity provider - - idpConfig (object): Identity provider configuration. Required for external identity providers. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "idps", "testConnectivity"], - "operation": "createOrganizationIamUsersIdpsTestConnectivity", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/testConnectivity" - - body_params = [ - "idpId", - "idpConfig", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationIamUsersIdpsTestConnectivity: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def createOrganizationIamUsersIdpsUser(self, organizationId: str, **kwargs): - """ - **Create a Meraki user** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-idps-user - - - organizationId (string): Organization ID - - displayName (string): A human-readable identifier for the created user. - - email (string): An email address identified with the user. - - password (string): The password for the user account. - - sendPassword (boolean): If true, sends an email with the password to the user. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "idps"], - "operation": "createOrganizationIamUsersIdpsUser", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/users" - - body_params = [ - "displayName", - "email", - "password", - "sendPassword", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationIamUsersIdpsUser: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def updateOrganizationIamUsersIdpsUser(self, organizationId: str, id: str, **kwargs): - """ - **Update a Meraki user** - https://developer.cisco.com/meraki/api-v1/#!update-organization-iam-users-idps-user - - - organizationId (string): Organization ID - - id (string): ID - - displayName (string): A human-readable identifier for the created user. - - email (string): An email address identified with the user. - - password (string): The password for the user account. - - sendPassword (boolean): If true, sends an email with the password to the user. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "idps"], - "operation": "updateOrganizationIamUsersIdpsUser", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/users/{id}" - - body_params = [ - "displayName", - "email", - "password", - "sendPassword", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationIamUsersIdpsUser: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationIamUsersIdpsUser(self, organizationId: str, id: str): - """ - **Delete a Meraki end user** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-iam-users-idps-user - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["users", "configure", "iam", "idps"], - "operation": "deleteOrganizationIamUsersIdpsUser", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/users/{id}" - - return self._session.delete(metadata, resource) - - def createOrganizationIamUsersIdpSync(self, organizationId: str, idpId: str, **kwargs): - """ - **Trigger an IdP sync for an identity provider** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-idp-sync - - - organizationId (string): Organization ID - - idpId (string): Idp ID - - emails (array): List of emails to sync - - force (boolean): Force a complete sync of all users and groups - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "idps", "sync"], - "operation": "createOrganizationIamUsersIdpSync", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - idpId = urllib.parse.quote(str(idpId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/{idpId}/sync" - - body_params = [ - "emails", - "force", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationIamUsersIdpSync: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationIamUsersIdpSyncLatest(self, organizationId: str, idpId: str): - """ - **Get the latest IdP sync status for an identity provider** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-idp-sync-latest - - - organizationId (string): Organization ID - - idpId (string): Idp ID - """ - - metadata = { - "tags": ["users", "configure", "iam", "idps", "sync", "latest"], - "operation": "getOrganizationIamUsersIdpSyncLatest", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - idpId = urllib.parse.quote(str(idpId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/{idpId}/sync/latest" - - return self._session.get(metadata, resource) - - def updateOrganizationIamUsersIdp(self, organizationId: str, id: str, **kwargs): - """ - **Update an identity provider** - https://developer.cisco.com/meraki/api-v1/#!update-organization-iam-users-idp - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of the identity provider - - description (string): Description of the identity provider - - idpConfig (object): Identity provider configuration. You can update individual attributes - - syncType (string): The synchronization method for the identity provider. Set to 'proactive' to sync all users and groups from your identity provider. Set to 'null' for on-demand user and group provisioning. - """ - - kwargs.update(locals()) - - if "syncType" in kwargs and kwargs["syncType"] is not None: - options = ["proactive"] - assert kwargs["syncType"] in options, ( - f'''"syncType" cannot be "{kwargs["syncType"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["users", "configure", "iam", "idps"], - "operation": "updateOrganizationIamUsersIdp", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/{id}" - - body_params = [ - "name", - "description", - "idpConfig", - "syncType", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationIamUsersIdp: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationIamUsersIdp(self, organizationId: str, id: str): - """ - **Delete a identity provider from an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-iam-users-idp - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["users", "configure", "iam", "idps"], - "operation": "deleteOrganizationIamUsersIdp", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationIamUsersIdpAuthZones(self, organizationId: str, id: str): - """ - **List all auth zones for an identity provider** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-idp-auth-zones - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["users", "configure", "iam", "idps", "authZones"], - "operation": "getOrganizationIamUsersIdpAuthZones", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/{id}/authZones" - - return self._session.get(metadata, resource) - - def searchOrganizationUsers(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the end users and their associated identity providers for an organization.** - https://developer.cisco.com/meraki/api-v1/#!search-organization-users - - - 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 - 50. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - userIds (array): Filter end users by id(s). - - idpIds (array): Filter by identity provider id(s). - - groupIds (array): Filter by identity provider group id(s). - - accessTypes (array): Filter by access type(s). - - searchQuery (string): Fuzzy filter by display name, user name and email. - - statuses (array): Filter by user status(es). - - sortKey (string): Optional parameter to specify the field used to sort results. (default: username) - - sortOrder (string): Optional parameter to specify the sort order. (default: asc) - """ - - kwargs.update(locals()) - - if "sortKey" in kwargs: - options = ["created_at", "updated_at", "username"] - assert kwargs["sortKey"] in options, ( - f'''"sortKey" cannot be "{kwargs["sortKey"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["users", "configure", "iam", "search"], - "operation": "searchOrganizationUsers", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/search" - - body_params = [ - "perPage", - "startingAfter", - "endingBefore", - "userIds", - "idpIds", - "groupIds", - "accessTypes", - "searchQuery", - "statuses", - "sortKey", - "sortOrder", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"searchOrganizationUsers: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationIamUsersSummaryPanel(self, organizationId: str): - """ - **Get the count of users and user groups for an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-summary-panel - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["users", "configure", "iam", "summaryPanel"], - "operation": "getOrganizationIamUsersSummaryPanel", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/summaryPanel" - - return self._session.get(metadata, resource) diff --git a/meraki/aio/api/wireless.py b/meraki/aio/api/wireless.py index 756d981..b9ece30 100644 --- a/meraki/aio/api/wireless.py +++ b/meraki/aio/api/wireless.py @@ -68,7 +68,6 @@ def updateDeviceWirelessBluetoothSettings(self, serial: str, **kwargs): Dashboard's automatically generated value. - minor (integer): Desired minor value of the beacon. If the value is set to null it will reset to Dashboard's automatically generated value. - - transmit (object): Transmit settings including power, interval, and advertised power. """ kwargs.update(locals()) @@ -84,7 +83,6 @@ def updateDeviceWirelessBluetoothSettings(self, serial: str, **kwargs): "uuid", "major", "minor", - "transmit", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -198,23 +196,6 @@ def updateDeviceWirelessElectronicShelfLabel(self, serial: str, **kwargs): return self._session.put(metadata, resource, payload) - def getDeviceWirelessHealthScores(self, serial: str): - """ - **Fetch the health scores for a given AP on this network** - https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-health-scores - - - serial (string): Serial - """ - - metadata = { - "tags": ["wireless", "monitor", "healthScores"], - "operation": "getDeviceWirelessHealthScores", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/healthScores" - - return self._session.get(metadata, resource) - def getDeviceWirelessLatencyStats(self, serial: str, **kwargs): """ **Aggregated latency info for a given AP on this network** @@ -267,123 +248,6 @@ def getDeviceWirelessLatencyStats(self, serial: str, **kwargs): return self._session.get(metadata, resource, params) - def getDeviceWirelessRadioAfcPosition(self, serial: str): - """ - **Return the position for a wireless device** - https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-radio-afc-position - - - serial (string): Serial - """ - - metadata = { - "tags": ["wireless", "configure", "radio", "afc", "position"], - "operation": "getDeviceWirelessRadioAfcPosition", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/radio/afc/position" - - return self._session.get(metadata, resource) - - def updateDeviceWirelessRadioAfcPosition(self, serial: str, **kwargs): - """ - **Update the position attributes for this device** - https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-radio-afc-position - - - serial (string): Serial - - height (object): Height attributes - - gps (object): GPS attributes - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "radio", "afc", "position"], - "operation": "updateDeviceWirelessRadioAfcPosition", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/radio/afc/position" - - body_params = [ - "height", - "gps", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateDeviceWirelessRadioAfcPosition: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getDeviceWirelessRadioAfcPowerLimits(self, serial: str): - """ - **Return the AFC power limits for a wireless device** - https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-radio-afc-power-limits - - - serial (string): Serial - """ - - metadata = { - "tags": ["wireless", "configure", "radio", "afc", "powerLimits"], - "operation": "getDeviceWirelessRadioAfcPowerLimits", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/radio/afc/powerLimits" - - return self._session.get(metadata, resource) - - def getDeviceWirelessRadioOverrides(self, serial: str): - """ - **Return the radio overrides of a device** - https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-radio-overrides - - - serial (string): Serial - """ - - metadata = { - "tags": ["wireless", "configure", "radio", "overrides"], - "operation": "getDeviceWirelessRadioOverrides", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/radio/overrides" - - return self._session.get(metadata, resource) - - def updateDeviceWirelessRadioOverrides(self, serial: str, **kwargs): - """ - **Update 2.4 GHz, 5 GHz, and 6 GHz radio settings (channel, channel width, power, and enable/disable) that override RF profiles.** - https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-radio-overrides - - - serial (string): Serial - - rfProfile (object): This device's RF profile - - radios (array): Radio overrides. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "radio", "overrides"], - "operation": "updateDeviceWirelessRadioOverrides", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/radio/overrides" - - body_params = [ - "rfProfile", - "radios", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateDeviceWirelessRadioOverrides: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def getDeviceWirelessRadioSettings(self, serial: str): """ **Return the manually configured radio settings overrides of a device, which take precedence over RF profiles.** @@ -436,23 +300,6 @@ def updateDeviceWirelessRadioSettings(self, serial: str, **kwargs): return self._session.put(metadata, resource, payload) - def getDeviceWirelessRadioStatus(self, serial: str): - """ - **Show the status of this device's radios** - https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-radio-status - - - serial (string): Serial - """ - - metadata = { - "tags": ["wireless", "configure", "radio", "status"], - "operation": "getDeviceWirelessRadioStatus", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/radio/status" - - return self._session.get(metadata, resource) - def getDeviceWirelessStatus(self, serial: str): """ **Return the SSID statuses of an access point** @@ -808,7 +655,6 @@ def updateNetworkWirelessBluetoothSettings(self, networkId: str, **kwargs): - majorMinorAssignmentMode (string): The way major and minor number should be assigned to nodes in the network. ('Unique', 'Non-unique') - major (integer): The major number to be used in the beacon identifier. Only valid in 'Non-unique' mode. - minor (integer): The minor number to be used in the beacon identifier. Only valid in 'Non-unique' mode. - - transmit (object): Transmit settings. """ kwargs.update(locals()) @@ -833,7 +679,6 @@ def updateNetworkWirelessBluetoothSettings(self, networkId: str, **kwargs): "majorMinorAssignmentMode", "major", "minor", - "transmit", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1003,23 +848,6 @@ def getNetworkWirelessClientsConnectionStats(self, networkId: str, **kwargs): return self._session.get(metadata, resource, params) - def getNetworkWirelessClientsHealthScores(self, networkId: str): - """ - **Fetch the health scores for all clients on this network** - https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-clients-health-scores - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["wireless", "monitor", "clients", "healthScores"], - "operation": "getNetworkWirelessClientsHealthScores", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/clients/healthScores" - - return self._session.get(metadata, resource) - def getNetworkWirelessClientsLatencyStats(self, networkId: str, **kwargs): """ **Aggregated latency info for this network, grouped by clients** @@ -1074,53 +902,6 @@ def getNetworkWirelessClientsLatencyStats(self, networkId: str, **kwargs): return self._session.get(metadata, resource, params) - def getNetworkWirelessClientsOnboardingHistory(self, networkId: str, **kwargs): - """ - **Return counts of distinct wireless clients connecting to a network over time** - https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-clients-onboarding-history - - - networkId (string): Network ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 7 days. - - resolution (integer): The time resolution in seconds for returned data. The valid resolutions are: 300. The default is 300. - - band (string): Filter results by band (either '2.4', '5' or '6'); this cannot be combined with the SSID filter. - - ssid (integer): Filter results by SSID number; this cannot be combined with the band filter. - """ - - kwargs.update(locals()) - - if "band" in kwargs: - options = ["2.4", "5", "6"] - assert kwargs["band"] in options, f'''"band" cannot be "{kwargs["band"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["wireless", "monitor", "clients", "onboardingHistory"], - "operation": "getNetworkWirelessClientsOnboardingHistory", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/clients/onboardingHistory" - - query_params = [ - "t0", - "t1", - "timespan", - "resolution", - "band", - "ssid", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getNetworkWirelessClientsOnboardingHistory: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - def getNetworkWirelessClientConnectionStats(self, networkId: str, clientId: str, **kwargs): """ **Aggregated connectivity info for a given client on this network** @@ -1257,25 +1038,6 @@ def getNetworkWirelessClientConnectivityEvents( return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getNetworkWirelessClientHealthScores(self, networkId: str, clientId: str): - """ - **Fetch the health scores for a given client on this network** - https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-client-health-scores - - - networkId (string): Network ID - - clientId (string): Client ID - """ - - metadata = { - "tags": ["wireless", "monitor", "clients", "healthScores"], - "operation": "getNetworkWirelessClientHealthScores", - } - networkId = urllib.parse.quote(str(networkId), safe="") - clientId = urllib.parse.quote(str(clientId), safe="") - resource = f"/networks/{networkId}/wireless/clients/{clientId}/healthScores" - - return self._session.get(metadata, resource) - def getNetworkWirelessClientLatencyHistory(self, networkId: str, clientId: str, **kwargs): """ **Return the latency history for a client** @@ -1371,53 +1133,6 @@ def getNetworkWirelessClientLatencyStats(self, networkId: str, clientId: str, ** return self._session.get(metadata, resource, params) - def getNetworkWirelessClientRoamingHistory(self, networkId: str, clientId: str, total_pages=1, direction="next", **kwargs): - """ - **Get client roam events within the specified timespan.** - https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-client-roaming-history - - - networkId (string): Network ID - - clientId (string): Client ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "clients", "roaming", "history"], - "operation": "getNetworkWirelessClientRoamingHistory", - } - networkId = urllib.parse.quote(str(networkId), safe="") - clientId = urllib.parse.quote(str(clientId), safe="") - resource = f"/networks/{networkId}/wireless/clients/{clientId}/roaming/history" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getNetworkWirelessClientRoamingHistory: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getNetworkWirelessConnectionStats(self, networkId: str, **kwargs): """ **Aggregated connectivity info for this network** @@ -1569,23 +1284,6 @@ def getNetworkWirelessDevicesConnectionStats(self, networkId: str, **kwargs): return self._session.get(metadata, resource, params) - def getNetworkWirelessDevicesHealthScores(self, networkId: str): - """ - **Fetch the health scores of all APs on this network** - https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-devices-health-scores - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["wireless", "monitor", "devices", "healthScores"], - "operation": "getNetworkWirelessDevicesHealthScores", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/devices/healthScores" - - return self._session.get(metadata, resource) - def getNetworkWirelessDevicesLatencyStats(self, networkId: str, **kwargs): """ **Aggregated latency info for this network, grouped by node** @@ -1741,7 +1439,6 @@ def createNetworkWirelessEthernetPortsProfile(self, networkId: str, name: str, p - name (string): AP port profile name - ports (array): AP ports configuration - usbPorts (array): AP usb ports configuration - - security (object): AP port security configuration """ kwargs.update(locals()) @@ -1757,7 +1454,6 @@ def createNetworkWirelessEthernetPortsProfile(self, networkId: str, name: str, p "name", "ports", "usbPorts", - "security", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1868,7 +1564,6 @@ def updateNetworkWirelessEthernetPortsProfile(self, networkId: str, profileId: s - name (string): AP port profile name - ports (array): AP ports configuration - usbPorts (array): AP usb ports configuration - - security (object): AP port security configuration """ kwargs.update(locals()) @@ -1885,7 +1580,6 @@ def updateNetworkWirelessEthernetPortsProfile(self, networkId: str, profileId: s "name", "ports", "usbPorts", - "security", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2117,41 +1811,6 @@ def updateNetworkWirelessLocationScanning(self, networkId: str, **kwargs): return self._session.put(metadata, resource, payload) - def updateNetworkWirelessLocationWayfinding(self, networkId: str, **kwargs): - """ - **Change client wayfinding settings** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-location-wayfinding - - - networkId (string): Network ID - - enabled (boolean): Whether to enable client wayfinding on that network (only supported on Wireless networks). - - maintenanceWindow (object): Maintenance window during which optimization might take place to improve location accuracy. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "location", "wayfinding"], - "operation": "updateNetworkWirelessLocationWayfinding", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/location/wayfinding" - - body_params = [ - "enabled", - "maintenanceWindow", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateNetworkWirelessLocationWayfinding: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - def getNetworkWirelessMeshStatuses(self, networkId: str, total_pages=1, direction="next", **kwargs): """ **List wireless mesh statuses for repeaters** @@ -2189,26 +1848,32 @@ def getNetworkWirelessMeshStatuses(self, networkId: str, total_pages=1, directio return self._session.get_pages(metadata, resource, params, total_pages, direction) - def updateNetworkWirelessOpportunisticPcap(self, networkId: str, **kwargs): + def updateNetworkWirelessRadioRrm(self, networkId: str, **kwargs): """ - **Update the Opportunistic Pcap settings for a wireless network** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-opportunistic-pcap + **Update the AutoRF settings for a wireless network** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-radio-rrm - networkId (string): Network ID - - enablement (object): Enablement settings + - busyHour (object): Busy Hour settings + - channel (object): Channel settings + - fra (object): FRA settings + - ai (object): AI settings """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "opportunisticPcap"], - "operation": "updateNetworkWirelessOpportunisticPcap", + "tags": ["wireless", "configure", "radio", "rrm"], + "operation": "updateNetworkWirelessRadioRrm", } networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/opportunisticPcap" + resource = f"/networks/{networkId}/wireless/radio/rrm" body_params = [ - "enablement", + "busyHour", + "channel", + "fra", + "ai", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2216,90 +1881,14 @@ def updateNetworkWirelessOpportunisticPcap(self, networkId: str, **kwargs): all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning( - f"updateNetworkWirelessOpportunisticPcap: ignoring unrecognized kwargs: {invalid}" - ) + self._session._logger.warning(f"updateNetworkWirelessRadioRrm: ignoring unrecognized kwargs: {invalid}") return self._session.put(metadata, resource, payload) - def updateNetworkWirelessRadioAutoRf(self, networkId: str, **kwargs): + def getNetworkWirelessRfProfiles(self, networkId: str, **kwargs): """ - **Update the AutoRF settings for a wireless network** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-radio-auto-rf - - - networkId (string): Network ID - - busyHour (object): Busy Hour settings - - channel (object): Channel settings - - fra (object): FRA settings - - aiRrm (object): AI-RRM settings - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "radio", "autoRf"], - "operation": "updateNetworkWirelessRadioAutoRf", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/radio/autoRf" - - body_params = [ - "busyHour", - "channel", - "fra", - "aiRrm", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkWirelessRadioAutoRf: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def updateNetworkWirelessRadioRrm(self, networkId: str, **kwargs): - """ - **Update the AutoRF settings for a wireless network** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-radio-rrm - - - networkId (string): Network ID - - busyHour (object): Busy Hour settings - - channel (object): Channel settings - - fra (object): FRA settings - - ai (object): AI settings - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "radio", "rrm"], - "operation": "updateNetworkWirelessRadioRrm", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/radio/rrm" - - body_params = [ - "busyHour", - "channel", - "fra", - "ai", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkWirelessRadioRrm: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getNetworkWirelessRfProfiles(self, networkId: str, **kwargs): - """ - **List RF profiles for this network** - https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-rf-profiles + **List RF profiles for this network** + https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-rf-profiles - networkId (string): Network ID - includeTemplateProfiles (boolean): If the network is bound to a template, this parameter controls whether or not the non-basic RF profiles defined on the template should be included in the response alongside the non-basic profiles defined on the bound network. Defaults to false. @@ -2344,7 +1933,6 @@ def createNetworkWirelessRfProfile(self, networkId: str, name: str, bandSelectio - transmission (object): Settings related to radio transmission. - perSsidSettings (object): Per-SSID radio settings by number. - flexRadios (object): Flex radio settings. - - dot11be (object): 802.11be settings """ kwargs.update(locals()) @@ -2379,7 +1967,6 @@ def createNetworkWirelessRfProfile(self, networkId: str, name: str, bandSelectio "transmission", "perSsidSettings", "flexRadios", - "dot11be", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2411,7 +1998,6 @@ def updateNetworkWirelessRfProfile(self, networkId: str, rfProfileId: str, **kwa - transmission (object): Settings related to radio transmission. - perSsidSettings (object): Per-SSID radio settings by number. - flexRadios (object): Flex radio settings. - - dot11be (object): 802.11be settings """ kwargs.update(locals()) @@ -2449,7 +2035,6 @@ def updateNetworkWirelessRfProfile(self, networkId: str, rfProfileId: str, **kwa "transmission", "perSsidSettings", "flexRadios", - "dot11be", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2667,7 +2252,6 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - number (string): Number - name (string): The name of the SSID - enabled (boolean): Whether or not the SSID is enabled - - localAuth (boolean): Extended local auth flag for Enterprise NAC - authMode (string): The association control method for the SSID ('open', 'open-enhanced', 'psk', 'open-with-radius', 'open-enhanced-with-radius', 'open-with-nac', '8021x-meraki', '8021x-nac', '8021x-radius', '8021x-google', '8021x-entra', '8021x-localradius', 'ipsk-with-radius', 'ipsk-without-radius', 'ipsk-with-nac' or 'ipsk-with-radius-easy-psk') - enterpriseAdminAccess (string): Whether or not an SSID is accessible by 'enterprise' administrators ('access disabled' or 'access enabled') - ssidAdminAccessible (boolean): SSID Administrator access status @@ -2699,7 +2283,6 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - radiusAccountingInterimInterval (integer): The interval (in seconds) in which accounting information is updated and sent to the RADIUS accounting server. - radiusAttributeForGroupPolicies (string): Specify the RADIUS attribute used to look up group policies ('Filter-Id', 'Reply-Message', 'Airespace-ACL-Name' or 'Aruba-User-Role'). Access points must receive this attribute in the RADIUS Access-Accept message - ipAssignmentMode (string): The client IP assignment mode ('NAT mode', 'Bridge mode', 'Layer 3 roaming', 'Ethernet over GRE', 'Layer 3 roaming with a concentrator', 'VPN' or 'Campus Gateway') - - campusGateway (object): Campus gateway settings - useVlanTagging (boolean): Whether or not traffic should be directed to use specific VLANs. This param is only valid if the ipAssignmentMode is 'Bridge mode' or 'Layer 3 roaming' - concentratorNetworkId (string): The concentrator to use when the ipAssignmentMode is 'Layer 3 roaming with a concentrator' or 'VPN'. - secondaryConcentratorNetworkId (string): The secondary concentrator to use when the ipAssignmentMode is 'VPN'. If configured, the APs will switch to using this concentrator if the primary concentrator is unreachable. This param is optional. ('disabled' represents no secondary concentrator.) @@ -2821,7 +2404,6 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): body_params = [ "name", "enabled", - "localAuth", "authMode", "enterpriseAdminAccess", "ssidAdminAccessible", @@ -2853,7 +2435,6 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): "radiusAccountingInterimInterval", "radiusAttributeForGroupPolicies", "ipAssignmentMode", - "campusGateway", "useVlanTagging", "concentratorNetworkId", "secondaryConcentratorNetworkId", @@ -3436,154 +3017,6 @@ def updateNetworkWirelessSsidOpenRoaming(self, networkId: str, number: str, **kw return self._session.put(metadata, resource, payload) - def updateNetworkWirelessSsidPoliciesClientExclusion(self, networkId: str, number: str, **kwargs): - """ - **Update the client exclusion status configuration for a given SSID** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ssid-policies-client-exclusion - - - networkId (string): Network ID - - number (string): Number - - static (object): Static client exclusion status - - dynamic (object): Dynamic client exclusion configuration - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "ssids", "policies", "clientExclusion"], - "operation": "updateNetworkWirelessSsidPoliciesClientExclusion", - } - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/wireless/ssids/{number}/policies/clientExclusion" - - body_params = [ - "static", - "dynamic", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateNetworkWirelessSsidPoliciesClientExclusion: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def updateNetworkWirelessSsidPoliciesClientExclusionStaticExclusions( - self, networkId: str, number: str, macs: list, **kwargs - ): - """ - **Replace the static client exclusion list for the given SSID (use PUT /exclusions)** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ssid-policies-client-exclusion-static-exclusions - - - networkId (string): Network ID - - number (string): Number - - macs (array): MAC addresses to set as static exclusion list - """ - - kwargs = locals() - - metadata = { - "tags": ["wireless", "configure", "ssids", "policies", "clientExclusion", "static", "exclusions"], - "operation": "updateNetworkWirelessSsidPoliciesClientExclusionStaticExclusions", - } - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/wireless/ssids/{number}/policies/clientExclusion/static/exclusions" - - body_params = [ - "macs", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateNetworkWirelessSsidPoliciesClientExclusionStaticExclusions: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def createNetworkWirelessSsidPoliciesClientExclusionStaticExclusionsBulkAdd( - self, networkId: str, number: str, macs: list, **kwargs - ): - """ - **Add MAC addresses to the existing static client exclusion list for the given SSID (use POST /bulkAdd)** - https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-ssid-policies-client-exclusion-static-exclusions-bulk-add - - - networkId (string): Network ID - - number (string): Number - - macs (array): MAC addresses to add to static exclusion - """ - - kwargs = locals() - - metadata = { - "tags": ["wireless", "configure", "ssids", "policies", "clientExclusion", "static", "exclusions", "bulkAdd"], - "operation": "createNetworkWirelessSsidPoliciesClientExclusionStaticExclusionsBulkAdd", - } - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/wireless/ssids/{number}/policies/clientExclusion/static/exclusions/bulkAdd" - - body_params = [ - "macs", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createNetworkWirelessSsidPoliciesClientExclusionStaticExclusionsBulkAdd: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def createNetworkWirelessSsidPoliciesClientExclusionStaticExclusionsBulkRemove( - self, networkId: str, number: str, macs: list, **kwargs - ): - """ - **Remove MAC addresses from the existing static client exclusion list for the given SSID (use POST /bulkRemove)** - https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-ssid-policies-client-exclusion-static-exclusions-bulk-remove - - - networkId (string): Network ID - - number (string): Number - - macs (array): MAC addresses to remove from static exclusion - """ - - kwargs = locals() - - metadata = { - "tags": ["wireless", "configure", "ssids", "policies", "clientExclusion", "static", "exclusions", "bulkRemove"], - "operation": "createNetworkWirelessSsidPoliciesClientExclusionStaticExclusionsBulkRemove", - } - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/wireless/ssids/{number}/policies/clientExclusion/static/exclusions/bulkRemove" - - body_params = [ - "macs", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createNetworkWirelessSsidPoliciesClientExclusionStaticExclusionsBulkRemove: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - def getNetworkWirelessSsidSchedules(self, networkId: str, number: str): """ **List the outage schedule for the SSID** @@ -3672,7 +3105,6 @@ def updateNetworkWirelessSsidSplashSettings(self, networkId: str, number: str, * - redirectUrl (string): The custom redirect URL where the users will go after the splash page. - useRedirectUrl (boolean): The Boolean indicating whether the the user will be redirected to the custom redirect URL after the splash page. A custom redirect URL must be set if this is true. - welcomeMessage (string): The welcome message for the users on the splash page. - - language (string): Language of splash page. - userConsent (object): User consent settings - themeId (string): The id of the selected splash theme. - splashLogo (object): The logo used in the splash page. @@ -3694,32 +3126,6 @@ def updateNetworkWirelessSsidSplashSettings(self, networkId: str, number: str, * assert kwargs["splashTimeout"] in options, ( f'''"splashTimeout" cannot be "{kwargs["splashTimeout"]}", & must be set to one of: {options}''' ) - if "language" in kwargs: - options = [ - "DA", - "DE", - "EL", - "EN", - "ES", - "FI", - "FR", - "GL", - "IT", - "JA", - "KO", - "NL", - "NO", - "PL", - "PT", - "RU", - "SK", - "SV", - "UK", - "ZH", - ] - assert kwargs["language"] in options, ( - f'''"language" cannot be "{kwargs["language"]}", & must be set to one of: {options}''' - ) if "controllerDisconnectionBehavior" in kwargs: options = ["default", "open", "restricted"] assert kwargs["controllerDisconnectionBehavior"] in options, ( @@ -3741,7 +3147,6 @@ def updateNetworkWirelessSsidSplashSettings(self, networkId: str, number: str, * "redirectUrl", "useRedirectUrl", "welcomeMessage", - "language", "userConsent", "themeId", "splashLogo", @@ -3974,38 +3379,34 @@ def updateNetworkWirelessZigbee(self, networkId: str, **kwargs): return self._session.put(metadata, resource, payload) - def getOrganizationAssuranceConnectivityWirelessRfHealthByBand(self, organizationId: str, networkIds: list, **kwargs): + def getOrganizationWirelessAirMarshalRules(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Show the by-device RF Health score overview information for the organization in the given interval** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-connectivity-wireless-rf-health-by-band + **Returns the current Air Marshal rules for this organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-air-marshal-rules - organizationId (string): Organization ID - - networkIds (array): Networks for which information should be gathered. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 1 day. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 3600, 14400, 86400. The default is 3600. Interval is calculated if time params are provided. - - minimumRfHealthScore (integer): Minimum RF Health score for an AP to be retrieved. - - maximumRfHealthScore (integer): Maximum RF Health score for an AP to be retrieved. + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - networkIds (array): (optional) The set of network IDs to include. + - 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": ["wireless", "configure", "connectivity", "rfHealth", "byBand"], - "operation": "getOrganizationAssuranceConnectivityWirelessRfHealthByBand", + "tags": ["wireless", "configure", "airMarshal", "rules"], + "operation": "getOrganizationWirelessAirMarshalRules", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/connectivity/wireless/rfHealth/byBand" + resource = f"/organizations/{organizationId}/wireless/airMarshal/rules" query_params = [ - "t0", - "t1", - "timespan", - "interval", "networkIds", - "minimumRfHealthScore", - "maximumRfHealthScore", + "perPage", + "startingAfter", + "endingBefore", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} @@ -4022,26 +3423,23 @@ def getOrganizationAssuranceConnectivityWirelessRfHealthByBand(self, organizatio invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceConnectivityWirelessRfHealthByBand: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessAirMarshalRules: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceImpactedDeviceWirelessByNetwork( + def getOrganizationWirelessAirMarshalSettingsByNetwork( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **Returns count of impacted wireless devices per network on a given organization and time range.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-impacted-device-wireless-by-network + **Returns the current Air Marshal settings for this network** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-air-marshal-settings-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 - - networkGroupIds (array): Filter results by a list of network group IDs. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 2 hours and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 5000. Default is 1000. + - networkIds (array): The network IDs to include in the result set. + - 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. """ @@ -4049,17 +3447,14 @@ def getOrganizationAssuranceImpactedDeviceWirelessByNetwork( kwargs.update(locals()) metadata = { - "tags": ["wireless", "monitor", "impactedDevice", "byNetwork"], - "operation": "getOrganizationAssuranceImpactedDeviceWirelessByNetwork", + "tags": ["wireless", "configure", "airMarshal", "settings", "byNetwork"], + "operation": "getOrganizationWirelessAirMarshalSettingsByNetwork", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/impactedDevice/wireless/byNetwork" + resource = f"/organizations/{organizationId}/wireless/airMarshal/settings/byNetwork" query_params = [ - "networkGroupIds", - "t0", - "t1", - "timespan", + "networkIds", "perPage", "startingAfter", "endingBefore", @@ -4067,7 +3462,7 @@ def getOrganizationAssuranceImpactedDeviceWirelessByNetwork( params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "networkGroupIds", + "networkIds", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4079,29 +3474,23 @@ def getOrganizationAssuranceImpactedDeviceWirelessByNetwork( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceImpactedDeviceWirelessByNetwork: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessAirMarshalSettingsByNetwork: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationWirelessClientsOverviewByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Summarizes wireless post connection capacity successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network + **List access point client count at the moment in an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-overview-by-device - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - networkIds (array): Optional parameter to filter access points client counts by network ID. This filter uses multiple exact matches. + - serials (array): Optional parameter to filter access points client counts by its serial numbers. This filter uses multiple exact matches. + - campusGatewayClusterIds (array): Optional parameter to filter access points client counts by MCG cluster IDs. This filter uses multiple exact matches. + - 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. """ @@ -4109,20 +3498,16 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetwork( kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetwork", + "tags": ["wireless", "monitor", "clients", "overview", "byDevice"], + "operation": "getOrganizationWirelessClientsOverviewByDevice", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork" + resource = f"/organizations/{organizationId}/wireless/clients/overview/byDevice" query_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", + "campusGatewayClusterIds", "perPage", "startingAfter", "endingBefore", @@ -4132,8 +3517,7 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetwork( array_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", + "campusGatewayClusterIds", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4145,61 +3529,57 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetwork( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetwork: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessClientsOverviewByDevice: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByBand( + def getOrganizationWirelessDevicesChannelUtilizationByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **Summarizes wireless post connection capacity successes and failures by band.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network-by-band + **Get average channel utilization for all bands in a network, split by AP** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-by-device - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - serials (array): Filter results by device. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 7 days. + - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "byNetwork", "byBand"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByBand", + "tags": ["wireless", "monitor", "devices", "channelUtilization", "byDevice"], + "operation": "getOrganizationWirelessDevicesChannelUtilizationByDevice", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork/byBand" + resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/byDevice" query_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", "perPage", "startingAfter", "endingBefore", - ] + "t0", + "t1", + "timespan", + "interval", + ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4211,61 +3591,57 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByBand invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByBand: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesChannelUtilizationByDevice: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClient( + def getOrganizationWirelessDevicesChannelUtilizationByNetwork( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **Summarizes wireless post connection capacity successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network-by-client + **Get average channel utilization across all bands for all networks in the organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-by-network - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - serials (array): Filter results by device. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 7 days. + - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "byNetwork", "byClient"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClient", + "tags": ["wireless", "monitor", "devices", "channelUtilization", "byNetwork"], + "operation": "getOrganizationWirelessDevicesChannelUtilizationByNetwork", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork/byClient" + resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/byNetwork" query_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", "perPage", "startingAfter", "endingBefore", + "t0", + "t1", + "timespan", + "interval", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4277,61 +3653,57 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClie invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClient: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesChannelUtilizationByNetwork: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClientOs( + def getOrganizationWirelessDevicesChannelUtilizationHistoryByDeviceByInterval( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **Summarizes wireless post connection capacity successes and failures by client OS and driver version.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network-by-client-os + **Get a time-series of average channel utilization for all bands, segmented by device.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-history-by-device-by-interval - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - serials (array): Filter results by device. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 7 days. + - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "byNetwork", "byClientOs"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClientOs", + "tags": ["wireless", "monitor", "devices", "channelUtilization", "history", "byDevice", "byInterval"], + "operation": "getOrganizationWirelessDevicesChannelUtilizationHistoryByDeviceByInterval", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork/byClientOs" + resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/history/byDevice/byInterval" query_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", "perPage", "startingAfter", "endingBefore", + "t0", + "t1", + "timespan", + "interval", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4343,61 +3715,57 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClie invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClientOs: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesChannelUtilizationHistoryByDeviceByInterval: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClientType( + def getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **Summarizes wireless post connection capacity successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network-by-client-type + **Get a time-series of average channel utilization for all bands** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-history-by-network-by-interval - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - serials (array): Filter results by device. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 7 days. + - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "byNetwork", "byClientType"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClientType", + "tags": ["wireless", "monitor", "devices", "channelUtilization", "history", "byNetwork", "byInterval"], + "operation": "getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork/byClientType" + resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/history/byNetwork/byInterval" query_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", "perPage", "startingAfter", "endingBefore", + "t0", + "t1", + "timespan", + "interval", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4409,61 +3777,44 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClie invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClientType: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationWirelessDevicesEthernetStatuses(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Summarizes wireless post connection capacity successes and failures by device.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network-by-device + **List the most recent Ethernet link speed, duplex, aggregation and power mode and status information for wireless devices.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-ethernet-statuses - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - 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): A list of Meraki network IDs to filter results to contain only specified networks. E.g.: networkIds[]=N_12345678&networkIds[]=L_3456 """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "byNetwork", "byDevice"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByDevice", + "tags": ["wireless", "monitor", "devices", "ethernet", "statuses"], + "operation": "getOrganizationWirelessDevicesEthernetStatuses", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork/byDevice" + resource = f"/organizations/{organizationId}/wireless/devices/ethernet/statuses" query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", "perPage", "startingAfter", "endingBefore", + "networkIds", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", - "serials", - "ssidNumbers", - "bands", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4475,63 +3826,59 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByDevi invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByDevice: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesEthernetStatuses: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationWirelessDevicesPacketLossByClient(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Time-series of wireless post connection capacity successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network-by-interval + **Get average packet loss for the given timespan for all clients in the organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-client - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 14400, 86400. The default is 300. Interval is calculated if time params are provided. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - ssids (array): Filter results by SSID number. + - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. + - macs (array): Filter results by client mac address(es). + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 90 days. The default is 7 days. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "monitor", "experience", "channelAvailability", "byNetwork", "byInterval"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByInterval", + "tags": ["wireless", "monitor", "devices", "packetLoss", "byClient"], + "operation": "getOrganizationWirelessDevicesPacketLossByClient", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork/byInterval" + resource = f"/organizations/{organizationId}/wireless/devices/packetLoss/byClient" query_params = [ "networkIds", - "serials", - "ssidNumbers", + "ssids", "bands", - "t0", - "t1", - "timespan", - "interval", + "macs", "perPage", "startingAfter", "endingBefore", + "t0", + "t1", + "timespan", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", - "serials", - "ssidNumbers", + "ssids", "bands", + "macs", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4543,60 +3890,58 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByInte invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesPacketLossByClient: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationWirelessDevicesPacketLossByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Summarizes wireless post connection capacity successes and failures by ssid.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network-by-ssid + **Get average packet loss for the given timespan for all devices in the organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-device - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - serials (array): Filter results by device. + - ssids (array): Filter results by SSID number. + - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 90 days. The default is 7 days. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "byNetwork", "bySsid"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkBySsid", + "tags": ["wireless", "monitor", "devices", "packetLoss", "byDevice"], + "operation": "getOrganizationWirelessDevicesPacketLossByDevice", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork/bySsid" + resource = f"/organizations/{organizationId}/wireless/devices/packetLoss/byDevice" query_params = [ "networkIds", "serials", - "ssidNumbers", + "ssids", "bands", - "t0", - "t1", - "timespan", "perPage", "startingAfter", "endingBefore", + "t0", + "t1", + "timespan", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", "serials", - "ssidNumbers", + "ssids", "bands", ] for k, v in kwargs.items(): @@ -4609,77 +3954,60 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkBySsid invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkBySsid: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesPacketLossByDevice: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwork( + def getOrganizationWirelessDevicesPacketLossByNetwork( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **Provides insights into wireless capacity experience by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-insights-by-network + **Get average packet loss for the given timespan for all networks in the organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-network - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - contributor (string): Contributor for which to retrieve insights. If not specified, returns overall insights. - - subContributor (string): Sub-contributor for which to retrieve insights. If not specified, returns all sub contributor insights. - - insights (string): Insights version to use. Defaults to 2. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - serials (array): Filter results by device. + - ssids (array): Filter results by SSID number. + - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 90 days. The default is 7 days. """ kwargs.update(locals()) - if "contributor" in kwargs: - options = ["Co-channel interference", "High traffic", "Non-wifi interference"] - assert kwargs["contributor"] in options, ( - f'''"contributor" cannot be "{kwargs["contributor"]}", & must be set to one of: {options}''' - ) - if "insights" in kwargs: - options = ["1", "2"] - assert kwargs["insights"] in options, ( - f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' - ) - metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "insights", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwork", + "tags": ["wireless", "monitor", "devices", "packetLoss", "byNetwork"], + "operation": "getOrganizationWirelessDevicesPacketLossByNetwork", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/insights/byNetwork" + resource = f"/organizations/{organizationId}/wireless/devices/packetLoss/byNetwork" query_params = [ "networkIds", "serials", - "ssidNumbers", + "ssids", "bands", - "contributor", - "subContributor", - "insights", - "t0", - "t1", - "timespan", "perPage", "startingAfter", "endingBefore", + "t0", + "t1", + "timespan", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", "serials", - "ssidNumbers", + "ssids", "bands", ] for k, v in kwargs.items(): @@ -4692,143 +4020,53 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwo invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwork: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesPacketLossByNetwork: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceClientsInsights(self, organizationId: str, **kwargs): - """ - **Returns the top wireless service-level insights for the specified time window, including each network and the impacted client count per metric.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-clients-insights - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. - - limit (integer): Number of top networks to return. Default is 5. Maximum is 10. - """ - - kwargs.update(locals()) - - if "limit" in kwargs: - options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - assert kwargs["limit"] in options, f'''"limit" cannot be "{kwargs["limit"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["wireless", "configure", "experience", "clients", "insights"], - "operation": "getOrganizationAssuranceWirelessExperienceClientsInsights", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/clients/insights" - - query_params = [ - "t0", - "t1", - "timespan", - "limit", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceClientsInsights: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWirelessExperienceClientsOverviewHistoryByInterval(self, organizationId: str, **kwargs): - """ - **Returns time series data for impacted and active clients for organization wireless experience metrics.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-clients-overview-history-by-interval - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - resolution (integer): The time resolution in seconds for returned data. The valid resolutions are: 300, 600, 900, 1800, 3600, 86400. The default is 300. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "experience", "clients", "overview", "history", "byInterval"], - "operation": "getOrganizationAssuranceWirelessExperienceClientsOverviewHistoryByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/clients/overview/history/byInterval" - - query_params = [ - "t0", - "t1", - "timespan", - "resolution", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceClientsOverviewHistoryByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWirelessExperienceCoverageByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationWirelessDevicesPowerModeHistory(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Summarizes wireless coverage successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network + **Return a record of power mode changes for wireless devices in the organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-power-mode-history - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 1 day from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 1 day after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 1 day. The default is 1 day. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - 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 """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetwork", + "tags": ["wireless", "monitor", "devices", "power", "mode", "history"], + "operation": "getOrganizationWirelessDevicesPowerModeHistory", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork" + resource = f"/organizations/{organizationId}/wireless/devices/power/mode/history" query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", "t0", "t1", "timespan", "perPage", "startingAfter", "endingBefore", + "networkIds", + "serials", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4840,5359 +4078,133 @@ def getOrganizationAssuranceWirelessExperienceCoverageByNetwork( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetwork: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesPowerModeHistory: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceCoverageByNetworkByBand( + def getOrganizationWirelessDevicesProvisioningDeployments( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **Summarizes wireless coverage successes and failures by band.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network-by-band + **List the zero touch deployments for wireless access points in an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-provisioning-deployments - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 20. - 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. + - search (string): Filter by MAC address, serial number, new device name, old device name, or model. + - sortBy (string): Field used to sort results. Default is 'status'. + - sortOrder (string): Sort order. Default is 'asc'. + - deploymentType (string): Filter deployments by type. """ kwargs.update(locals()) - metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "byNetwork", "byBand"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetworkByBand", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork/byBand" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetworkByBand: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClient( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless coverage successes and failures by client.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network-by-client - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "byNetwork", "byClient"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork/byClient" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClientOs( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless coverage successes and failures by client OS.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network-by-client-os - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "byNetwork", "byClientOs"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClientOs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork/byClientOs" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClientOs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClientType( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless coverage successes and failures by client type.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network-by-client-type - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "byNetwork", "byClientType"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClientType", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork/byClientType" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClientType: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceCoverageByNetworkByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless coverage successes and failures by device.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "byNetwork", "byDevice"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetworkByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork/byDevice" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetworkByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceCoverageByNetworkByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Time-series of wireless coverage successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network-by-interval - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 60, 300, 600, 3600, 14400, 86400. The default is 300. Interval is calculated if time params are provided. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "experience", "coverage", "byNetwork", "byInterval"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetworkByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork/byInterval" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", - "interval", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceCoverageByNetworkBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless coverage successes and failures by SSID.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network-by-ssid - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "byNetwork", "bySsid"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetworkBySsid", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork/bySsid" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetworkBySsid: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceCoverageInsightsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Provides insights into wireless coverage experience by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-insights-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - contributor (string): Contributor for which to retrieve insights. If not specified, returns overall insights. - - subContributor (string): Sub-contributor for which to retrieve insights. If not specified, returns all sub contributor insights. - - insights (string): Insights version to use. Defaults to 2. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "contributor" in kwargs: - options = ["Admin power restriction", "Insufficient AP density", "Sticky client", "Transient weak signal"] - assert kwargs["contributor"] in options, ( - f'''"contributor" cannot be "{kwargs["contributor"]}", & must be set to one of: {options}''' - ) - if "insights" in kwargs: - options = ["1", "2"] - assert kwargs["insights"] in options, ( - f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "insights", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageInsightsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/insights/byNetwork" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "contributor", - "subContributor", - "insights", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageInsightsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceMetricsOverviewHistoryByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns organization wireless experience metrics overview grouped by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-metrics-overview-history-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 5000. 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": ["wireless", "configure", "experience", "metrics", "overview", "history", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceMetricsOverviewHistoryByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/metrics/overview/history/byNetwork" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceMetricsOverviewHistoryByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceMostImpactedNetworks(self, organizationId: str, **kwargs): - """ - **Returns the most impacted wireless experience networks and the top failure contributor for each network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-most-impacted-networks - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - limit (integer): Number of most impacted networks to return. Default is 5. Maximum is 10. - """ - - kwargs.update(locals()) - - if "limit" in kwargs: - options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - assert kwargs["limit"] in options, f'''"limit" cannot be "{kwargs["limit"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["wireless", "configure", "experience", "mostImpactedNetworks"], - "operation": "getOrganizationAssuranceWirelessExperienceMostImpactedNetworks", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/mostImpactedNetworks" - - query_params = [ - "t0", - "t1", - "timespan", - "limit", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceMostImpactedNetworks: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWirelessExperienceMostImpactedXMs(self, organizationId: str, **kwargs): - """ - **Returns the most impacted wireless experience metrics and the top failure contributor for each metric/network pair.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-most-impacted-x-ms - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - limit (integer): Number of most impacted XMs to return. Default is 5. Maximum is 10. - """ - - kwargs.update(locals()) - - if "limit" in kwargs: - options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - assert kwargs["limit"] in options, f'''"limit" cannot be "{kwargs["limit"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["wireless", "configure", "experience", "mostImpactedXMs"], - "operation": "getOrganizationAssuranceWirelessExperienceMostImpactedXMs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/mostImpactedXMs" - - query_params = [ - "t0", - "t1", - "timespan", - "limit", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceMostImpactedXMs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByBand( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by band.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-band - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork", "byBand"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByBand", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/byBand" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByBand: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClient( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by client.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-client - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 10000. - - 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()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork", "byClient"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/byClient" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClientOs( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by client OS.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-client-os - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork", "byClientOs"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClientOs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/byClientOs" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClientOs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClientType( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by client type.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-client-type - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork", "byClientType"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClientType", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/byClientType" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClientType: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by device.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork", "byDevice"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/byDevice" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Time-series of wireless connection successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-interval - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 60, 300, 600, 3600, 14400, 86400. The default is 300. Interval is calculated if time params are provided. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "monitor", "experience", "successfulConnects", "byNetwork", "byInterval"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/byInterval" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "interval", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByServer( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by server.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-server - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork", "byServer"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/byServer" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByServer: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by ssid.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-ssid - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork", "bySsid"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkBySsid", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/bySsid" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkBySsid: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsInsightsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Provides insights into wireless successful connects experience by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-insights-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - contributor (string): Contributor for which to retrieve insights. If not specified, returns overall insights. - - subContributor (string): Sub-contributor for which to retrieve insights. If not specified, returns all sub contributor insights. - - insights (string): Insights version to use. Defaults to 2. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "contributor" in kwargs: - options = ["assoc", "auth", "dhcp", "dns"] - assert kwargs["contributor"] in options, ( - f'''"contributor" cannot be "{kwargs["contributor"]}", & must be set to one of: {options}''' - ) - if "insights" in kwargs: - options = ["1", "2"] - assert kwargs["insights"] in options, ( - f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' - ) - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "insights", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsInsightsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/insights/byNetwork" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "contributor", - "subContributor", - "insights", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsInsightsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless time to connect metrics by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByBand( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by band.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-band - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork", "byBand"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByBand", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/byBand" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByBand: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClient( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless time to connect metrics by client.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-client - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 10000. - - 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()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork", "byClient"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/byClient" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClientOs( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by client OS.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-client-os - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork", "byClientOs"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClientOs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/byClientOs" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClientOs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClientType( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by client type.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-client-type - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork", "byClientType"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClientType", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/byClientType" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClientType: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection time to connect metrics by device.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork", "byDevice"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/byDevice" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Time-series of wireless time to connect by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-interval - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 60, 300, 600, 3600, 14400, 86400. The default is 300. Interval is calculated if time params are provided. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "monitor", "experience", "timeToConnect", "byNetwork", "byInterval"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/byInterval" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "interval", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByServer( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection time to connect metrics by server.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-server - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork", "byServer"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/byServer" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByServer: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection time to connect metrics by ssid.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-ssid - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork", "bySsid"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkBySsid", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/bySsid" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkBySsid: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectInsightsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Provides insights into wireless time to connect experience by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-insights-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - contributor (string): Contributor for which to retrieve insights. If not specified, returns overall insights. - - subContributor (string): Sub-contributor for which to retrieve insights. If not specified, returns all sub contributor insights. - - insights (string): Insights version to use. Defaults to 2. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "contributor" in kwargs: - options = ["assoc", "auth", "dhcp", "dns"] - assert kwargs["contributor"] in options, ( - f'''"contributor" cannot be "{kwargs["contributor"]}", & must be set to one of: {options}''' - ) - if "insights" in kwargs: - options = ["1", "2"] - assert kwargs["insights"] in options, ( - f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' - ) - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "insights", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectInsightsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/insights/byNetwork" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "contributor", - "subContributor", - "insights", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectInsightsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessAirMarshalRules(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Returns the current Air Marshal rules for this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-air-marshal-rules - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): (optional) The set of network IDs to include. - - 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": ["wireless", "configure", "airMarshal", "rules"], - "operation": "getOrganizationWirelessAirMarshalRules", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/airMarshal/rules" - - query_params = [ - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessAirMarshalRules: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessAirMarshalSettingsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns the current Air Marshal settings for this network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-air-marshal-settings-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): The network IDs to include in the result set. - - 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": ["wireless", "configure", "airMarshal", "settings", "byNetwork"], - "operation": "getOrganizationWirelessAirMarshalSettingsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/airMarshal/settings/byNetwork" - - query_params = [ - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessAirMarshalSettingsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessAlertsLowPowerByDevice(self, organizationId: str, networkIds: list, **kwargs): - """ - **Gets all low power related alerts over a given network and returns information by device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-alerts-low-power-by-device - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "alerts", "lowPower", "byDevice"], - "operation": "getOrganizationWirelessAlertsLowPowerByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/alerts/lowPower/byDevice" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessAlertsLowPowerByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessCertificatesOpenRoamingCertificateAuthority(self, organizationId: str): - """ - **Query for details on the organization's OpenRoaming Certificate Authority certificate (CAs).** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-certificates-open-roaming-certificate-authority - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["wireless", "configure", "certificates", "openRoaming", "certificateAuthority"], - "operation": "getOrganizationWirelessCertificatesOpenRoamingCertificateAuthority", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/certificates/openRoaming/certificateAuthority" - - return self._session.get(metadata, resource) - - def getOrganizationWirelessClientsConnectionsAssociationByClient(self, organizationId: str, **kwargs): - """ - **Summarize association outcomes per wireless client across an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-connections-association-by-client - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "clients", "connections", "association", "byClient"], - "operation": "getOrganizationWirelessClientsConnectionsAssociationByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/connections/association/byClient" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsConnectionsAssociationByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessClientsConnectionsAuthenticationByClient(self, organizationId: str, **kwargs): - """ - **Summarize authentication outcomes per wireless client across an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-connections-authentication-by-client - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "clients", "connections", "authentication", "byClient"], - "operation": "getOrganizationWirelessClientsConnectionsAuthenticationByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/connections/authentication/byClient" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsConnectionsAuthenticationByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessClientsConnectionsDhcpByClient(self, organizationId: str, **kwargs): - """ - **Get IP assignment for all clients in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-connections-dhcp-by-client - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "clients", "connections", "dhcp", "byClient"], - "operation": "getOrganizationWirelessClientsConnectionsDhcpByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/connections/dhcp/byClient" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsConnectionsDhcpByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessClientsConnectionsFailuresHistoryByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns failed wireless client connections for this organization by device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-connections-failures-history-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 - - connectionTimeSortOrder (string): (optional) Sort order of events by connection start time. (default desc) - - failureSteps (array): (optional) The step in the connection process that failed - - clientMac (string): (optional) The MAC address of the client with which the list of events will be filtered. - - serials (array): (optional) Filter devices by serial number - - timespan (integer): (optional) The timespan, in seconds, for the failed connections. The period will be from [timespan] seconds ago until now. The maximum allowed timespan is 1 month. Default: 86400 (24 hours) - - ssidNumber (integer): (optional) The SSID number to include - - networkIds (array): (optional) The set of network IDs to include. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 50. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "connectionTimeSortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["connectionTimeSortOrder"] in options, ( - f'''"connectionTimeSortOrder" cannot be "{kwargs["connectionTimeSortOrder"]}", & must be set to one of: {options}''' - ) - if "ssidNumber" in kwargs: - options = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] - assert kwargs["ssidNumber"] in options, ( - f'''"ssidNumber" cannot be "{kwargs["ssidNumber"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "clients", "connections", "failures", "history", "byDevice"], - "operation": "getOrganizationWirelessClientsConnectionsFailuresHistoryByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/connections/failures/history/byDevice" - - query_params = [ - "connectionTimeSortOrder", - "failureSteps", - "clientMac", - "serials", - "timespan", - "ssidNumber", - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "failureSteps", - "serials", - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsConnectionsFailuresHistoryByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessClientsConnectionsImpactedByNetworkBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarize the number of wireless clients impacted by connection failures on network SSIDs, across an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-connections-impacted-by-network-by-ssid - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - networkGroupIds (array): Filter results by a list of network group IDs. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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": ["wireless", "monitor", "clients", "connections", "impacted", "byNetwork", "bySsid"], - "operation": "getOrganizationWirelessClientsConnectionsImpactedByNetworkBySsid", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/connections/impacted/byNetwork/bySsid" - - query_params = [ - "networkIds", - "networkGroupIds", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "networkGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsConnectionsImpactedByNetworkBySsid: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessClientsOverviewByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List access point client count at the moment in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-overview-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter access points client counts by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter access points client counts by its serial numbers. This filter uses multiple exact matches. - - campusGatewayClusterIds (array): Optional parameter to filter access points client counts by MCG cluster IDs. This filter uses multiple exact matches. - - 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": ["wireless", "monitor", "clients", "overview", "byDevice"], - "operation": "getOrganizationWirelessClientsOverviewByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/overview/byDevice" - - query_params = [ - "networkIds", - "serials", - "campusGatewayClusterIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "campusGatewayClusterIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsOverviewByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def byOrganizationWirelessClientsRfHealthOverviewNetwork(self, organizationId: str, **kwargs): - """ - **Show the by-network client information for the organization in the given interval** - https://developer.cisco.com/meraki/api-v1/#!by-organization-wireless-clients-rf-health-overview-network - - - organizationId (string): Organization ID - - networkIds (array): Networks for which information should be gathered. - - bands (array): Bands for which information should be gathered. Valid bands are 2.4, 5, and 6. - - channels (array): Channel for which information should be gathered. - - serials (array): Serial number of the devices for which information should be gathered. - - gFloorplanId (string): Geoaligned floorplan ID nodes for which information is gathered belong to. - - tags (array): Access Point tags for which information should be gathered. - - models (array): Access Point models for which information should be gathered. - - rfProfiles (array): Rf Profiles for which information should be gathered. - - minimumRfHealthScore (integer): Minimum RF Health score for an AP to be retrieved. - - maximumRfHealthScore (integer): Maximum RF Health score for an AP to be retrieved. - - retryOnEmpty (boolean): If true, the query will be retried with a longer timeframe if the results are empty. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "clients", "rfHealth", "overview"], - "operation": "byOrganizationWirelessClientsRfHealthOverviewNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/rfHealth/overview/byNetwork" - - query_params = [ - "networkIds", - "bands", - "channels", - "serials", - "gFloorplanId", - "tags", - "models", - "rfProfiles", - "minimumRfHealthScore", - "maximumRfHealthScore", - "retryOnEmpty", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "bands", - "channels", - "serials", - "tags", - "models", - "rfProfiles", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"byOrganizationWirelessClientsRfHealthOverviewNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessClientsStickyEvents(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get sticky client events within the specified timespan.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-sticky-events - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - clientIds (array): Filter results by client id. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "clients", "stickyEvents"], - "operation": "getOrganizationWirelessClientsStickyEvents", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/stickyEvents" - - query_params = [ - "networkIds", - "clientIds", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "clientIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsStickyEvents: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessClientsUsageByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Returns client usage details for wireless networks within an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-usage-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 1 hour and be less than or equal to 7 days. The default is 2 hours. - - networkIds (array): Filter results by a list of network IDs. - - networkGroupIds (array): Filter results by a list of network group IDs. - - gatewayNetworkIds (array): Limit the results to clients tunneled to campus gateways in the provided networks. - - usageUnits (string): Usage units to use in the response. - """ - - kwargs.update(locals()) - - if "usageUnits" in kwargs: - options = ["GB", "KB", "MB", "TB"] - assert kwargs["usageUnits"] in options, ( - f'''"usageUnits" cannot be "{kwargs["usageUnits"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "monitor", "clients", "usage", "byNetwork"], - "operation": "getOrganizationWirelessClientsUsageByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/usage/byNetwork" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "networkIds", - "networkGroupIds", - "gatewayNetworkIds", - "usageUnits", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "networkGroupIds", - "gatewayNetworkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsUsageByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessClientsUsageByNetworkBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns client usage details for wireless network SSIDs within an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-usage-by-network-by-ssid - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 1 hour and be less than or equal to 7 days. The default is 2 hours. - - networkIds (array): Filter results by a list of network IDs. - - networkGroupIds (array): Filter results by a list of network group IDs. - - ssidIds (array): Filter results by a list of SSID IDs. - - ssidNames (array): Filter results by a list of SSID names. - - gatewayNetworkIds (array): Limit the results to clients tunneled to campus gateways in the provided networks. - - usageUnits (string): Usage units to use in the response. - """ - - kwargs.update(locals()) - - if "usageUnits" in kwargs: - options = ["GB", "KB", "MB", "TB"] - assert kwargs["usageUnits"] in options, ( - f'''"usageUnits" cannot be "{kwargs["usageUnits"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "monitor", "clients", "usage", "byNetwork", "bySsid"], - "operation": "getOrganizationWirelessClientsUsageByNetworkBySsid", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/usage/byNetwork/bySsid" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "networkIds", - "networkGroupIds", - "ssidIds", - "ssidNames", - "gatewayNetworkIds", - "usageUnits", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "networkGroupIds", - "ssidIds", - "ssidNames", - "gatewayNetworkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsUsageByNetworkBySsid: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessClientsUsageBySsid(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Returns client usage details for SSIDs within an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-usage-by-ssid - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 1 hour and be less than or equal to 7 days. The default is 2 hours. - - ssidNames (array): Filter results by a list of SSID names. - - networkIds (array): Limit the results to clients that belong to one of the provided networks. - - networkGroupIds (array): Limit the results to clients that belong to one of the provided network groups. - - gatewayNetworkIds (array): Limit the results to clients tunneled to campus gateways in the provided networks. - - usageUnits (string): Usage units to use in the response. - """ - - kwargs.update(locals()) - - if "usageUnits" in kwargs: - options = ["GB", "KB", "MB", "TB"] - assert kwargs["usageUnits"] in options, ( - f'''"usageUnits" cannot be "{kwargs["usageUnits"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "monitor", "clients", "usage", "bySsid"], - "operation": "getOrganizationWirelessClientsUsageBySsid", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/usage/bySsid" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "ssidNames", - "networkIds", - "networkGroupIds", - "gatewayNetworkIds", - "usageUnits", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "ssidNames", - "networkIds", - "networkGroupIds", - "gatewayNetworkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsUsageBySsid: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesAccelerometerStatuses( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the most recent AP accelerometer status information for wireless devices that support it.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-accelerometer-statuses - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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): A list of Meraki network IDs to filter results to contain only specified networks. E.g.: networkIds[]=N_12345678&networkIds[]=L_3456 - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "accelerometer", "statuses"], - "operation": "getOrganizationWirelessDevicesAccelerometerStatuses", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/accelerometer/statuses" - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesAccelerometerStatuses: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesChannelUtilizationByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get average channel utilization for all bands in a network, split by AP** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 7 days. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "channelUtilization", "byDevice"], - "operation": "getOrganizationWirelessDevicesChannelUtilizationByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/byDevice" - - query_params = [ - "networkIds", - "serials", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesChannelUtilizationByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesChannelUtilizationByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get average channel utilization across all bands for all networks in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 7 days. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "channelUtilization", "byNetwork"], - "operation": "getOrganizationWirelessDevicesChannelUtilizationByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/byNetwork" - - query_params = [ - "networkIds", - "serials", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesChannelUtilizationByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesChannelUtilizationHistoryByDeviceByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get a time-series of average channel utilization for all bands, segmented by device.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-history-by-device-by-interval - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 7 days. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "channelUtilization", "history", "byDevice", "byInterval"], - "operation": "getOrganizationWirelessDevicesChannelUtilizationHistoryByDeviceByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/history/byDevice/byInterval" - - query_params = [ - "networkIds", - "serials", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesChannelUtilizationHistoryByDeviceByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get a time-series of average channel utilization for all bands** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-history-by-network-by-interval - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 7 days. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "channelUtilization", "history", "byNetwork", "byInterval"], - "operation": "getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/history/byNetwork/byInterval" - - query_params = [ - "networkIds", - "serials", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesDataRateByClient(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get average uplink and downlink datarates for all clients in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-data-rate-by-client - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial number. - - ssids (array): Filter results by SSID number. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - macs (array): Filter results by client mac address(es). - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "dataRate", "byClient"], - "operation": "getOrganizationWirelessDevicesDataRateByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/dataRate/byClient" - - query_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "macs", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "macs", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesDataRateByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesEthernetStatuses(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the most recent Ethernet link speed, duplex, aggregation and power mode and status information for wireless devices.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-ethernet-statuses - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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): A list of Meraki network IDs to filter results to contain only specified networks. E.g.: networkIds[]=N_12345678&networkIds[]=L_3456 - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "ethernet", "statuses"], - "operation": "getOrganizationWirelessDevicesEthernetStatuses", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/ethernet/statuses" - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesEthernetStatuses: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesLatencyByClient(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get latency summaries for all wireless devices in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-latency-by-client - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 7 days. - - networkIds (array): Filter results by network. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - ssids (array): Filter results by SSID number. - - macs (array): Filter results by client mac address(es). - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "devices", "latency", "byClient"], - "operation": "getOrganizationWirelessDevicesLatencyByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/latency/byClient" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "networkIds", - "bands", - "ssids", - "macs", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "bands", - "ssids", - "macs", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesLatencyByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesLatencyByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get latency summaries for all wireless devices in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-latency-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 - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 7 days. - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - ssids (array): Filter results by SSID number. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "devices", "latency", "byDevice"], - "operation": "getOrganizationWirelessDevicesLatencyByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/latency/byDevice" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "networkIds", - "serials", - "bands", - "ssids", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "bands", - "ssids", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesLatencyByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesLatencyByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get per-network latency summaries for all wireless networks in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-latency-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 7 days. - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - ssids (array): Filter results by SSID number. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "devices", "latency", "byNetwork"], - "operation": "getOrganizationWirelessDevicesLatencyByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/latency/byNetwork" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "networkIds", - "serials", - "bands", - "ssids", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "bands", - "ssids", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesLatencyByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationWirelessDevicesLiveToolsClientDisconnect(self, organizationId: str, clientId: str, **kwargs): - """ - **Enqueue a job to disconnect a client from an AP** - https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-devices-live-tools-client-disconnect - - - organizationId (string): Organization ID - - clientId (string): Client ID - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "liveTools", "devices", "clients", "disconnect"], - "operation": "createOrganizationWirelessDevicesLiveToolsClientDisconnect", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - clientId = urllib.parse.quote(str(clientId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/liveTools/clients/{clientId}/disconnect" - - body_params = [ - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationWirelessDevicesLiveToolsClientDisconnect: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationWirelessDevicesPacketLossByClient(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get average packet loss for the given timespan for all clients in the organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-client - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - ssids (array): Filter results by SSID number. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - macs (array): Filter results by client mac address(es). - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 90 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "packetLoss", "byClient"], - "operation": "getOrganizationWirelessDevicesPacketLossByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/packetLoss/byClient" - - query_params = [ - "networkIds", - "ssids", - "bands", - "macs", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "ssids", - "bands", - "macs", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesPacketLossByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesPacketLossByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get average packet loss for the given timespan for all devices in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - ssids (array): Filter results by SSID number. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 90 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "packetLoss", "byDevice"], - "operation": "getOrganizationWirelessDevicesPacketLossByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/packetLoss/byDevice" - - query_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssids", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesPacketLossByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesPacketLossByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get average packet loss for the given timespan for all networks in the organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - ssids (array): Filter results by SSID number. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 90 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "packetLoss", "byNetwork"], - "operation": "getOrganizationWirelessDevicesPacketLossByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/packetLoss/byNetwork" - - query_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssids", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesPacketLossByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesPowerModeHistory(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return a record of power mode changes for wireless devices in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-power-mode-history - - - 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 - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 1 day from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 1 day after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 1 day. The default is 1 day. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - 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 - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "power", "mode", "history"], - "operation": "getOrganizationWirelessDevicesPowerModeHistory", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/power/mode/history" - - query_params = [ - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesPowerModeHistory: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesProvisioningDeployments( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the zero touch deployments for wireless access points in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-provisioning-deployments - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 20. - - 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. - - search (string): Filter by MAC address, serial number, new device name, old device name, or model. - - sortBy (string): Field used to sort results. Default is 'status'. - - sortOrder (string): Sort order. Default is 'asc'. - - deploymentType (string): Filter deployments by type. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["afterAction", "createdAt", "deploymentId", "name", "status"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - if "deploymentType" in kwargs: - options = ["deploy", "replace"] - assert kwargs["deploymentType"] in options, ( - f'''"deploymentType" cannot be "{kwargs["deploymentType"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], - "operation": "getOrganizationWirelessDevicesProvisioningDeployments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "search", - "sortBy", - "sortOrder", - "deploymentType", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesProvisioningDeployments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationWirelessDevicesProvisioningDeployment(self, organizationId: str, items: list, **kwargs): - """ - **Create a zero touch deployment for a wireless access point** - https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-devices-provisioning-deployment - - - organizationId (string): Organization ID - - items (array): List of zero touch deployments to create - - meta (object): Metadata relevant to the paginated dataset - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], - "operation": "createOrganizationWirelessDevicesProvisioningDeployment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments" - - body_params = [ - "items", - "meta", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationWirelessDevicesProvisioningDeployment: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationWirelessDevicesProvisioningDeployments(self, organizationId: str, items: list, **kwargs): - """ - **Update a zero touch deployment** - https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-devices-provisioning-deployments - - - organizationId (string): Organization ID - - items (array): List of zero touch deployments to create - - meta (object): Metadata relevant to the paginated dataset - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], - "operation": "updateOrganizationWirelessDevicesProvisioningDeployments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments" - - body_params = [ - "items", - "meta", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationWirelessDevicesProvisioningDeployments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def getOrganizationWirelessDevicesProvisioningDeploymentsByNewDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns deployment IDs for the given new node serial numbers** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-provisioning-deployments-by-new-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 - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 80. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - serials (array): Array of new device serial numbers to query - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "devices", "provisioning", "deployments", "byNewDevice"], - "operation": "getOrganizationWirelessDevicesProvisioningDeploymentsByNewDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments/byNewDevice" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "serials", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesProvisioningDeploymentsByNewDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def deleteOrganizationWirelessDevicesProvisioningDeployment(self, organizationId: str, deploymentId: str): - """ - **Delete a zero touch deployment** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-devices-provisioning-deployment - - - organizationId (string): Organization ID - - deploymentId (string): Deployment ID - """ - - metadata = { - "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], - "operation": "deleteOrganizationWirelessDevicesProvisioningDeployment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - deploymentId = urllib.parse.quote(str(deploymentId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments/{deploymentId}" - - return self._session.delete(metadata, resource) - - def getOrganizationWirelessDevicesProvisioningRecommendationsTags(self, organizationId: str, **kwargs): - """ - **List the recommended device tags for zero touch deployments available for the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-provisioning-recommendations-tags - - - organizationId (string): Organization ID - - networkIds (array): The list of networks to use as hints for device tags recommendations. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "devices", "provisioning", "recommendations", "tags"], - "operation": "getOrganizationWirelessDevicesProvisioningRecommendationsTags", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/provisioning/recommendations/tags" - - query_params = [ - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesProvisioningRecommendationsTags: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesRadsecCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" - ) - - 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} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationWirelessDevicesRadsecCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" - ) - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrls: ignoring unrecognized kwargs: {invalid}" - ) - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrlsDeltas: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessDevicesSignalQualityByClient( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get average signal quality for all clients in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-signal-quality-by-client - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial number. - - ssids (array): Filter results by SSID number. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - macs (array): Filter results by client mac address(es). - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "signalQuality", "byClient"], - "operation": "getOrganizationWirelessDevicesSignalQualityByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/signalQuality/byClient" - - query_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "macs", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "macs", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesSignalQualityByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesSignalQualityByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get average signal quality for all devices in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-signal-quality-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial number. - - ssids (array): Filter results by SSID number. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "signalQuality", "byDevice"], - "operation": "getOrganizationWirelessDevicesSignalQualityByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/signalQuality/byDevice" - - query_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssids", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesSignalQualityByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesSignalQualityByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get average signal quality for all networks in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-signal-quality-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial number. - - ssids (array): Filter results by SSID number. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "signalQuality", "byNetwork"], - "operation": "getOrganizationWirelessDevicesSignalQualityByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/signalQuality/byNetwork" - - query_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssids", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesSignalQualityByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - 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.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-system-cpu-load-history - - - 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 - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 1 day from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 1 day after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 1 day. The default is 1 day. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - 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 - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "system", "cpu", "load", "history"], - "operation": "getOrganizationWirelessDevicesSystemCpuLoadHistory", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/system/cpu/load/history" - - query_params = [ - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesSystemCpuLoadHistory: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesTelemetry(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the wireless device telemetry of an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-telemetry - - - 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 - 200. Default is 100. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 3 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 minutes after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 30 minutes. The default is 30 minutes. - - networkIds (array): Optional parameter to filter results by network. - - serials (array): Optional parameter to filter results by device serial. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "telemetry"], - "operation": "getOrganizationWirelessDevicesTelemetry", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/telemetry" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "networkIds", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesTelemetry: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesWirelessControllersByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List of Catalyst access points information** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-wireless-controllers-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter access points by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter access points by its cloud ID. This filter uses multiple exact matches. - - controllerSerials (array): Optional parameter to filter access points by its wireless LAN controller cloud ID. This filter uses multiple exact matches. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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": ["wireless", "monitor", "devices", "wirelessControllers", "byDevice"], - "operation": "getOrganizationWirelessDevicesWirelessControllersByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/wirelessControllers/byDevice" - - query_params = [ - "networkIds", - "serials", - "controllerSerials", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "controllerSerials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesWirelessControllersByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessLocationScanningByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessLocationScanningReceivers: ignoring unrecognized kwargs: {invalid}" - ) - - 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, **kwargs - ): - """ - **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} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationWirelessLocationScanningReceiver: ignoring unrecognized kwargs: {invalid}" - ) - - 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} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationWirelessLocationScanningReceiver: ignoring unrecognized kwargs: {invalid}" - ) - - 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 getOrganizationWirelessLocationWayfindingByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Return Client wayfinding settings** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-wayfinding-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter wayfinding settings by network ID. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "location", "wayfinding", "byNetwork"], - "operation": "getOrganizationWirelessLocationWayfindingByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/location/wayfinding/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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessLocationWayfindingByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessMqttSettings(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return MQTT Settings for networks** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-mqtt-settings - - - 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 mqtt settings by network ID. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "mqtt", "settings"], - "operation": "getOrganizationWirelessMqttSettings", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/mqtt/settings" - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationWirelessMqttSettings: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def updateOrganizationWirelessMqttSettings(self, organizationId: str, network: dict, mqtt: dict, **kwargs): - """ - **Add new broker config for wireless MQTT** - https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-mqtt-settings - - - organizationId (string): Organization ID - - network (object): Add MQTT Settings for network - - mqtt (object): MQTT Settings for network - - ble (object): MQTT BLE Settings for network - - wifi (object): MQTT Wi-Fi Settings for network - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "mqtt", "settings"], - "operation": "updateOrganizationWirelessMqttSettings", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/mqtt/settings" - - body_params = [ - "network", - "mqtt", - "ble", - "wifi", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationWirelessMqttSettings: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def byOrganizationWirelessOpportunisticPcapLicenseNetwork(self, organizationId: str, **kwargs): - """ - **Check the Opportunistic Pcap license status of an organization by network** - https://developer.cisco.com/meraki/api-v1/#!by-organization-wireless-opportunistic-pcap-license-network - - - organizationId (string): Organization ID - - networkIds (array): Optional parameter to filter results by network. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "opportunisticPcap", "license"], - "operation": "byOrganizationWirelessOpportunisticPcapLicenseNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/opportunisticPcap/license/byNetwork" - - query_params = [ - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"byOrganizationWirelessOpportunisticPcapLicenseNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessRadioAfcPositionByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the AFC power limits of an organization by device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-afc-position-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 - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter device's AFC position by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter device's AFC position by device serial numbers. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "radio", "afc", "position", "byDevice"], - "operation": "getOrganizationWirelessRadioAfcPositionByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/afc/position/byDevice" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessRadioAfcPositionByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessRadioAfcPowerLimitsByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the AFC power limits of an organization by device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-afc-power-limits-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 - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter device's AFC power limits by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter device's AFC power limits by device serial numbers. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) + if "sortBy" in kwargs: + options = ["afterAction", "createdAt", "deploymentId", "name", "status"] + assert kwargs["sortBy"] in options, ( + f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' + ) + if "sortOrder" in kwargs: + options = ["asc", "desc"] + assert kwargs["sortOrder"] in options, ( + f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' + ) + if "deploymentType" in kwargs: + options = ["deploy", "replace"] + assert kwargs["deploymentType"] in options, ( + f'''"deploymentType" cannot be "{kwargs["deploymentType"]}", & must be set to one of: {options}''' + ) metadata = { - "tags": ["wireless", "configure", "radio", "afc", "powerLimits", "byDevice"], - "operation": "getOrganizationWirelessRadioAfcPowerLimitsByDevice", + "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], + "operation": "getOrganizationWirelessDevicesProvisioningDeployments", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/afc/powerLimits/byDevice" + resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments" query_params = [ "perPage", "startingAfter", "endingBefore", - "networkIds", - "serials", + "search", + "sortBy", + "sortOrder", + "deploymentType", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = query_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRadioAfcPowerLimitsByDevice: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesProvisioningDeployments: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessRadioAutoRfByNetwork(self, organizationId: str, **kwargs): - """ - **List the AutoRF settings of an organization by network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-auto-rf-by-network - - - organizationId (string): Organization ID - - networkIds (array): Optional parameter to filter results by network. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "radio", "autoRf", "byNetwork"], - "operation": "getOrganizationWirelessRadioAutoRfByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/autoRf/byNetwork" - - query_params = [ - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessRadioAutoRfByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessRadioAutoRfChannelsPlanningActivities(self, organizationId: str, **kwargs): + def createOrganizationWirelessDevicesProvisioningDeployment(self, organizationId: str, items: list, **kwargs): """ - **List the channel planning activities of an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-auto-rf-channels-planning-activities + **Create a zero touch deployment for a wireless access point** + https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-devices-provisioning-deployment - organizationId (string): Organization ID - - networkIds (array): Optional parameter to filter results by network. - - deviceSerials (array): Optional parameter to filter results by device serial. - - bands (array): Optional parameter to filter results by bands. Valid bands are 2.4, 5, and 6. - - channels (array): Optional parameter to filter results by channels. - - serials (array): Serial number of the devices for which information should be gathered. - - gFloorplanId (string): Geoaligned floorplan ID nodes for which information is gathered belong to. - - tags (array): Optional parameter to filter results by node tags. - - models (array): Optional parameter to filter results by access point models. - - rfProfiles (array): Optional parameter to filter results by RF Profiles. - - minimumRfHealthScore (integer): Minimum RF Health score for an AP to be retrieved. - - maximumRfHealthScore (integer): Maximum RF Health score for an AP to be retrieved. + - items (array): List of zero touch deployments to create + - meta (object): Metadata relevant to the paginated dataset """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "radio", "autoRf", "channels", "planning", "activities"], - "operation": "getOrganizationWirelessRadioAutoRfChannelsPlanningActivities", + "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], + "operation": "createOrganizationWirelessDevicesProvisioningDeployment", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/autoRf/channels/planning/activities" - - query_params = [ - "networkIds", - "deviceSerials", - "bands", - "channels", - "serials", - "gFloorplanId", - "tags", - "models", - "rfProfiles", - "minimumRfHealthScore", - "maximumRfHealthScore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments" - array_params = [ - "networkIds", - "deviceSerials", - "bands", - "channels", - "serials", - "tags", - "models", - "rfProfiles", + body_params = [ + "items", + "meta", ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRadioAutoRfChannelsPlanningActivities: ignoring unrecognized kwargs: {invalid}" + f"createOrganizationWirelessDevicesProvisioningDeployment: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.post(metadata, resource, payload) - def recalculateOrganizationWirelessRadioAutoRfChannels(self, organizationId: str, networkIds: list, **kwargs): + def updateOrganizationWirelessDevicesProvisioningDeployments(self, organizationId: str, items: list, **kwargs): """ - **Recalculates automatically assigned channels for every AP within specified the specified network(s)** - https://developer.cisco.com/meraki/api-v1/#!recalculate-organization-wireless-radio-auto-rf-channels + **Update a zero touch deployment** + https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-devices-provisioning-deployments - organizationId (string): Organization ID - - networkIds (array): A list of network ids (limit: 15). + - items (array): List of zero touch deployments to create + - meta (object): Metadata relevant to the paginated dataset """ - kwargs = locals() + kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "radio", "autoRf", "channels"], - "operation": "recalculateOrganizationWirelessRadioAutoRfChannels", + "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], + "operation": "updateOrganizationWirelessDevicesProvisioningDeployments", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/autoRf/channels/recalculate" + resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments" body_params = [ - "networkIds", + "items", + "meta", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -10201,47 +4213,55 @@ def recalculateOrganizationWirelessRadioAutoRfChannels(self, organizationId: str invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"recalculateOrganizationWirelessRadioAutoRfChannels: ignoring unrecognized kwargs: {invalid}" + f"updateOrganizationWirelessDevicesProvisioningDeployments: ignoring unrecognized kwargs: {invalid}" ) - return self._session.post(metadata, resource, payload) + return self._session.put(metadata, resource, payload) - def getOrganizationWirelessRadioOverridesByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): + def deleteOrganizationWirelessDevicesProvisioningDeployment(self, organizationId: str, deploymentId: str): """ - **Return a list of radio overrides** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-overrides-by-device + **Delete a zero touch deployment** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-devices-provisioning-deployment - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 100. - - 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): A list of network IDs. The returned radio overrides will be filtered to only include these networks. - - serials (array): A list of serial numbers. The returned radio overrides will be filtered to only include these serials. + - deploymentId (string): Deployment ID + """ + + metadata = { + "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], + "operation": "deleteOrganizationWirelessDevicesProvisioningDeployment", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + deploymentId = urllib.parse.quote(str(deploymentId), safe="") + resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments/{deploymentId}" + + return self._session.delete(metadata, resource) + + 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", "radio", "overrides", "byDevice"], - "operation": "getOrganizationWirelessRadioOverridesByDevice", + "tags": ["wireless", "configure", "devices", "radsec", "certificates", "authorities"], + "operation": "getOrganizationWirelessDevicesRadsecCertificatesAuthorities", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/overrides/byDevice" + resource = f"/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities" query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", + "certificateAuthorityIds", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "networkIds", - "serials", + "certificateAuthorityIds", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10253,132 +4273,88 @@ def getOrganizationWirelessRadioOverridesByDevice(self, organizationId: str, tot invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRadioOverridesByDevice: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesRadsecCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get_pages(metadata, resource, params, total_pages, direction) + return self._session.get(metadata, resource, params) - def byOrganizationWirelessRadioRfHealthNeighborsRssiDevice(self, organizationId: str, **kwargs): + def updateOrganizationWirelessDevicesRadsecCertificatesAuthorities(self, organizationId: str, **kwargs): """ - **Show the by-device neighbor rssi information for the organization in the given interval** - https://developer.cisco.com/meraki/api-v1/#!by-organization-wireless-radio-rf-health-neighbors-rssi-device + **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 - - networkIds (array): Networks for which information should be gathered. - - bands (array): Bands for which information should be gathered. Valid bands are 2.4, 5, and 6. - - channels (array): Channel for which information should be gathered. - - serials (array): Serial number of the devices for which information should be gathered. - - tags (array): Access Point tags for which information should be gathered. - - models (array): Access Point models for which information should be gathered. - - rfProfiles (array): Rf Profiles for which information should be gathered. - - gFloorplanId (string): Geoaligned floorplan ID nodes for which information is gathered belong to. - - minimumNeighborRssi (integer): Minimum Neighbor RSSI score for a neighbor entry to be retrieved. - - maximumNeighborRssi (integer): Maximum Neighbor RSSI score for a neighbor entry to be retrieved. - - minimumRfHealthScore (integer): Minimum RF Health score for an AP to be retrieved. - - maximumRfHealthScore (integer): Maximum RF Health score for an AP to be retrieved. - - rfScoreInterval (integer): Size of the rf score interval in seconds. - - rfScoreRetryOnEmpty (boolean): If true, the query will be retried further back if no data is present in the latest rf score interval. + - 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", "radio", "rfHealth", "neighbors", "rssi"], - "operation": "byOrganizationWirelessRadioRfHealthNeighborsRssiDevice", + "tags": ["wireless", "configure", "devices", "radsec", "certificates", "authorities"], + "operation": "updateOrganizationWirelessDevicesRadsecCertificatesAuthorities", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/rfHealth/neighbors/rssi/byDevice" - - query_params = [ - "networkIds", - "bands", - "channels", - "serials", - "tags", - "models", - "rfProfiles", - "gFloorplanId", - "minimumNeighborRssi", - "maximumNeighborRssi", - "minimumRfHealthScore", - "maximumRfHealthScore", - "rfScoreInterval", - "rfScoreRetryOnEmpty", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + resource = f"/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities" - array_params = [ - "networkIds", - "bands", - "channels", - "serials", - "tags", - "models", - "rfProfiles", + body_params = [ + "status", + "certificateAuthorityId", ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"byOrganizationWirelessRadioRfHealthNeighborsRssiDevice: ignoring unrecognized kwargs: {invalid}" + f"updateOrganizationWirelessDevicesRadsecCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, 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 getOrganizationWirelessRadioRfHealthOverviewByNetworkByInterval(self, organizationId: str, **kwargs): + def getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrls(self, organizationId: str, **kwargs): """ - **Show the by-network RF Health score overview information for the organization in the given interval** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-rf-health-overview-by-network-by-interval + **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 - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 182 days, 14 hours, 54 minutes, and 36 seconds from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days, 10 hours, 29 minutes, and 6 seconds after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days, 10 hours, 29 minutes, and 6 seconds. The default is 14 days. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 7200, 86400. The default is 7200. Interval is calculated if time params are provided. - - networkIds (array): Networks for which information should be gathered. - - bands (array): Bands for which information should be gathered. Valid bands are 2.4, 5, and 6. - - minimumRfHealthScore (integer): Minimum RF Health score for a network to be retrieved. - - maximumRfHealthScore (integer): Maximum RF Health score for a network to be retrieved. - - minimumHighCciPercentage (integer): Minimum percentage of radios with high CCI for a network to be retrieved. - - maximumHighCciPercentage (integer): Maximum percentage of radios with high CCI for a network to be retrieved. - - minimumChannelChanges (integer): Minimum number of channel changes for a network to be retrieved. - - maximumChannelChanges (integer): Maximum number of channel changes for a network to be retrieved. + - 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", "radio", "rfHealth", "overview", "byNetwork", "byInterval"], - "operation": "getOrganizationWirelessRadioRfHealthOverviewByNetworkByInterval", + "tags": ["wireless", "configure", "devices", "radsec", "certificates", "authorities", "crls"], + "operation": "getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrls", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/rfHealth/overview/byNetwork/byInterval" + resource = f"/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities/crls" query_params = [ - "t0", - "t1", - "timespan", - "interval", - "networkIds", - "bands", - "minimumRfHealthScore", - "maximumRfHealthScore", - "minimumHighCciPercentage", - "maximumHighCciPercentage", - "minimumChannelChanges", - "maximumChannelChanges", + "certificateAuthorityIds", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "networkIds", - "bands", + "certificateAuthorityIds", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10390,52 +4366,36 @@ def getOrganizationWirelessRadioRfHealthOverviewByNetworkByInterval(self, organi invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRadioRfHealthOverviewByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrls: ignoring unrecognized kwargs: {invalid}" ) return self._session.get(metadata, resource, params) - def getOrganizationWirelessRadioRrmByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): + def getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrlsDeltas(self, organizationId: str, **kwargs): """ - **List the AutoRF settings of an organization by network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-rrm-by-network + **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 - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter results by network. - - startingAfter (string): Retrieving items after this network ID - - endingBefore (string): Retrieving items before this network ID - - perPage (integer): Number of items per page - - sortOrder (string): The sort order of items + - 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()) - if "sortOrder" in kwargs: - options = ["ascending", "descending"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - metadata = { - "tags": ["wireless", "configure", "radio", "rrm", "byNetwork"], - "operation": "getOrganizationWirelessRadioRrmByNetwork", + "tags": ["wireless", "configure", "devices", "radsec", "certificates", "authorities", "crls", "deltas"], + "operation": "getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrlsDeltas", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/rrm/byNetwork" + resource = f"/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities/crls/deltas" query_params = [ - "networkIds", - "startingAfter", - "endingBefore", - "perPage", - "sortOrder", + "certificateAuthorityIds", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "networkIds", + "certificateAuthorityIds", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10447,31 +4407,47 @@ def getOrganizationWirelessRadioRrmByNetwork(self, organizationId: str, total_pa invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRadioRrmByNetwork: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrlsDeltas: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get_pages(metadata, resource, params, total_pages, direction) + return self._session.get(metadata, resource, params) - def getOrganizationWirelessRadioStatusByNetwork(self, organizationId: str, **kwargs): + def getOrganizationWirelessDevicesSystemCpuLoadHistory( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): """ - **Show the status of this organization's radios, categorized by network and device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-status-by-network + **Return the CPU Load history for a list of wireless devices in the organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-system-cpu-load-history - organizationId (string): Organization ID - - networkIds (array): Networks for which radio status should be returned. - - serials (array): Serials for which radio status should be returned. + - 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 + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 1 day from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 1 day after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 1 day. The default is 1 day. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - 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 """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "radio", "status", "byNetwork"], - "operation": "getOrganizationWirelessRadioStatusByNetwork", + "tags": ["wireless", "monitor", "devices", "system", "cpu", "load", "history"], + "operation": "getOrganizationWirelessDevicesSystemCpuLoadHistory", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/status/byNetwork" + resource = f"/organizations/{organizationId}/wireless/devices/system/cpu/load/history" query_params = [ + "t0", + "t1", + "timespan", + "perPage", + "startingAfter", + "endingBefore", "networkIds", "serials", ] @@ -10491,66 +4467,52 @@ def getOrganizationWirelessRadioStatusByNetwork(self, organizationId: str, **kwa invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRadioStatusByNetwork: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesSystemCpuLoadHistory: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessRfProfilesAssignmentsByDevice( + def getOrganizationWirelessDevicesWirelessControllersByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **List the RF profiles of an organization by device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-rf-profiles-assignments-by-device + **List of Catalyst access points information** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-wireless-controllers-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 - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + - networkIds (array): Optional parameter to filter access points by network ID. This filter uses multiple exact matches. + - serials (array): Optional parameter to filter access points by its cloud ID. This filter uses multiple exact matches. + - controllerSerials (array): Optional parameter to filter access points by its wireless LAN controller cloud ID. This filter uses multiple exact matches. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - 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, 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. - - model (string): Optional parameter to filter RF profiles by device model. All returned devices will have a model that contains the search term or is an exact match. - - macs (array): Optional parameter to filter RF profiles by one or more device MAC addresses. All returned devices will have a MAC address that is an exact match. - - serials (array): Optional parameter to filter RF profiles by one or more device serial numbers. All returned devices will have a serial number that is an exact match. - - models (array): Optional parameter to filter RF profiles by one or more device models. All returned devices will have a model that is an exact match. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "rfProfiles", "assignments", "byDevice"], - "operation": "getOrganizationWirelessRfProfilesAssignmentsByDevice", + "tags": ["wireless", "monitor", "devices", "wirelessControllers", "byDevice"], + "operation": "getOrganizationWirelessDevicesWirelessControllersByDevice", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/rfProfiles/assignments/byDevice" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "productTypes", - "name", - "mac", - "serial", - "model", - "macs", + resource = f"/organizations/{organizationId}/wireless/devices/wirelessControllers/byDevice" + + query_params = [ + "networkIds", "serials", - "models", + "controllerSerials", + "perPage", + "startingAfter", + "endingBefore", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", - "productTypes", - "macs", "serials", - "models", + "controllerSerials", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10562,39 +4524,39 @@ def getOrganizationWirelessRfProfilesAssignmentsByDevice( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRfProfilesAssignmentsByDevice: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesWirelessControllersByDevice: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessRoamingByNetworkByInterval(self, organizationId: str, networkIds: list, **kwargs): + def getOrganizationWirelessLocationScanningByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Get all wireless clients' roam events within the specified timespan grouped by network and time interval.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-roaming-by-network-by-interval + **Return scanning API settings** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-scanning-by-network - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 7 days. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 1800, 3600, 7200, 10800, 14400, 18000, 21600, 25200, 28800, 32400, 36000, 39600, 43200, 86400, 604800. The default is 7200. + - 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", "monitor", "roaming", "byNetwork", "byInterval"], - "operation": "getOrganizationWirelessRoamingByNetworkByInterval", + "tags": ["wireless", "configure", "location", "scanning", "byNetwork"], + "operation": "getOrganizationWirelessLocationScanningByNetwork", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/roaming/byNetwork/byInterval" + resource = f"/organizations/{organizationId}/wireless/location/scanning/byNetwork" query_params = [ + "perPage", + "startingAfter", + "endingBefore", "networkIds", - "t0", - "t1", - "timespan", - "interval", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} @@ -10611,49 +4573,44 @@ def getOrganizationWirelessRoamingByNetworkByInterval(self, organizationId: str, invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRoamingByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessLocationScanningByNetwork: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessSsidsFirewallIsolationAllowlistEntries( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationWirelessLocationScanningReceivers(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **List the L2 isolation allow list MAC entry in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-firewall-isolation-allowlist-entries + **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 - 1000. Default is 1000. + - 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): networkIds array to filter out results - - ssids (array): ssids number array to filter out results + - networkIds (array): Optional parameter to filter scanning API receivers by network ID. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "ssids", "firewall", "isolation", "allowlist", "entries"], - "operation": "getOrganizationWirelessSsidsFirewallIsolationAllowlistEntries", + "tags": ["wireless", "configure", "location", "scanning", "receivers"], + "operation": "getOrganizationWirelessLocationScanningReceivers", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries" + resource = f"/organizations/{organizationId}/wireless/location/scanning/receivers" query_params = [ "perPage", "startingAfter", "endingBefore", "networkIds", - "ssids", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", - "ssids", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10665,39 +4622,41 @@ def getOrganizationWirelessSsidsFirewallIsolationAllowlistEntries( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessSsidsFirewallIsolationAllowlistEntries: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessLocationScanningReceivers: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def createOrganizationWirelessSsidsFirewallIsolationAllowlistEntry( - self, organizationId: str, client: dict, ssid: dict, network: dict, **kwargs + def createOrganizationWirelessLocationScanningReceiver( + self, organizationId: str, network: dict, url: str, version: str, radio: dict, sharedSecret: str, **kwargs ): """ - **Create isolation allow list MAC entry for this organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-ssids-firewall-isolation-allowlist-entry + **Add new receiver for scanning API** + https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-location-scanning-receiver - organizationId (string): Organization ID - - client (object): The client of allowlist - - ssid (object): The SSID that allowlist belongs to - - network (object): The Network that allowlist belongs to - - description (string): The description of mac address + - 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.update(locals()) + kwargs = locals() metadata = { - "tags": ["wireless", "configure", "ssids", "firewall", "isolation", "allowlist", "entries"], - "operation": "createOrganizationWirelessSsidsFirewallIsolationAllowlistEntry", + "tags": ["wireless", "configure", "location", "scanning", "receivers"], + "operation": "createOrganizationWirelessLocationScanningReceiver", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries" + resource = f"/organizations/{organizationId}/wireless/location/scanning/receivers" body_params = [ - "description", - "client", - "ssid", "network", + "url", + "version", + "radio", + "sharedSecret", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -10706,54 +4665,37 @@ def createOrganizationWirelessSsidsFirewallIsolationAllowlistEntry( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"createOrganizationWirelessSsidsFirewallIsolationAllowlistEntry: ignoring unrecognized kwargs: {invalid}" + f"createOrganizationWirelessLocationScanningReceiver: ignoring unrecognized kwargs: {invalid}" ) return self._session.post(metadata, resource, payload) - def deleteOrganizationWirelessSsidsFirewallIsolationAllowlistEntry(self, organizationId: str, entryId: str): - """ - **Destroy isolation allow list MAC entry for this organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-ssids-firewall-isolation-allowlist-entry - - - organizationId (string): Organization ID - - entryId (string): Entry ID - """ - - metadata = { - "tags": ["wireless", "configure", "ssids", "firewall", "isolation", "allowlist", "entries"], - "operation": "deleteOrganizationWirelessSsidsFirewallIsolationAllowlistEntry", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - entryId = urllib.parse.quote(str(entryId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries/{entryId}" - - return self._session.delete(metadata, resource) - - def updateOrganizationWirelessSsidsFirewallIsolationAllowlistEntry(self, organizationId: str, entryId: str, **kwargs): + def updateOrganizationWirelessLocationScanningReceiver(self, organizationId: str, receiverId: str, **kwargs): """ - **Update isolation allow list MAC entry info** - https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-ssids-firewall-isolation-allowlist-entry + **Change scanning API receiver settings** + https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-location-scanning-receiver - organizationId (string): Organization ID - - entryId (string): Entry ID - - description (string): The description of mac address - - client (object): The client of allowlist + - 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", "ssids", "firewall", "isolation", "allowlist", "entries"], - "operation": "updateOrganizationWirelessSsidsFirewallIsolationAllowlistEntry", + "tags": ["wireless", "configure", "location", "scanning", "receivers"], + "operation": "updateOrganizationWirelessLocationScanningReceiver", } organizationId = urllib.parse.quote(str(organizationId), safe="") - entryId = urllib.parse.quote(str(entryId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries/{entryId}" + receiverId = urllib.parse.quote(str(receiverId), safe="") + resource = f"/organizations/{organizationId}/wireless/location/scanning/receivers/{receiverId}" body_params = [ - "description", - "client", + "url", + "version", + "radio", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -10762,41 +4704,58 @@ def updateOrganizationWirelessSsidsFirewallIsolationAllowlistEntry(self, organiz invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"updateOrganizationWirelessSsidsFirewallIsolationAllowlistEntry: ignoring unrecognized kwargs: {invalid}" + f"updateOrganizationWirelessLocationScanningReceiver: ignoring unrecognized kwargs: {invalid}" ) return self._session.put(metadata, resource, payload) - def getOrganizationWirelessSsidsOpenRoamingByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): + def deleteOrganizationWirelessLocationScanningReceiver(self, organizationId: str, receiverId: str): """ - **Returns an array of objects, each containing SSID OpenRoaming configs for the corresponding network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-open-roaming-by-network + **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 getOrganizationWirelessMqttSettings(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **Return MQTT Settings for networks** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-mqtt-settings - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + - 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 OpenRoaming configuration by Network Id. - - includeDisabledSsids (boolean): Optional parameter to include OpenRoaming configuration for disabled ssids. + - networkIds (array): Optional parameter to filter mqtt settings by network ID. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "ssids", "openRoaming", "byNetwork"], - "operation": "getOrganizationWirelessSsidsOpenRoamingByNetwork", + "tags": ["wireless", "configure", "mqtt", "settings"], + "operation": "getOrganizationWirelessMqttSettings", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/openRoaming/byNetwork" + resource = f"/organizations/{organizationId}/wireless/mqtt/settings" query_params = [ "perPage", "startingAfter", "endingBefore", "networkIds", - "includeDisabledSsids", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} @@ -10812,108 +4771,123 @@ def getOrganizationWirelessSsidsOpenRoamingByNetwork(self, organizationId: str, all_params = query_params + array_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessSsidsOpenRoamingByNetwork: ignoring unrecognized kwargs: {invalid}" - ) + self._session._logger.warning(f"getOrganizationWirelessMqttSettings: ignoring unrecognized kwargs: {invalid}") return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessSsidsPoliciesClientExclusionBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def updateOrganizationWirelessMqttSettings(self, organizationId: str, network: dict, mqtt: dict, **kwargs): """ - **Returns an array of objects, each containing client exclusion enablement statuses for one SSID** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-policies-client-exclusion-by-ssid + **Add new broker config for wireless MQTT** + https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-mqtt-settings - 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 - 100000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter by Network ID. - - includeDisabledSsids (boolean): Optional parameter to include disabled SSID's. - - ssidNumbers (array): Optional parameter to filter by SSID numbers. + - network (object): Add MQTT Settings for network + - mqtt (object): MQTT Settings for network + - ble (object): MQTT BLE Settings for network + - wifi (object): MQTT Wi-Fi Settings for network """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "ssids", "policies", "clientExclusion", "bySsid"], - "operation": "getOrganizationWirelessSsidsPoliciesClientExclusionBySsid", + "tags": ["wireless", "configure", "mqtt", "settings"], + "operation": "updateOrganizationWirelessMqttSettings", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/policies/clientExclusion/bySsid" + resource = f"/organizations/{organizationId}/wireless/mqtt/settings" - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "includeDisabledSsids", - "ssidNumbers", + body_params = [ + "network", + "mqtt", + "ble", + "wifi", ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - array_params = [ + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"updateOrganizationWirelessMqttSettings: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def recalculateOrganizationWirelessRadioAutoRfChannels(self, organizationId: str, networkIds: list, **kwargs): + """ + **Recalculates automatically assigned channels for every AP within specified the specified network(s)** + https://developer.cisco.com/meraki/api-v1/#!recalculate-organization-wireless-radio-auto-rf-channels + + - organizationId (string): Organization ID + - networkIds (array): A list of network ids (limit: 15). + """ + + kwargs = locals() + + metadata = { + "tags": ["wireless", "configure", "radio", "autoRf", "channels"], + "operation": "recalculateOrganizationWirelessRadioAutoRfChannels", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/radio/autoRf/channels/recalculate" + + body_params = [ "networkIds", - "ssidNumbers", ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessSsidsPoliciesClientExclusionBySsid: ignoring unrecognized kwargs: {invalid}" + f"recalculateOrganizationWirelessRadioAutoRfChannels: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get_pages(metadata, resource, params, total_pages, direction) + return self._session.post(metadata, resource, payload) - def getOrganizationWirelessSsidsPoliciesClientExclusionStaticExclusionsBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationWirelessRadioRrmByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Returns an array of objects, each containing a list of MAC's excluded from a given SSID** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-policies-client-exclusion-static-exclusions-by-ssid + **List the AutoRF settings of an organization by network** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-rrm-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 - 100000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter Network ID. - - includeDisabledSsids (boolean): Optional parameter to include disabled SSID's. - - ssidNumbers (array): Optional parameter to filter by SSID numbers. + - networkIds (array): Optional parameter to filter results by network. + - startingAfter (string): Retrieving items after this network ID + - endingBefore (string): Retrieving items before this network ID + - perPage (integer): Number of items per page + - sortOrder (string): The sort order of items """ kwargs.update(locals()) + if "sortOrder" in kwargs: + options = ["ascending", "descending"] + assert kwargs["sortOrder"] in options, ( + f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' + ) + metadata = { - "tags": ["wireless", "configure", "ssids", "policies", "clientExclusion", "static", "exclusions", "bySsid"], - "operation": "getOrganizationWirelessSsidsPoliciesClientExclusionStaticExclusionsBySsid", + "tags": ["wireless", "configure", "radio", "rrm", "byNetwork"], + "operation": "getOrganizationWirelessRadioRrmByNetwork", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/policies/clientExclusion/static/exclusions/bySsid" + resource = f"/organizations/{organizationId}/wireless/radio/rrm/byNetwork" query_params = [ - "perPage", + "networkIds", "startingAfter", "endingBefore", - "networkIds", - "includeDisabledSsids", - "ssidNumbers", + "perPage", + "sortOrder", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", - "ssidNumbers", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10925,61 +4899,66 @@ def getOrganizationWirelessSsidsPoliciesClientExclusionStaticExclusionsBySsid( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessSsidsPoliciesClientExclusionStaticExclusionsBySsid: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessRadioRrmByNetwork: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessSsidsProfiles(self, organizationId: str, total_pages=1, direction="next", **kwargs): + def getOrganizationWirelessRfProfilesAssignmentsByDevice( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): """ - **Returns the SSID profiles for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-profiles + **List the RF profiles of an organization by device** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-rf-profiles-assignments-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 - - name (string): (Optional) Filter results by name. Case insensitive substring match. - - sortBy (string): Column to sort results by. Default is `name`. - - sortOrder (string): Direction to sort results by. Default is `asc`. - - profileIds (array): (Optional) Filter results by a list of SSID profile IDs. - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Optional parameter to filter devices by network. + - 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. + - model (string): Optional parameter to filter RF profiles by device model. All returned devices will have a model that contains the search term or is an exact match. + - macs (array): Optional parameter to filter RF profiles by one or more device MAC addresses. All returned devices will have a MAC address that is an exact match. + - serials (array): Optional parameter to filter RF profiles by one or more device serial numbers. All returned devices will have a serial number that is an exact match. + - models (array): Optional parameter to filter RF profiles by one or more device models. All returned devices will have a model that is an exact match. """ kwargs.update(locals()) - if "sortBy" in kwargs: - options = ["name"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - metadata = { - "tags": ["wireless", "configure", "ssids", "profiles"], - "operation": "getOrganizationWirelessSsidsProfiles", + "tags": ["wireless", "configure", "rfProfiles", "assignments", "byDevice"], + "operation": "getOrganizationWirelessRfProfilesAssignmentsByDevice", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles" + resource = f"/organizations/{organizationId}/wireless/rfProfiles/assignments/byDevice" query_params = [ - "name", - "sortBy", - "sortOrder", - "profileIds", "perPage", "startingAfter", "endingBefore", + "networkIds", + "productTypes", + "name", + "mac", + "serial", + "model", + "macs", + "serials", + "models", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "profileIds", + "networkIds", + "productTypes", + "macs", + "serials", + "models", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10989,87 +4968,51 @@ def getOrganizationWirelessSsidsProfiles(self, organizationId: str, total_pages= if self._session._validate_kwargs: all_params = query_params + array_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationWirelessSsidsProfiles: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationWirelessSsidsProfile(self, organizationId: str, name: str, ssid: dict, **kwargs): - """ - **Create a new SSID profile in an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-ssids-profile - - - organizationId (string): Organization ID - - name (string): Name of the SSID profile - - ssid (object): SSID configuration for the profile - - precedence (object): Precedence configuration for the SSID profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "ssids", "profiles"], - "operation": "createOrganizationWirelessSsidsProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles" - - body_params = [ - "name", - "precedence", - "ssid", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"createOrganizationWirelessSsidsProfile: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessRfProfilesAssignmentsByDevice: ignoring unrecognized kwargs: {invalid}" ) - return self._session.post(metadata, resource, payload) + return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessSsidsProfilesAssignments(self, organizationId: str, total_pages=1, direction="next", **kwargs): + def getOrganizationWirelessSsidsFirewallIsolationAllowlistEntries( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): """ - **List the SSID profile assignments in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-profiles-assignments + **List the L2 isolation allow list MAC entry in an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-firewall-isolation-allowlist-entries - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): The network IDs to include in the result set. - - ssidIds (array): The SSID IDs to include in the result set. - - profileIds (array): The SSID profile IDs to include in the result set. - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): networkIds array to filter out results + - ssids (array): ssids number array to filter out results """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "ssids", "profiles", "assignments"], - "operation": "getOrganizationWirelessSsidsProfilesAssignments", + "tags": ["wireless", "configure", "ssids", "firewall", "isolation", "allowlist", "entries"], + "operation": "getOrganizationWirelessSsidsFirewallIsolationAllowlistEntries", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/assignments" + resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries" query_params = [ - "networkIds", - "ssidIds", - "profileIds", "perPage", "startingAfter", "endingBefore", + "networkIds", + "ssids", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", - "ssidIds", - "profileIds", + "ssids", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -11081,33 +5024,37 @@ def getOrganizationWirelessSsidsProfilesAssignments(self, organizationId: str, t invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessSsidsProfilesAssignments: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessSsidsFirewallIsolationAllowlistEntries: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def createOrganizationWirelessSsidsProfilesAssignment(self, organizationId: str, profile: dict, ssid: dict, **kwargs): + def createOrganizationWirelessSsidsFirewallIsolationAllowlistEntry( + self, organizationId: str, client: dict, ssid: dict, network: dict, **kwargs + ): """ - **Assigns an SSID profile to an SSID in the organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-ssids-profiles-assignment + **Create isolation allow list MAC entry for this organization** + https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-ssids-firewall-isolation-allowlist-entry - organizationId (string): Organization ID - - profile (object): SSID profile to assign - - ssid (object): SSID to assign the SSID profile to - - network (object): Network containing the SSID (required if SSID number is used) + - client (object): The client of allowlist + - ssid (object): The SSID that allowlist belongs to + - network (object): The Network that allowlist belongs to + - description (string): The description of mac address """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "ssids", "profiles", "assignments"], - "operation": "createOrganizationWirelessSsidsProfilesAssignment", + "tags": ["wireless", "configure", "ssids", "firewall", "isolation", "allowlist", "entries"], + "operation": "createOrganizationWirelessSsidsFirewallIsolationAllowlistEntry", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/assignments" + resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries" body_params = [ - "profile", + "description", + "client", "ssid", "network", ] @@ -11118,161 +5065,102 @@ def createOrganizationWirelessSsidsProfilesAssignment(self, organizationId: str, invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"createOrganizationWirelessSsidsProfilesAssignment: ignoring unrecognized kwargs: {invalid}" + f"createOrganizationWirelessSsidsFirewallIsolationAllowlistEntry: ignoring unrecognized kwargs: {invalid}" ) return self._session.post(metadata, resource, payload) - def deleteOrganizationWirelessSsidsProfilesAssignments(self, organizationId: str, ssid: dict, **kwargs): + def deleteOrganizationWirelessSsidsFirewallIsolationAllowlistEntry(self, organizationId: str, entryId: str): """ - **Unassigns the SSID profile assigned to an SSID** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-ssids-profiles-assignments + **Destroy isolation allow list MAC entry for this organization** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-ssids-firewall-isolation-allowlist-entry - organizationId (string): Organization ID - - ssid (object): SSID to delete the SSID profile assignment of - - network (object): Network containing the SSID (required if SSID number is used) + - entryId (string): Entry ID """ - kwargs.update(locals()) - metadata = { - "tags": ["wireless", "configure", "ssids", "profiles", "assignments"], - "operation": "deleteOrganizationWirelessSsidsProfilesAssignments", + "tags": ["wireless", "configure", "ssids", "firewall", "isolation", "allowlist", "entries"], + "operation": "deleteOrganizationWirelessSsidsFirewallIsolationAllowlistEntry", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/assignments" + entryId = urllib.parse.quote(str(entryId), safe="") + resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries/{entryId}" return self._session.delete(metadata, resource) - def getOrganizationWirelessSsidsProfilesAssignmentsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def updateOrganizationWirelessSsidsFirewallIsolationAllowlistEntry(self, organizationId: str, entryId: str, **kwargs): """ - **List the SSID profile assignments in an organization, grouped by network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-profiles-assignments-by-network + **Update isolation allow list MAC entry info** + https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-ssids-firewall-isolation-allowlist-entry - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): The network IDs to include in the result set. - - profileIds (array): The SSID profile IDs to include in the result set. - - networkGroupIds (array): The network group IDs to include in the result set. - - includeAllNetworks (boolean): When set to true, include all networks in the organization, even those without any SSID profile assignments. Defaults to false. - - excludeProfileIds (array): The SSID profile IDs to exclude from the result set. - - sortBy (string): Optional parameter to specify the field used to sort results. (default: network) - - sortOrder (string): Optional parameter to specify the sort order. Default value is asc. - - search (string): Optional parameter to search on network name or network group name. - - 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. + - entryId (string): Entry ID + - description (string): The description of mac address + - client (object): The client of allowlist """ kwargs.update(locals()) - if "sortBy" in kwargs: - options = ["group", "network"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - metadata = { - "tags": ["wireless", "configure", "ssids", "profiles", "assignments", "byNetwork"], - "operation": "getOrganizationWirelessSsidsProfilesAssignmentsByNetwork", + "tags": ["wireless", "configure", "ssids", "firewall", "isolation", "allowlist", "entries"], + "operation": "updateOrganizationWirelessSsidsFirewallIsolationAllowlistEntry", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/assignments/byNetwork" - - query_params = [ - "networkIds", - "profileIds", - "networkGroupIds", - "includeAllNetworks", - "excludeProfileIds", - "sortBy", - "sortOrder", - "search", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + entryId = urllib.parse.quote(str(entryId), safe="") + resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries/{entryId}" - array_params = [ - "networkIds", - "profileIds", - "networkGroupIds", - "excludeProfileIds", + body_params = [ + "description", + "client", ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessSsidsProfilesAssignmentsByNetwork: ignoring unrecognized kwargs: {invalid}" + f"updateOrganizationWirelessSsidsFirewallIsolationAllowlistEntry: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get_pages(metadata, resource, params, total_pages, direction) + return self._session.put(metadata, resource, payload) - def getOrganizationWirelessSsidsProfilesOverviews(self, organizationId: str, total_pages=1, direction="next", **kwargs): + def getOrganizationWirelessSsidsOpenRoamingByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Returns the SSID profiles' overview information for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-profiles-overviews + **Returns an array of objects, each containing SSID OpenRoaming configs for the corresponding network** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-open-roaming-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 - - name (string): (Optional) Filter results by name. Case insensitive substring match. - - sortBy (string): Column to sort results by. Default is `name`. - - sortOrder (string): Direction to sort results by. Default is `asc`. - - profileIds (array): (Optional) Filter results by a list of SSID profile IDs. - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Optional parameter to filter OpenRoaming configuration by Network Id. + - includeDisabledSsids (boolean): Optional parameter to include OpenRoaming configuration for disabled ssids. """ kwargs.update(locals()) - if "sortBy" in kwargs: - options = ["name"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - metadata = { - "tags": ["wireless", "configure", "ssids", "profiles", "overviews"], - "operation": "getOrganizationWirelessSsidsProfilesOverviews", + "tags": ["wireless", "configure", "ssids", "openRoaming", "byNetwork"], + "operation": "getOrganizationWirelessSsidsOpenRoamingByNetwork", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/overviews" + resource = f"/organizations/{organizationId}/wireless/ssids/openRoaming/byNetwork" query_params = [ - "name", - "sortBy", - "sortOrder", - "profileIds", "perPage", "startingAfter", "endingBefore", + "networkIds", + "includeDisabledSsids", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "profileIds", + "networkIds", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -11284,67 +5172,11 @@ def getOrganizationWirelessSsidsProfilesOverviews(self, organizationId: str, tot invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessSsidsProfilesOverviews: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessSsidsOpenRoamingByNetwork: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def updateOrganizationWirelessSsidsProfile(self, organizationId: str, id: str, **kwargs): - """ - **Update this SSID profile** - https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-ssids-profile - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of the SSID profile - - ssid (object): SSID configuration for the profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "ssids", "profiles"], - "operation": "updateOrganizationWirelessSsidsProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/{id}" - - body_params = [ - "name", - "ssid", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationWirelessSsidsProfile: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationWirelessSsidsProfile(self, organizationId: str, id: str): - """ - **Delete an SSID profile** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-ssids-profile - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["wireless", "configure", "ssids", "profiles"], - "operation": "deleteOrganizationWirelessSsidsProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/{id}" - - return self._session.delete(metadata, resource) - def getOrganizationWirelessSsidsStatusesByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **List status information of all BSSIDs in your organization** diff --git a/meraki/aio/api/wirelessController.py b/meraki/aio/api/wirelessController.py index e4cb0e4..ee7a75b 100644 --- a/meraki/aio/api/wirelessController.py +++ b/meraki/aio/api/wirelessController.py @@ -177,59 +177,6 @@ def getOrganizationWirelessControllerConnections(self, organizationId: str, tota return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessControllerConnectionsUnassigned( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List of unassigned Catalyst access points and summary information** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-controller-connections-unassigned - - - 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 - - controllerSerials (array): Optional parameter to filter access points by wireless LAN controller cloud ID. This filter uses multiple exact matches. - - supported (boolean): Optional parameter to filter access points based on if they are supported for dashboard monitoring. Values can be true/false, if not provided then all unassigned APs will be returned - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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": ["wirelessController", "configure", "connections", "unassigned"], - "operation": "getOrganizationWirelessControllerConnectionsUnassigned", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wirelessController/connections/unassigned" - - query_params = [ - "controllerSerials", - "supported", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "controllerSerials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessControllerConnectionsUnassigned: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessControllerDevicesInterfacesL2ByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): @@ -914,36 +861,3 @@ def getOrganizationWirelessControllerOverviewByDevice( ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def generateOrganizationWirelessControllerRegulatoryDomainPackage(self, organizationId: str, **kwargs): - """ - **Generate the regulatory domain package** - https://developer.cisco.com/meraki/api-v1/#!generate-organization-wireless-controller-regulatory-domain-package - - - organizationId (string): Organization ID - - networkIds (array): A list of network IDs to filter by - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wirelessController", "configure", "regulatoryDomain", "package"], - "operation": "generateOrganizationWirelessControllerRegulatoryDomainPackage", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wirelessController/regulatoryDomain/package/generate" - - body_params = [ - "networkIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"generateOrganizationWirelessControllerRegulatoryDomainPackage: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) diff --git a/meraki/api/administered.py b/meraki/api/administered.py index 4362086..5f1be09 100644 --- a/meraki/api/administered.py +++ b/meraki/api/administered.py @@ -67,36 +67,3 @@ def revokeAdministeredIdentitiesMeApiKeys(self, suffix: str): resource = f"/administered/identities/me/api/keys/{suffix}/revoke" return self._session.post(metadata, resource) - - def getAdministeredSearchLive(self, query: str, organizationId: str, networkId: str, **kwargs): - """ - **List the appropriate results for a given global search utilizing live_search_react** - https://developer.cisco.com/meraki/api-v1/#!get-administered-search-live - - - query (string): Search keywords - - organizationId (string): Id of Organization you want to search with - - networkId (string): Id of NodeGroup you want to seach with - """ - - kwargs = locals() - - metadata = { - "tags": ["administered", "configure", "search", "live"], - "operation": "getAdministeredSearchLive", - } - resource = "/administered/search/live" - - query_params = [ - "query", - "organizationId", - "networkId", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getAdministeredSearchLive: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) diff --git a/meraki/api/appliance.py b/meraki/api/appliance.py index 7b12213..8202319 100644 --- a/meraki/api/appliance.py +++ b/meraki/api/appliance.py @@ -34,21 +34,10 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): - personality (object): Describes the port's configurability - uplink (object): The port's settings when in WAN mode - downlink (object): The port's VLAN settings when in LAN mode - - speed (string): Link speed for the port, in Mbps - - duplex (string): Duplex configuration for the port """ kwargs.update(locals()) - if "speed" in kwargs and kwargs["speed"] is not None: - options = ["10", "100", "1000", "10000", "2500", "25000", "5000", "auto"] - assert kwargs["speed"] in options, f'''"speed" cannot be "{kwargs["speed"]}", & must be set to one of: {options}''' - if "duplex" in kwargs and kwargs["duplex"] is not None: - options = ["auto", "full", "half"] - assert kwargs["duplex"] in options, ( - f'''"duplex" cannot be "{kwargs["duplex"]}", & must be set to one of: {options}''' - ) - metadata = { "tags": ["appliance", "configure", "interfaces", "ports", "update"], "operation": "createDeviceApplianceInterfacesPortsUpdate", @@ -62,8 +51,6 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): "personality", "uplink", "downlink", - "speed", - "duplex", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -77,58 +64,6 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): return self._session.post(metadata, resource, payload) - def updateDeviceApplianceInterfacesPort(self, serial: str, number: str, **kwargs): - """ - **Update configurations for an appliance's specified port** - https://developer.cisco.com/meraki/api-v1/#!update-device-appliance-interfaces-port - - - serial (string): Serial - - number (string): Number - - enabled (boolean): Indicates whether the port is enabled - - personality (object): Describes the port's configurability - - uplink (object): The port's settings when in WAN mode - - downlink (object): The port's VLAN settings when in LAN mode - - speed (string): Link speed for the port, in Mbps - - duplex (string): Duplex configuration for the port - """ - - kwargs.update(locals()) - - if "speed" in kwargs and kwargs["speed"] is not None: - options = ["10", "100", "1000", "10000", "2500", "25000", "5000", "auto"] - assert kwargs["speed"] in options, f'''"speed" cannot be "{kwargs["speed"]}", & must be set to one of: {options}''' - if "duplex" in kwargs and kwargs["duplex"] is not None: - options = ["auto", "full", "half"] - assert kwargs["duplex"] in options, ( - f'''"duplex" cannot be "{kwargs["duplex"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["appliance", "configure", "interfaces", "ports"], - "operation": "updateDeviceApplianceInterfacesPort", - } - serial = urllib.parse.quote(str(serial), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/devices/{serial}/appliance/interfaces/ports/{number}" - - body_params = [ - "enabled", - "personality", - "uplink", - "downlink", - "speed", - "duplex", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateDeviceApplianceInterfacesPort: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def getDeviceAppliancePerformance(self, serial: str, **kwargs): """ **Return the performance score for a single Secure Appliance or Secure Router** @@ -1152,7 +1087,6 @@ def createNetworkApplianceInterfacesL3(self, networkId: str, ipv4: dict, **kwarg - networkId (string): Network ID - ipv4 (object): IPv4 configuration - port (object): Port configuration - - vrf (object): VRF assignment for the L3 interface """ kwargs.update(locals()) @@ -1167,7 +1101,6 @@ def createNetworkApplianceInterfacesL3(self, networkId: str, ipv4: dict, **kwarg body_params = [ "port", "ipv4", - "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1188,7 +1121,6 @@ def updateNetworkApplianceInterfacesL3(self, networkId: str, interfaceId: str, * - interfaceId (string): Interface ID - port (object): Port configuration - ipv4 (object): IPv4 configuration - - vrf (object): VRF assignment for the L3 interface """ kwargs.update(locals()) @@ -1204,7 +1136,6 @@ def updateNetworkApplianceInterfacesL3(self, networkId: str, interfaceId: str, * body_params = [ "port", "ipv4", - "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1284,8 +1215,6 @@ def updateNetworkAppliancePort(self, networkId: str, portId: str, **kwargs): - vlan (integer): Native VLAN when the port is in Trunk mode. Access VLAN when the port is in Access mode. - allowedVlans (string): Comma-delimited list of VLAN IDs (e.g. '2,15') for all devices. Secure Routers also support VLAN ranges (e.g. '2-10,15'). Use 'all' to permit all VLANs on the port. - accessPolicy (string): The name of the policy. Only applicable to Access ports. Valid values are: 'open', '8021x-radius', 'mac-radius', 'hybris-radius' for MX64 or Z3 or any MX supporting the per port authentication feature. Otherwise, 'open' is the only valid value and 'open' is the default value if the field is missing. - - peerSgtCapable (boolean): If true, Peer SGT is enabled for traffic through this port. Applicable to trunk port only, not access port. - - adaptivePolicyGroupId (string): Adaptive policy group ID that all traffic originating from this port is assigned to. - sgt (object): Security Group Tag settings for the port. """ @@ -1306,8 +1235,6 @@ def updateNetworkAppliancePort(self, networkId: str, portId: str, **kwargs): "vlan", "allowedVlans", "accessPolicy", - "peerSgtCapable", - "adaptivePolicyGroupId", "sgt", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1691,7 +1618,6 @@ def updateNetworkApplianceSecurityIntrusion(self, networkId: str, **kwargs): - networkId (string): Network ID - mode (string): Set mode to 'disabled'/'detection'/'prevention' (optional - omitting will leave current config unchanged) - idsRulesets (string): Set the detection ruleset 'connectivity'/'balanced'/'security' (optional - omitting will leave current config unchanged). Default value is 'balanced' if none currently saved - - policy (object): Set a custom intrusion policy by id (optional - omitting will leave current config unchanged) - protectedNetworks (object): Set the included/excluded networks from the intrusion engine (optional - omitting will leave current config unchanged). This is available only in 'passthrough' mode """ @@ -1716,7 +1642,6 @@ def updateNetworkApplianceSecurityIntrusion(self, networkId: str, **kwargs): body_params = [ "mode", "idsRulesets", - "policy", "protectedNetworks", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1879,7 +1804,6 @@ def updateNetworkApplianceSingleLan(self, networkId: str, **kwargs): - applianceIp (string): The appliance IP address of the single LAN - ipv6 (object): IPv6 configuration on the VLAN - mandatoryDhcp (object): Mandatory DHCP will enforce that clients connecting to this LAN must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. Only available on firmware versions 17.0 and above - - vrf (object): VRF configuration on the Single LAN. Omit this field to preserve the current VRF. """ kwargs.update(locals()) @@ -1896,7 +1820,6 @@ def updateNetworkApplianceSingleLan(self, networkId: str, **kwargs): "applianceIp", "ipv6", "mandatoryDhcp", - "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2040,7 +1963,6 @@ def createNetworkApplianceStaticRoute(self, networkId: str, name: str, subnet: s - subnet (string): Subnet of the route - gatewayIp (string): Gateway IP address (next hop) - gatewayVlanId (integer): Gateway VLAN ID - - vrf (object): VRF settings for the static route. """ kwargs.update(locals()) @@ -2057,7 +1979,6 @@ def createNetworkApplianceStaticRoute(self, networkId: str, name: str, subnet: s "subnet", "gatewayIp", "gatewayVlanId", - "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2102,7 +2023,6 @@ def updateNetworkApplianceStaticRoute(self, networkId: str, staticRouteId: str, - enabled (boolean): Whether the route should be enabled or not - fixedIpAssignments (object): Fixed DHCP IP assignments on the route - reservedIpRanges (array): DHCP reserved IP ranges - - vrf (object): VRF settings for the static route. """ kwargs.update(locals()) @@ -2123,7 +2043,6 @@ def updateNetworkApplianceStaticRoute(self, networkId: str, staticRouteId: str, "enabled", "fixedIpAssignments", "reservedIpRanges", - "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2512,7 +2431,6 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw - networkId (string): Network ID - custom (array): Custom VPN exclusion rules. Pass an empty array to clear existing rules. - majorApplications (array): Major Application based VPN exclusion rules. Pass an empty array to clear existing rules. - - applications (array): NBAR Application based VPN exclusion rules. Available for networks on >=19.2 firmware """ kwargs.update(locals()) @@ -2527,7 +2445,6 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw body_params = [ "custom", "majorApplications", - "applications", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2591,23 +2508,6 @@ def disconnectNetworkApplianceUmbrellaAccount(self, networkId: str): return self._session.post(metadata, resource) - def disableNetworkApplianceUmbrellaProtection(self, networkId: str): - """ - **Disable umbrella protection for an MX network** - https://developer.cisco.com/meraki/api-v1/#!disable-network-appliance-umbrella-protection - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["appliance", "configure", "umbrella"], - "operation": "disableNetworkApplianceUmbrellaProtection", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/appliance/umbrella/disableProtection" - - return self._session.delete(metadata, resource) - def exclusionsNetworkApplianceUmbrellaDomains(self, networkId: str, domains: list, **kwargs): """ **Specify one or more domain names to be excluded from being routed to Cisco Umbrella.** @@ -2641,54 +2541,6 @@ def exclusionsNetworkApplianceUmbrellaDomains(self, networkId: str, domains: lis return self._session.put(metadata, resource, payload) - def enableNetworkApplianceUmbrellaProtection(self, networkId: str): - """ - **Enable umbrella protection for an MX network** - https://developer.cisco.com/meraki/api-v1/#!enable-network-appliance-umbrella-protection - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["appliance", "configure", "umbrella"], - "operation": "enableNetworkApplianceUmbrellaProtection", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/appliance/umbrella/enableProtection" - - return self._session.post(metadata, resource) - - def policiesNetworkApplianceUmbrella(self, networkId: str, policyIds: list, **kwargs): - """ - **Update umbrella policies applied to MX network.** - https://developer.cisco.com/meraki/api-v1/#!policies-network-appliance-umbrella - - - networkId (string): Network ID - - policyIds (array): Array of umbrella policy IDs - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "umbrella"], - "operation": "policiesNetworkApplianceUmbrella", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/appliance/umbrella/policies" - - body_params = [ - "policyIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"policiesNetworkApplianceUmbrella: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def addNetworkApplianceUmbrellaPolicies(self, networkId: str, policy: dict, **kwargs): """ **Add one Cisco Umbrella DNS security policy to an MX network by policy ID** @@ -2894,7 +2746,6 @@ def createNetworkApplianceVlan(self, networkId: str, id: str, name: str, **kwarg - dhcpBootNextServer (string): DHCP boot option to direct boot clients to the server to load the boot file from - dhcpBootFilename (string): DHCP boot option for boot filename - dhcpOptions (array): The list of DHCP options that will be included in DHCP responses. Each object in the list should have "code", "type", and "value" properties. - - adaptivePolicyGroupId (string): Adaptive policy group ID this VLAN is assigned to. - sgt (object): Security Group Tag settings for the VLAN. - vrf (object): VRF configuration on the VLAN. - uplinks (array): Per-uplink NAT exception override configuration on the VLAN. Applicable only for networks that support NAT exceptions. @@ -2943,7 +2794,6 @@ def createNetworkApplianceVlan(self, networkId: str, id: str, name: str, **kwarg "dhcpBootNextServer", "dhcpBootFilename", "dhcpOptions", - "adaptivePolicyGroupId", "sgt", "vrf", "uplinks", @@ -3052,7 +2902,6 @@ def updateNetworkApplianceVlan(self, networkId: str, vlanId: str, **kwargs): - mask (integer): Mask used for the subnet of all bound to the template networks. Applicable only for template network. - ipv6 (object): IPv6 configuration on the VLAN - mandatoryDhcp (object): Mandatory DHCP will enforce that clients connecting to this VLAN must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. Only available on firmware versions 17.0 and above - - adaptivePolicyGroupId (string): Adaptive policy group ID that all traffic originating from this VLAN is assigned to. - sgt (object): Security Group Tag settings for the VLAN. - vrf (object): VRF configuration on the VLAN. - uplinks (array): Per-uplink NAT exception override configuration on the VLAN. Applicable only for networks that support NAT exceptions. @@ -3105,7 +2954,6 @@ def updateNetworkApplianceVlan(self, networkId: str, vlanId: str, **kwargs): "mask", "ipv6", "mandatoryDhcp", - "adaptivePolicyGroupId", "sgt", "vrf", "uplinks", @@ -3165,22 +3013,12 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): - enabled (boolean): Boolean value to enable or disable the BGP configuration. When BGP is enabled, the asNumber (ASN) will be autopopulated with the preconfigured ASN at other Hubs or a default value if there is no ASN configured. - asNumber (integer): An Autonomous System Number (ASN) is required if you are to run BGP and peer with another BGP Speaker outside of the Auto VPN domain. This ASN will be applied to the entire Auto VPN domain and is only configurable for Auto VPN BGP networks. The entire 4-byte ASN range is supported. So, the ASN must be an integer between 1 and 4294967295. When absent, this field is not updated. If no value exists then it defaults to 64512. - ibgpHoldTimer (integer): The iBGP holdtimer in seconds. The iBGP holdtimer must be an integer between 12 and 240. When absent, this field is not updated. If no value exists then it defaults to 240. - - ipv6 (object): Settings for IPv6 configurations on the organization. - - tunnelDownTermination (object): Settings for tunnel down termination on the organization. - - vpnAsNumber (integer): Network specific number of the Autonomous System to which the appliance belongs. This field is only configurable for Independent BGP networks. - - priorityRoute (string): Sets the priority route between eBGP and Auto VPN. - routerId (string): The router ID of the appliance - neighbors (array): List of BGP neighbors. This list replaces the existing set of neighbors. When absent, this field is not updated. """ kwargs.update(locals()) - if "priorityRoute" in kwargs and kwargs["priorityRoute"] is not None: - options = ["Auto VPN", "eBGP"] - assert kwargs["priorityRoute"] in options, ( - f'''"priorityRoute" cannot be "{kwargs["priorityRoute"]}", & must be set to one of: {options}''' - ) - metadata = { "tags": ["appliance", "configure", "vpn", "bgp"], "operation": "updateNetworkApplianceVpnBgp", @@ -3192,10 +3030,6 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): "enabled", "asNumber", "ibgpHoldTimer", - "ipv6", - "tunnelDownTermination", - "vpnAsNumber", - "priorityRoute", "routerId", "neighbors", ] @@ -3209,41 +3043,6 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): return self._session.put(metadata, resource, payload) - def updateNetworkApplianceVpnSiteToSiteHubVrfs(self, networkId: str, hubNetworkId: str, _json: list, **kwargs): - """ - **Update the VRF mappings for a source network and hub pair.** - https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-vpn-site-to-site-hub-vrfs - - - networkId (string): Network ID - - hubNetworkId (string): Hub network ID - - _json (array): The list of VRFs for this source and hub mapping. - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "vpn", "siteToSite", "hubs", "vrfs"], - "operation": "updateNetworkApplianceVpnSiteToSiteHubVrfs", - } - networkId = urllib.parse.quote(str(networkId), safe="") - hubNetworkId = urllib.parse.quote(str(hubNetworkId), safe="") - resource = f"/networks/{networkId}/appliance/vpn/siteToSite/hubs/{hubNetworkId}/vrfs" - - body_params = [ - "_json", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateNetworkApplianceVpnSiteToSiteHubVrfs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - def getNetworkApplianceVpnSiteToSiteVpn(self, networkId: str): """ **Return the site-to-site VPN settings of a network** @@ -3270,7 +3069,6 @@ def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kw - mode (string): The site-to-site VPN mode. Can be one of 'none', 'spoke' or 'hub' - hubs (array): The list of VPN hubs, in order of preference. In spoke mode, at least 1 hub is required. - subnets (array): The list of subnets and their VPN presence. - - peerSgtCapable (boolean): Whether or not Peer SGT is enabled for traffic to this VPN peer. - sgt (object): Security Group Tag settings for the VPN peer. - subnet (object): Configuration of subnet features - hostTranslations (array): The list of VPN host translations. Host translations are supported starting from MX firmware version 26.1.2 @@ -3293,7 +3091,6 @@ def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kw "mode", "hubs", "subnets", - "peerSgtCapable", "sgt", "subnet", "hostTranslations", @@ -3585,68 +3382,6 @@ def getOrganizationApplianceDevicesRedundancyByNetwork( return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationApplianceDevicesSystemUtilizationByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Return the appliance utilization history for devices in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-devices-system-utilization-by-interval - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 2 hours. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 1200. The default is 1200. - - networkIds (array): Optional parameter to filter the result set by the included set of network IDs - - serials (array): Optional parameter to filter device utilization history by device serial numbers - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "monitor", "devices", "system", "utilization", "byInterval"], - "operation": "getOrganizationApplianceDevicesSystemUtilizationByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/devices/system/utilization/byInterval" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - "networkIds", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceDevicesSystemUtilizationByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationApplianceDnsLocalProfiles(self, organizationId: str, **kwargs): """ **Fetch the local DNS profiles used in the organization** @@ -4432,55 +4167,6 @@ def updateOrganizationApplianceRoutingVrfsSettings(self, organizationId: str, en return self._session.put(metadata, resource, payload) - def getOrganizationApplianceSdwanInternetPolicies(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get the SDWAN internet traffic preferences for an MX network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-sdwan-internet-policies - - - 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 - 200. 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. - - wanTrafficUplinkPreferences (array): policies with respective traffic filters for an MX network - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "sdwan", "internetPolicies"], - "operation": "getOrganizationApplianceSdwanInternetPolicies", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/sdwan/internetPolicies" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "wanTrafficUplinkPreferences", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "wanTrafficUplinkPreferences", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSdwanInternetPolicies: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationApplianceSecurityEvents(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **List the security events for an organization** @@ -4534,58 +4220,6 @@ def getOrganizationApplianceSecurityEvents(self, organizationId: str, total_page return self._session.get_pages(metadata, resource, params, total_pages, direction) - def httpsiOrganizationApplianceSecurity(self, organizationId: str): - """ - **Retrieve the HTTPS Inspection state for all security appliances in an organization.** - https://developer.cisco.com/meraki/api-v1/#!httpsi-organization-appliance-security - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["appliance", "configure", "security"], - "operation": "httpsiOrganizationApplianceSecurity", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/httpsi" - - return self._session.get(metadata, resource) - - def certificatesOrganizationApplianceSecurityHttpsi(self, organizationId: str, contents: str, serials: list, **kwargs): - """ - **Upload an HTTPS Inspection certificate to MX devices in the same organization** - https://developer.cisco.com/meraki/api-v1/#!certificates-organization-appliance-security-httpsi - - - organizationId (string): Organization ID - - contents (string): The private key and certificate used to inspect HTTPS traffic. The certificate must be in .pem format. - - serials (array): Serial numbers of the security appliances that will receive the new HTTPS certificate for HTTPS Inspection - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "security", "httpsi"], - "operation": "certificatesOrganizationApplianceSecurityHttpsi", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/httpsi/certificates" - - body_params = [ - "contents", - "serials", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"certificatesOrganizationApplianceSecurityHttpsi: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - def getOrganizationApplianceSecurityIntrusion(self, organizationId: str): """ **Returns all supported intrusion settings for an organization** @@ -4636,841 +4270,30 @@ def updateOrganizationApplianceSecurityIntrusion(self, organizationId: str, allo return self._session.put(metadata, resource, payload) - def getOrganizationApplianceSecurityIntrusionPolicies( + def getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **List the intrusion policies configured for an organization along with base policies.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-policies + **Display VPN exclusion rules for MX networks.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-traffic-shaping-vpn-exclusions-by-network - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 50. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - mode (string): Controls which policy set is returned. - - policyIds (array): Identifiers of policies to filter - - search (string): Filter policies by case-insensitive partial match on name or description. + - networkIds (array): Optional parameter to filter the results by network IDs """ kwargs.update(locals()) - if "mode" in kwargs: - options = ["base", "intrusion"] - assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies"], - "operation": "getOrganizationApplianceSecurityIntrusionPolicies", + "tags": ["appliance", "configure", "trafficShaping", "vpnExclusions", "byNetwork"], + "operation": "getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "mode", - "policyIds", - "search", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSecurityIntrusionPolicies: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, **kwargs): - """ - **Create a new intrusion policy for the organization.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy - - - organizationId (string): Organization ID - - policy (object): Attributes for the intrusion policy - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies"], - "operation": "createOrganizationApplianceSecurityIntrusionPolicy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies" - - body_params = [ - "policy", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationApplianceSecurityIntrusionPolicy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationApplianceSecurityIntrusionPoliciesOverviews( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List counts for the intrusion and base policies configured for an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-policies-overviews - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. - - 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. - - policyIds (array): Identifiers of policies to filter - - search (string): Filter policy overviews by case-insensitive partial match on policy name or description. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies", "overviews"], - "operation": "getOrganizationApplianceSecurityIntrusionPoliciesOverviews", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/overviews" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "policyIds", - "search", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSecurityIntrusionPoliciesOverviews: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def updateOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, policyId: str, policy: dict, **kwargs): - """ - **Update a single intrusion policy for the organization.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - policy (object): Attributes for the intrusion policy - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies"], - "operation": "updateOrganizationApplianceSecurityIntrusionPolicy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}" - - body_params = [ - "policy", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationApplianceSecurityIntrusionPolicy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, policyId: str): - """ - **Delete a single intrusion policy for the organization.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-policy - - - organizationId (string): Organization ID - - policyId (string): Policy ID - """ - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies"], - "operation": "deleteOrganizationApplianceSecurityIntrusionPolicy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}" - - return self._session.delete(metadata, resource) - - def declareOrganizationApplianceSecurityIntrusionPolicyRuleGroupsOverrides( - self, organizationId: str, policyId: str, items: list, **kwargs - ): - """ - **Declare the desired rule group overrides for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!declare-organization-appliance-security-intrusion-policy-rule-groups-overrides - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - items (array): Desired overrides state - - mode (string): Controls how the configuration payload in the request body is applied to the resource. This parameter dictates the declarative mode: - - * **`complete`**: The request body represents the entire desired configuration for this resource. Any existing configurations that are not included in the payload will be removed. - * **`partial` (default)**: The request body contains only the configurations to be created or modified. Existing configurations that are not specified in the payload will be preserved. - - - recursive (boolean): Controls how the configuration payload in the request body applies to the rule group hierarchy. When true, the API applies each declared override to the rule group itself and its descendants unless the payload explicitly sets a descendant override. When false (default), the API applies overrides only to the rule groups listed in the payload. - - """ - - kwargs.update(locals()) - - if "mode" in kwargs: - options = ["complete", "partial"] - assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies", "ruleGroups", "overrides"], - "operation": "declareOrganizationApplianceSecurityIntrusionPolicyRuleGroupsOverrides", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - resource = ( - f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/overrides/declare" - ) - - body_params = [ - "mode", - "recursive", - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"declareOrganizationApplianceSecurityIntrusionPolicyRuleGroupsOverrides: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def createOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride( - self, organizationId: str, policyId: str, ruleGroupId: str, override: dict, **kwargs - ): - """ - **Create a rule group override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy-rule-group-override - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleGroupId (string): Rule group ID - - override (object): Attributes for the override for a rule group in a intrusion policy - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies", "ruleGroups", "override"], - "operation": "createOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleGroupId = urllib.parse.quote(str(ruleGroupId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/{ruleGroupId}/override" - - body_params = [ - "override", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride( - self, organizationId: str, policyId: str, ruleGroupId: str, override: dict, **kwargs - ): - """ - **Update a rule group override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy-rule-group-override - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleGroupId (string): Rule group ID - - override (object): Attributes for the override for a rule group in a intrusion policy - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies", "ruleGroups", "override"], - "operation": "updateOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleGroupId = urllib.parse.quote(str(ruleGroupId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/{ruleGroupId}/override" - - body_params = [ - "override", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def declareOrganizationApplianceSecurityIntrusionPolicyRulesOverrides( - self, organizationId: str, policyId: str, items: list, **kwargs - ): - """ - **Declare the desired rule overrides for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!declare-organization-appliance-security-intrusion-policy-rules-overrides - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - items (array): Desired overrides state - - mode (string): Controls how the configuration payload in the request body is applied to the resource. This parameter dictates the declarative mode: - - * **`complete`**: The request body represents the entire desired configuration for this resource. Any existing configurations that are not included in the payload will be removed. This effectively performs a full replacement or overwrite of the resource's configuration. - * **`partial` (default)**: The request body contains only the configurations to be created or modified. Existing configurations that are not specified in the payload will be preserved. This performs a merge or partial update, applying only the changes specified. - - """ - - kwargs.update(locals()) - - if "mode" in kwargs: - options = ["complete", "partial"] - assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies", "rules", "overrides"], - "operation": "declareOrganizationApplianceSecurityIntrusionPolicyRulesOverrides", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/overrides/declare" - - body_params = [ - "mode", - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"declareOrganizationApplianceSecurityIntrusionPolicyRulesOverrides: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def createOrganizationApplianceSecurityIntrusionPolicyRuleOverride( - self, organizationId: str, policyId: str, ruleId: str, override: dict, **kwargs - ): - """ - **Create a rule override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy-rule-override - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleId (string): Rule ID - - override (object): Rule override to create - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies", "rules", "override"], - "operation": "createOrganizationApplianceSecurityIntrusionPolicyRuleOverride", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleId = urllib.parse.quote(str(ruleId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/{ruleId}/override" - - body_params = [ - "override", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationApplianceSecurityIntrusionPolicyRuleOverride: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationApplianceSecurityIntrusionPolicyRuleOverride( - self, organizationId: str, policyId: str, ruleId: str, override: dict, **kwargs - ): - """ - **Update a rule override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy-rule-override - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleId (string): Rule ID - - override (object): Override attributes - """ - - kwargs = locals() - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "policies", "rules", "override"], - "operation": "updateOrganizationApplianceSecurityIntrusionPolicyRuleOverride", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleId = urllib.parse.quote(str(ruleId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/{ruleId}/override" - - body_params = [ - "override", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationApplianceSecurityIntrusionPolicyRuleOverride: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def getOrganizationApplianceSecurityIntrusionRuleGroups( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the rule groups that belong to a security policy.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rule-groups - - - 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 - 500. 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. - - policyIds (array): Collection of base or intrusion policy identifiers to filter results by - - parentRuleGroupIds (array): Filter results to rule groups whose parent matches any of the provided identifiers - - search (string): Case-insensitive text filter applied to rule group name and description - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups"], - "operation": "getOrganizationApplianceSecurityIntrusionRuleGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "policyIds", - "parentRuleGroupIds", - "search", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - "parentRuleGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSecurityIntrusionRuleGroups: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationApplianceSecurityIntrusionRuleGroupsOverrides( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the rule group overrides configured for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rule-groups-overrides - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. - - 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. - - policyIds (array): Collection of intrusion policy identifiers to filter the overrides by. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups", "overrides"], - "operation": "getOrganizationApplianceSecurityIntrusionRuleGroupsOverrides", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups/overrides" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "policyIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSecurityIntrusionRuleGroupsOverrides: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def deleteOrganizationApplianceSecurityIntrusionRuleGroupsOverride(self, organizationId: str, overrideId: str): - """ - **Delete a rule group override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-rule-groups-override - - - organizationId (string): Organization ID - - overrideId (string): Override ID - """ - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups", "overrides"], - "operation": "deleteOrganizationApplianceSecurityIntrusionRuleGroupsOverride", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - overrideId = urllib.parse.quote(str(overrideId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups/overrides/{overrideId}" - - return self._session.delete(metadata, resource) - - def getOrganizationApplianceSecurityIntrusionRuleGroupsOverviews( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List counts for the child rule groups and rules for each rule group in a security policy.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rule-groups-overviews - - - 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 - 500. 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. - - policyIds (array): Collection of base or intrusion policy identifiers to filter results by - - parentRuleGroupIds (array): Filter results to rule groups whose parent matches any of the provided identifiers - - search (string): Case-insensitive text filter applied to rule group name and description - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups", "overviews"], - "operation": "getOrganizationApplianceSecurityIntrusionRuleGroupsOverviews", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups/overviews" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "policyIds", - "parentRuleGroupIds", - "search", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - "parentRuleGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSecurityIntrusionRuleGroupsOverviews: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationApplianceSecurityIntrusionRules(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the rules that belong to a security policy.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rules - - - 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 - 500. 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. - - policyIds (array): Identifiers of the base or intrusion policies to query - - parentRuleGroupIds (array): Filter results to rules that belong to any of the specified rule groups - - search (string): Case-insensitive text filter applied to rule name and description - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "rules"], - "operation": "getOrganizationApplianceSecurityIntrusionRules", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/rules" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "policyIds", - "parentRuleGroupIds", - "search", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - "parentRuleGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSecurityIntrusionRules: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationApplianceSecurityIntrusionRulesOverrides( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the rule overrides configured for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rules-overrides - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. - - 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. - - policyIds (array): Identifiers of intrusion policies to filter - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "rules", "overrides"], - "operation": "getOrganizationApplianceSecurityIntrusionRulesOverrides", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/rules/overrides" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "policyIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceSecurityIntrusionRulesOverrides: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def deleteOrganizationApplianceSecurityIntrusionRulesOverride(self, organizationId: str, overrideId: str): - """ - **Delete a rule override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-rules-override - - - organizationId (string): Organization ID - - overrideId (string): Override ID - """ - - metadata = { - "tags": ["appliance", "configure", "security", "intrusion", "rules", "overrides"], - "operation": "deleteOrganizationApplianceSecurityIntrusionRulesOverride", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - overrideId = urllib.parse.quote(str(overrideId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/rules/overrides/{overrideId}" - - return self._session.delete(metadata, resource) - - def getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Display VPN exclusion rules for MX networks.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-traffic-shaping-vpn-exclusions-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 50. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter the results by network IDs - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "trafficShaping", "vpnExclusions", "byNetwork"], - "operation": "getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/trafficShaping/vpnExclusions/byNetwork" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationApplianceUmbrellaPoliciesByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List Umbrella policy IDs applied to MX networks in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-umbrella-policies-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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): Filter results to only the given network IDs - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "umbrella", "policies", "byNetwork"], - "operation": "getOrganizationApplianceUmbrellaPoliciesByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/umbrella/policies/byNetwork" + resource = f"/organizations/{organizationId}/appliance/trafficShaping/vpnExclusions/byNetwork" query_params = [ "perPage", @@ -5493,7 +4316,7 @@ def getOrganizationApplianceUmbrellaPoliciesByNetwork( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationApplianceUmbrellaPoliciesByNetwork: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) @@ -5683,282 +4506,6 @@ def getOrganizationApplianceUplinksUsageByNetwork(self, organizationId: str, **k return self._session.get(metadata, resource, params) - def getOrganizationApplianceVlans(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the VLANs for an Organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vlans - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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": ["appliance", "configure", "vlans"], - "operation": "getOrganizationApplianceVlans", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/vlans" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationApplianceVlans: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationApplianceVpnConnectivityVpnPeersByNetwork(self, organizationId: str, **kwargs): - """ - **Summarizes by-device vpn peers for the organization in the given interval.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vpn-connectivity-vpn-peers-by-network - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 1 day. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 3600, 14400, 86400. The default is 3600. Interval is calculated if time params are provided. - - networkIds (array): Filter results by network. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "monitor", "vpn", "connectivity", "vpnPeers", "byNetwork"], - "operation": "getOrganizationApplianceVpnConnectivityVpnPeersByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/vpn/connectivity/vpnPeers/byNetwork" - - query_params = [ - "t0", - "t1", - "timespan", - "interval", - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceVpnConnectivityVpnPeersByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationApplianceVpnRemoteAccessSecureClientAuthenticationByClient(self, organizationId: str, **kwargs): - """ - **Get authentication for all clients in organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vpn-remote-access-secure-client-authentication-by-client - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "monitor", "vpn", "remoteAccess", "secureClient", "authentication", "byClient"], - "operation": "getOrganizationApplianceVpnRemoteAccessSecureClientAuthenticationByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/vpn/remoteAccess/secureClient/authentication/byClient" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceVpnRemoteAccessSecureClientAuthenticationByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationApplianceVpnRemoteAccessSecureClientIpAssignmentByClient(self, organizationId: str, **kwargs): - """ - **Get IP assignment for all clients in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vpn-remote-access-secure-client-ip-assignment-by-client - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "monitor", "vpn", "remoteAccess", "secureClient", "ipAssignment", "byClient"], - "operation": "getOrganizationApplianceVpnRemoteAccessSecureClientIpAssignmentByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/vpn/remoteAccess/secureClient/ipAssignment/byClient" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceVpnRemoteAccessSecureClientIpAssignmentByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationApplianceVpnRemoteAccessSecureClientTunnelCreationByClient(self, organizationId: str, **kwargs): - """ - **Get tunnel creation events for all clients in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vpn-remote-access-secure-client-tunnel-creation-by-client - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "monitor", "vpn", "remoteAccess", "secureClient", "tunnelCreation", "byClient"], - "operation": "getOrganizationApplianceVpnRemoteAccessSecureClientTunnelCreationByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/vpn/remoteAccess/secureClient/tunnelCreation/byClient" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceVpnRemoteAccessSecureClientTunnelCreationByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationApplianceVpnSiteToSiteHubsVrfs(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return source-to-hub VRF mappings for site-to-site VPN within an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vpn-site-to-site-hubs-vrfs - - - 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 - 500. 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 source-to-hub mappings by source network IDs. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["appliance", "configure", "vpn", "siteToSite", "hubs", "vrfs"], - "operation": "getOrganizationApplianceVpnSiteToSiteHubsVrfs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/vpn/siteToSite/hubs/vrfs" - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApplianceVpnSiteToSiteHubsVrfs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationApplianceVpnSiteToSiteIpsecPeersSlas(self, organizationId: str): """ **Get the list of available IPsec SLA policies for an organization** diff --git a/meraki/api/assistant.py b/meraki/api/assistant.py deleted file mode 100644 index e76b269..0000000 --- a/meraki/api/assistant.py +++ /dev/null @@ -1,491 +0,0 @@ -import urllib - - -class Assistant(object): - def __init__(self, session): - super(Assistant, self).__init__() - self._session = session - - def getOrganizationAssistantCapabilities(self, organizationId: str): - """ - **List the AI assistant's available capabilities and agents for this organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-capabilities - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["assistant", "configure", "capabilities"], - "operation": "getOrganizationAssistantCapabilities", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assistant/capabilities" - - return self._session.get(metadata, resource) - - def createOrganizationAssistantChatCompletion(self, organizationId: str, **kwargs): - """ - **Create a chat completion with the AI assistant** - https://developer.cisco.com/meraki/api-v1/#!create-organization-assistant-chat-completion - - - organizationId (string): Organization ID - - query (string): Simple text question or instruction to send to the AI assistant. Provide either 'query' for text-only requests or 'content' for multi-modal input. - - content (array): List of multi-modal content blocks. Use instead of 'query' to send text or images. Supports text and image types only; for audio and file support, use the messages endpoint. Maximum 8 parts. - - threadId (string): An existing thread ID to continue a conversation. If omitted, a new thread is created. - - networkId (string): Optional network ID to scope the query to a specific network. Defaults to the user's last visited network. - - platform (string): Platform identifier. Defaults to MERAKI when omitted. Case-insensitive. - - language (string): Optional language override. Defaults to the user's preferred language. - - country (string): Optional country override. Defaults to the user's country. - """ - - kwargs.update(locals()) - - if "platform" in kwargs: - options = ["DIGITAL_TWIN", "DNAC", "MERAKI", "digital_twin", "dnac", "meraki"] - assert kwargs["platform"] in options, ( - f'''"platform" cannot be "{kwargs["platform"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["assistant", "configure", "chat", "completions"], - "operation": "createOrganizationAssistantChatCompletion", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/completions" - - body_params = [ - "query", - "content", - "threadId", - "networkId", - "platform", - "language", - "country", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationAssistantChatCompletion: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationAssistantChatThreads(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List all active conversation threads for the authenticated user.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-chat-threads - - - 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): Number of entries per page. Defaults to 100. Maximum 1000. - - sort (string): Field to sort results by. Defaults to dateModified. - - sortOrder (string): Sort direction for results. Defaults to desc. - - from (string): Filter threads modified after this timestamp. - - to (string): Filter threads modified before this timestamp. - """ - - kwargs.update(locals()) - - if "sort" in kwargs: - options = ["dateModified", "id", "name"] - assert kwargs["sort"] in options, f'''"sort" cannot be "{kwargs["sort"]}", & must be set to one of: {options}''' - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["assistant", "configure", "chat", "threads"], - "operation": "getOrganizationAssistantChatThreads", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads" - - query_params = [ - "perPage", - "sort", - "sortOrder", - "from", - "to", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationAssistantChatThreads: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationAssistantChatThread(self, organizationId: str, **kwargs): - """ - **Create a new conversation thread.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-assistant-chat-thread - - - organizationId (string): Organization ID - - threadName (string): Display name for the new thread. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["assistant", "configure", "chat", "threads"], - "operation": "createOrganizationAssistantChatThread", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads" - - body_params = [ - "threadName", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationAssistantChatThread: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationAssistantChatThread(self, organizationId: str, threadId: str): - """ - **Return a single conversation thread.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-chat-thread - - - organizationId (string): Organization ID - - threadId (string): Thread ID - """ - - metadata = { - "tags": ["assistant", "configure", "chat", "threads"], - "operation": "getOrganizationAssistantChatThread", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}" - - return self._session.get(metadata, resource) - - def updateOrganizationAssistantChatThread(self, organizationId: str, threadId: str, threadName: str, **kwargs): - """ - **Update the name of a conversation thread.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-assistant-chat-thread - - - organizationId (string): Organization ID - - threadId (string): Thread ID - - threadName (string): New display name for the thread. - """ - - kwargs = locals() - - metadata = { - "tags": ["assistant", "configure", "chat", "threads"], - "operation": "updateOrganizationAssistantChatThread", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}" - - body_params = [ - "threadName", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationAssistantChatThread: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationAssistantChatThread(self, organizationId: str, threadId: str): - """ - **Delete a conversation thread and all its messages.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-assistant-chat-thread - - - organizationId (string): Organization ID - - threadId (string): Thread ID - """ - - metadata = { - "tags": ["assistant", "configure", "chat", "threads"], - "operation": "deleteOrganizationAssistantChatThread", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}" - - return self._session.delete(metadata, resource) - - def getOrganizationAssistantChatThreadMessages( - self, organizationId: str, threadId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List messages in a conversation thread.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-chat-thread-messages - - - organizationId (string): Organization ID - - threadId (string): Thread 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): Number of entries per page. Defaults to 100. Maximum 1000. - - sortOrder (string): Sort direction for results by timestamp. Defaults to asc. - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["assistant", "configure", "chat", "threads", "messages"], - "operation": "getOrganizationAssistantChatThreadMessages", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages" - - query_params = [ - "perPage", - "sortOrder", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssistantChatThreadMessages: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationAssistantChatThreadMessage(self, organizationId: str, threadId: str, content: list, **kwargs): - """ - **Create a new chat message in a thread.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-assistant-chat-thread-message - - - organizationId (string): Organization ID - - threadId (string): Thread ID - - content (array): List of message content parts. Supports text, image, audio, and file types. Maximum 8 parts. - - networkName (string): Name of the target network. - - networkId (string): Optional Meraki network ID for thread context. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["assistant", "configure", "chat", "threads", "messages"], - "operation": "createOrganizationAssistantChatThreadMessage", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages" - - body_params = [ - "content", - "networkName", - "networkId", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationAssistantChatThreadMessage: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationAssistantChatThreadMessage(self, organizationId: str, threadId: str, messageId: str): - """ - **Return a single message in a conversation thread.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-chat-thread-message - - - organizationId (string): Organization ID - - threadId (string): Thread ID - - messageId (string): Message ID - """ - - metadata = { - "tags": ["assistant", "configure", "chat", "threads", "messages"], - "operation": "getOrganizationAssistantChatThreadMessage", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - messageId = urllib.parse.quote(str(messageId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages/{messageId}" - - return self._session.get(metadata, resource) - - def getOrganizationAssistantChatThreadMessageArtifacts(self, organizationId: str, threadId: str, messageId: str): - """ - **List artifacts attached to a specific message** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-chat-thread-message-artifacts - - - organizationId (string): Organization ID - - threadId (string): Thread ID - - messageId (string): Message ID - """ - - metadata = { - "tags": ["assistant", "configure", "chat", "threads", "messages", "artifacts"], - "operation": "getOrganizationAssistantChatThreadMessageArtifacts", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - messageId = urllib.parse.quote(str(messageId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages/{messageId}/artifacts" - - return self._session.get(metadata, resource) - - def getOrganizationAssistantChatThreadMessageArtifact( - self, organizationId: str, threadId: str, messageId: str, artifactId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Return a single artifact with its full content.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-chat-thread-message-artifact - - - organizationId (string): Organization ID - - threadId (string): Thread ID - - messageId (string): Message ID - - artifactId (string): Artifact 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 - - page (integer): Page number for paginated artifact content, defaulting to 1 - - perPage (integer): Number of entries per page. Defaults to 100. Maximum 1000. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["assistant", "configure", "chat", "threads", "messages", "artifacts"], - "operation": "getOrganizationAssistantChatThreadMessageArtifact", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - messageId = urllib.parse.quote(str(messageId), safe="") - artifactId = urllib.parse.quote(str(artifactId), safe="") - resource = ( - f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages/{messageId}/artifacts/{artifactId}" - ) - - query_params = [ - "page", - "perPage", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssistantChatThreadMessageArtifact: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssistantChatThreadMessageFeedback(self, organizationId: str, threadId: str, messageId: str): - """ - **Return all feedback entries previously submitted for a specific message in a thread.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-chat-thread-message-feedback - - - organizationId (string): Organization ID - - threadId (string): Thread ID - - messageId (string): Message ID - """ - - metadata = { - "tags": ["assistant", "configure", "chat", "threads", "messages", "feedback"], - "operation": "getOrganizationAssistantChatThreadMessageFeedback", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - messageId = urllib.parse.quote(str(messageId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages/{messageId}/feedback" - - return self._session.get(metadata, resource) - - def createOrganizationAssistantChatThreadMessageFeedback( - self, organizationId: str, threadId: str, messageId: str, vote: bool, **kwargs - ): - """ - **Submit or replace feedback for a specific assistant message.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-assistant-chat-thread-message-feedback - - - organizationId (string): Organization ID - - threadId (string): Thread ID - - messageId (string): Message ID - - vote (boolean): True for positive, false for negative. - - reason (string): Optional free-text reason for the feedback (e.g., 'inaccurate', 'incomplete', 'helpful'). Not constrained to a fixed set of values. - - comment (string): Optional free-text comment providing additional detail. - - message (string): The assistant message text the feedback refers to. Captured for analytics; not required. - - prompt (string): The user prompt that produced the assistant message. Captured for analytics; not required. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["assistant", "configure", "chat", "threads", "messages", "feedback"], - "operation": "createOrganizationAssistantChatThreadMessageFeedback", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - threadId = urllib.parse.quote(str(threadId), safe="") - messageId = urllib.parse.quote(str(messageId), safe="") - resource = f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages/{messageId}/feedback" - - body_params = [ - "vote", - "reason", - "comment", - "message", - "prompt", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationAssistantChatThreadMessageFeedback: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationAssistantQueryLimits(self, organizationId: str): - """ - **Get query limits for the AI assistant for this organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assistant-query-limits - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["assistant", "configure", "queryLimits"], - "operation": "getOrganizationAssistantQueryLimits", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assistant/queryLimits" - - return self._session.get(metadata, resource) diff --git a/meraki/api/batch/appliance.py b/meraki/api/batch/appliance.py index e8ba826..a672cfb 100644 --- a/meraki/api/batch/appliance.py +++ b/meraki/api/batch/appliance.py @@ -16,21 +16,10 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): - personality (object): Describes the port's configurability - uplink (object): The port's settings when in WAN mode - downlink (object): The port's VLAN settings when in LAN mode - - speed (string): Link speed for the port, in Mbps - - duplex (string): Duplex configuration for the port """ kwargs.update(locals()) - if "speed" in kwargs and kwargs["speed"] is not None: - options = ["10", "100", "1000", "10000", "2500", "25000", "5000", "auto"] - assert kwargs["speed"] in options, f'''"speed" cannot be "{kwargs["speed"]}", & must be set to one of: {options}''' - if "duplex" in kwargs and kwargs["duplex"] is not None: - options = ["auto", "full", "half"] - assert kwargs["duplex"] in options, ( - f'''"duplex" cannot be "{kwargs["duplex"]}", & must be set to one of: {options}''' - ) - serial = urllib.parse.quote(str(serial), safe="") resource = f"/devices/{serial}/appliance/interfaces/ports/update" @@ -40,54 +29,6 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): "personality", "uplink", "downlink", - "speed", - "duplex", - ] - 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 updateDeviceApplianceInterfacesPort(self, serial: str, number: str, **kwargs): - """ - **Update configurations for an appliance's specified port** - https://developer.cisco.com/meraki/api-v1/#!update-device-appliance-interfaces-port - - - serial (string): Serial - - number (string): Number - - enabled (boolean): Indicates whether the port is enabled - - personality (object): Describes the port's configurability - - uplink (object): The port's settings when in WAN mode - - downlink (object): The port's VLAN settings when in LAN mode - - speed (string): Link speed for the port, in Mbps - - duplex (string): Duplex configuration for the port - """ - - kwargs.update(locals()) - - if "speed" in kwargs and kwargs["speed"] is not None: - options = ["10", "100", "1000", "10000", "2500", "25000", "5000", "auto"] - assert kwargs["speed"] in options, f'''"speed" cannot be "{kwargs["speed"]}", & must be set to one of: {options}''' - if "duplex" in kwargs and kwargs["duplex"] is not None: - options = ["auto", "full", "half"] - assert kwargs["duplex"] in options, ( - f'''"duplex" cannot be "{kwargs["duplex"]}", & must be set to one of: {options}''' - ) - - serial = urllib.parse.quote(str(serial), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/devices/{serial}/appliance/interfaces/ports/{number}" - - body_params = [ - "enabled", - "personality", - "uplink", - "downlink", - "speed", - "duplex", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -303,7 +244,6 @@ def createNetworkApplianceInterfacesL3(self, networkId: str, ipv4: dict, **kwarg - networkId (string): Network ID - ipv4 (object): IPv4 configuration - port (object): Port configuration - - vrf (object): VRF assignment for the L3 interface """ kwargs.update(locals()) @@ -314,7 +254,6 @@ def createNetworkApplianceInterfacesL3(self, networkId: str, ipv4: dict, **kwarg body_params = [ "port", "ipv4", - "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -333,7 +272,6 @@ def updateNetworkApplianceInterfacesL3(self, networkId: str, interfaceId: str, * - interfaceId (string): Interface ID - port (object): Port configuration - ipv4 (object): IPv4 configuration - - vrf (object): VRF assignment for the L3 interface """ kwargs.update(locals()) @@ -345,7 +283,6 @@ def updateNetworkApplianceInterfacesL3(self, networkId: str, interfaceId: str, * body_params = [ "port", "ipv4", - "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -387,8 +324,6 @@ def updateNetworkAppliancePort(self, networkId: str, portId: str, **kwargs): - vlan (integer): Native VLAN when the port is in Trunk mode. Access VLAN when the port is in Access mode. - allowedVlans (string): Comma-delimited list of VLAN IDs (e.g. '2,15') for all devices. Secure Routers also support VLAN ranges (e.g. '2-10,15'). Use 'all' to permit all VLANs on the port. - accessPolicy (string): The name of the policy. Only applicable to Access ports. Valid values are: 'open', '8021x-radius', 'mac-radius', 'hybris-radius' for MX64 or Z3 or any MX supporting the per port authentication feature. Otherwise, 'open' is the only valid value and 'open' is the default value if the field is missing. - - peerSgtCapable (boolean): If true, Peer SGT is enabled for traffic through this port. Applicable to trunk port only, not access port. - - adaptivePolicyGroupId (string): Adaptive policy group ID that all traffic originating from this port is assigned to. - sgt (object): Security Group Tag settings for the port. """ @@ -405,8 +340,6 @@ def updateNetworkAppliancePort(self, networkId: str, portId: str, **kwargs): "vlan", "allowedVlans", "accessPolicy", - "peerSgtCapable", - "adaptivePolicyGroupId", "sgt", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -654,7 +587,6 @@ def updateNetworkApplianceSingleLan(self, networkId: str, **kwargs): - applianceIp (string): The appliance IP address of the single LAN - ipv6 (object): IPv6 configuration on the VLAN - mandatoryDhcp (object): Mandatory DHCP will enforce that clients connecting to this LAN must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. Only available on firmware versions 17.0 and above - - vrf (object): VRF configuration on the Single LAN. Omit this field to preserve the current VRF. """ kwargs.update(locals()) @@ -667,7 +599,6 @@ def updateNetworkApplianceSingleLan(self, networkId: str, **kwargs): "applianceIp", "ipv6", "mandatoryDhcp", - "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -923,7 +854,6 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw - networkId (string): Network ID - custom (array): Custom VPN exclusion rules. Pass an empty array to clear existing rules. - majorApplications (array): Major Application based VPN exclusion rules. Pass an empty array to clear existing rules. - - applications (array): NBAR Application based VPN exclusion rules. Available for networks on >=19.2 firmware """ kwargs.update(locals()) @@ -934,7 +864,6 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw body_params = [ "custom", "majorApplications", - "applications", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -986,23 +915,6 @@ def disconnectNetworkApplianceUmbrellaAccount(self, networkId: str): } return action - def disableNetworkApplianceUmbrellaProtection(self, networkId: str): - """ - **Disable umbrella protection for an MX network** - https://developer.cisco.com/meraki/api-v1/#!disable-network-appliance-umbrella-protection - - - networkId (string): Network ID - """ - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/appliance/umbrella/disableProtection" - - action = { - "resource": resource, - "operation": "action", - } - return action - def exclusionsNetworkApplianceUmbrellaDomains(self, networkId: str, domains: list, **kwargs): """ **Specify one or more domain names to be excluded from being routed to Cisco Umbrella.** @@ -1028,48 +940,6 @@ def exclusionsNetworkApplianceUmbrellaDomains(self, networkId: str, domains: lis } return action - def enableNetworkApplianceUmbrellaProtection(self, networkId: str): - """ - **Enable umbrella protection for an MX network** - https://developer.cisco.com/meraki/api-v1/#!enable-network-appliance-umbrella-protection - - - networkId (string): Network ID - """ - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/appliance/umbrella/enableProtection" - - action = { - "resource": resource, - "operation": "action", - } - return action - - def policiesNetworkApplianceUmbrella(self, networkId: str, policyIds: list, **kwargs): - """ - **Update umbrella policies applied to MX network.** - https://developer.cisco.com/meraki/api-v1/#!policies-network-appliance-umbrella - - - networkId (string): Network ID - - policyIds (array): Array of umbrella policy IDs - """ - - kwargs = locals() - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/appliance/umbrella/policies" - - body_params = [ - "policyIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "action", - "body": payload, - } - return action - def addNetworkApplianceUmbrellaPolicies(self, networkId: str, policy: dict, **kwargs): """ **Add one Cisco Umbrella DNS security policy to an MX network by policy ID. Idempotent — if the policy is already applied, the request succeeds and returns the current policy set unchanged.** @@ -1193,7 +1063,6 @@ def createNetworkApplianceVlan(self, networkId: str, id: str, name: str, **kwarg - dhcpBootNextServer (string): DHCP boot option to direct boot clients to the server to load the boot file from - dhcpBootFilename (string): DHCP boot option for boot filename - dhcpOptions (array): The list of DHCP options that will be included in DHCP responses. Each object in the list should have "code", "type", and "value" properties. - - adaptivePolicyGroupId (string): Adaptive policy group ID this VLAN is assigned to. - sgt (object): Security Group Tag settings for the VLAN. - vrf (object): VRF configuration on the VLAN. - uplinks (array): Per-uplink NAT exception override configuration on the VLAN. Applicable only for networks that support NAT exceptions. @@ -1238,7 +1107,6 @@ def createNetworkApplianceVlan(self, networkId: str, id: str, name: str, **kwarg "dhcpBootNextServer", "dhcpBootFilename", "dhcpOptions", - "adaptivePolicyGroupId", "sgt", "vrf", "uplinks", @@ -1303,7 +1171,6 @@ def updateNetworkApplianceVlan(self, networkId: str, vlanId: str, **kwargs): - mask (integer): Mask used for the subnet of all bound to the template networks. Applicable only for template network. - ipv6 (object): IPv6 configuration on the VLAN - mandatoryDhcp (object): Mandatory DHCP will enforce that clients connecting to this VLAN must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. Only available on firmware versions 17.0 and above - - adaptivePolicyGroupId (string): Adaptive policy group ID that all traffic originating from this VLAN is assigned to. - sgt (object): Security Group Tag settings for the VLAN. - vrf (object): VRF configuration on the VLAN. - uplinks (array): Per-uplink NAT exception override configuration on the VLAN. Applicable only for networks that support NAT exceptions. @@ -1352,7 +1219,6 @@ def updateNetworkApplianceVlan(self, networkId: str, vlanId: str, **kwargs): "mask", "ipv6", "mandatoryDhcp", - "adaptivePolicyGroupId", "sgt", "vrf", "uplinks", @@ -1393,22 +1259,12 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): - enabled (boolean): Boolean value to enable or disable the BGP configuration. When BGP is enabled, the asNumber (ASN) will be autopopulated with the preconfigured ASN at other Hubs or a default value if there is no ASN configured. - asNumber (integer): An Autonomous System Number (ASN) is required if you are to run BGP and peer with another BGP Speaker outside of the Auto VPN domain. This ASN will be applied to the entire Auto VPN domain and is only configurable for Auto VPN BGP networks. The entire 4-byte ASN range is supported. So, the ASN must be an integer between 1 and 4294967295. When absent, this field is not updated. If no value exists then it defaults to 64512. - ibgpHoldTimer (integer): The iBGP holdtimer in seconds. The iBGP holdtimer must be an integer between 12 and 240. When absent, this field is not updated. If no value exists then it defaults to 240. - - ipv6 (object): Settings for IPv6 configurations on the organization. - - tunnelDownTermination (object): Settings for tunnel down termination on the organization. - - vpnAsNumber (integer): Network specific number of the Autonomous System to which the appliance belongs. This field is only configurable for Independent BGP networks. - - priorityRoute (string): Sets the priority route between eBGP and Auto VPN. - routerId (string): The router ID of the appliance - neighbors (array): List of BGP neighbors. This list replaces the existing set of neighbors. When absent, this field is not updated. """ kwargs.update(locals()) - if "priorityRoute" in kwargs and kwargs["priorityRoute"] is not None: - options = ["Auto VPN", "eBGP"] - assert kwargs["priorityRoute"] in options, ( - f'''"priorityRoute" cannot be "{kwargs["priorityRoute"]}", & must be set to one of: {options}''' - ) - networkId = urllib.parse.quote(str(networkId), safe="") resource = f"/networks/{networkId}/appliance/vpn/bgp" @@ -1416,10 +1272,6 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): "enabled", "asNumber", "ibgpHoldTimer", - "ipv6", - "tunnelDownTermination", - "vpnAsNumber", - "priorityRoute", "routerId", "neighbors", ] @@ -1431,33 +1283,6 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): } return action - def updateNetworkApplianceVpnSiteToSiteHubVrfs(self, networkId: str, hubNetworkId: str, _json: list, **kwargs): - """ - **Update the VRF mappings for a source network and hub pair.** - https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-vpn-site-to-site-hub-vrfs - - - networkId (string): Network ID - - hubNetworkId (string): Hub network ID - - _json (array): The list of VRFs for this source and hub mapping. - """ - - kwargs = locals() - - networkId = urllib.parse.quote(str(networkId), safe="") - hubNetworkId = urllib.parse.quote(str(hubNetworkId), safe="") - resource = f"/networks/{networkId}/appliance/vpn/siteToSite/hubs/{hubNetworkId}/vrfs" - - body_params = [ - "_json", - ] - 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 updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kwargs): """ **Update the site-to-site VPN settings of a network. Only valid for MX networks in NAT mode.** @@ -1467,7 +1292,6 @@ def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kw - mode (string): The site-to-site VPN mode. Can be one of 'none', 'spoke' or 'hub' - hubs (array): The list of VPN hubs, in order of preference. In spoke mode, at least 1 hub is required. - subnets (array): The list of subnets and their VPN presence. - - peerSgtCapable (boolean): Whether or not Peer SGT is enabled for traffic to this VPN peer. - sgt (object): Security Group Tag settings for the VPN peer. - subnet (object): Configuration of subnet features - hostTranslations (array): The list of VPN host translations. Host translations are supported starting from MX firmware version 26.1.2 @@ -1486,7 +1310,6 @@ def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kw "mode", "hubs", "subnets", - "peerSgtCapable", "sgt", "subnet", "hostTranslations", @@ -1907,322 +1730,6 @@ def updateOrganizationApplianceRoutingVrfsSettings(self, organizationId: str, en } return action - def createOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, **kwargs): - """ - **Create a new intrusion policy for the organization.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy - - - organizationId (string): Organization ID - - policy (object): Attributes for the intrusion policy - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies" - - body_params = [ - "policy", - ] - 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 updateOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, policyId: str, policy: dict, **kwargs): - """ - **Update a single intrusion policy for the organization.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - policy (object): Attributes for the intrusion policy - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}" - - body_params = [ - "policy", - ] - 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 deleteOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, policyId: str): - """ - **Delete a single intrusion policy for the organization.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-policy - - - organizationId (string): Organization ID - - policyId (string): Policy ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def declareOrganizationApplianceSecurityIntrusionPolicyRuleGroupsOverrides( - self, organizationId: str, policyId: str, items: list, **kwargs - ): - """ - **Declare the desired rule group overrides for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!declare-organization-appliance-security-intrusion-policy-rule-groups-overrides - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - items (array): Desired overrides state - - mode (string): Controls how the configuration payload in the request body is applied to the resource. This parameter dictates the declarative mode: - - * **`complete`**: The request body represents the entire desired configuration for this resource. Any existing configurations that are not included in the payload will be removed. - * **`partial` (default)**: The request body contains only the configurations to be created or modified. Existing configurations that are not specified in the payload will be preserved. - - - recursive (boolean): Controls how the configuration payload in the request body applies to the rule group hierarchy. When true, the API applies each declared override to the rule group itself and its descendants unless the payload explicitly sets a descendant override. When false (default), the API applies overrides only to the rule groups listed in the payload. - - """ - - kwargs.update(locals()) - - if "mode" in kwargs: - options = ["complete", "partial"] - assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' - - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - resource = ( - f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/overrides/declare" - ) - - body_params = [ - "mode", - "recursive", - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "declare", - "body": payload, - } - return action - - def createOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride( - self, organizationId: str, policyId: str, ruleGroupId: str, override: dict, **kwargs - ): - """ - **Create a rule group override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy-rule-group-override - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleGroupId (string): Rule group ID - - override (object): Attributes for the override for a rule group in a intrusion policy - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleGroupId = urllib.parse.quote(str(ruleGroupId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/{ruleGroupId}/override" - - body_params = [ - "override", - ] - 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 updateOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride( - self, organizationId: str, policyId: str, ruleGroupId: str, override: dict, **kwargs - ): - """ - **Update a rule group override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy-rule-group-override - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleGroupId (string): Rule group ID - - override (object): Attributes for the override for a rule group in a intrusion policy - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleGroupId = urllib.parse.quote(str(ruleGroupId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/{ruleGroupId}/override" - - body_params = [ - "override", - ] - 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 declareOrganizationApplianceSecurityIntrusionPolicyRulesOverrides( - self, organizationId: str, policyId: str, items: list, **kwargs - ): - """ - **Declare the desired rule overrides for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!declare-organization-appliance-security-intrusion-policy-rules-overrides - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - items (array): Desired overrides state - - mode (string): Controls how the configuration payload in the request body is applied to the resource. This parameter dictates the declarative mode: - - * **`complete`**: The request body represents the entire desired configuration for this resource. Any existing configurations that are not included in the payload will be removed. This effectively performs a full replacement or overwrite of the resource's configuration. - * **`partial` (default)**: The request body contains only the configurations to be created or modified. Existing configurations that are not specified in the payload will be preserved. This performs a merge or partial update, applying only the changes specified. - - """ - - kwargs.update(locals()) - - if "mode" in kwargs: - options = ["complete", "partial"] - assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' - - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/overrides/declare" - - body_params = [ - "mode", - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "declare", - "body": payload, - } - return action - - def createOrganizationApplianceSecurityIntrusionPolicyRuleOverride( - self, organizationId: str, policyId: str, ruleId: str, override: dict, **kwargs - ): - """ - **Create a rule override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy-rule-override - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleId (string): Rule ID - - override (object): Rule override to create - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleId = urllib.parse.quote(str(ruleId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/{ruleId}/override" - - body_params = [ - "override", - ] - 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 updateOrganizationApplianceSecurityIntrusionPolicyRuleOverride( - self, organizationId: str, policyId: str, ruleId: str, override: dict, **kwargs - ): - """ - **Update a rule override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy-rule-override - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleId (string): Rule ID - - override (object): Override attributes - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleId = urllib.parse.quote(str(ruleId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/{ruleId}/override" - - body_params = [ - "override", - ] - 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 deleteOrganizationApplianceSecurityIntrusionRuleGroupsOverride(self, organizationId: str, overrideId: str): - """ - **Delete a rule group override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-rule-groups-override - - - organizationId (string): Organization ID - - overrideId (string): Override ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - overrideId = urllib.parse.quote(str(overrideId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups/overrides/{overrideId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def deleteOrganizationApplianceSecurityIntrusionRulesOverride(self, organizationId: str, overrideId: str): - """ - **Delete a rule override for an intrusion policy.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-rules-override - - - organizationId (string): Organization ID - - overrideId (string): Override ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - overrideId = urllib.parse.quote(str(overrideId), safe="") - resource = f"/organizations/{organizationId}/appliance/security/intrusion/rules/overrides/{overrideId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - def updateOrganizationApplianceVpnSiteToSiteIpsecPeersSlas(self, organizationId: str, **kwargs): """ **Update the IPsec SLA policies for an organization** diff --git a/meraki/api/batch/assistant.py b/meraki/api/batch/assistant.py deleted file mode 100644 index 31bf678..0000000 --- a/meraki/api/batch/assistant.py +++ /dev/null @@ -1,3 +0,0 @@ -class ActionBatchAssistant(object): - def __init__(self): - super(ActionBatchAssistant, self).__init__() diff --git a/meraki/api/batch/camera.py b/meraki/api/batch/camera.py index de7d570..c4bde39 100644 --- a/meraki/api/batch/camera.py +++ b/meraki/api/batch/camera.py @@ -167,82 +167,3 @@ def updateDeviceCameraWirelessProfiles(self, serial: str, ids: dict, **kwargs): "body": payload, } return action - - def createNetworkCameraVideoWall(self, networkId: str, name: str, tiles: list, **kwargs): - """ - **Create a new video wall.** - https://developer.cisco.com/meraki/api-v1/#!create-network-camera-video-wall - - - networkId (string): Network ID - - name (string): The name of the video wall. - - tiles (array): The tiles that should appear on the video wall. - - index (integer): The order that this wall should appear on the video wall list. - """ - - kwargs.update(locals()) - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/camera/videoWalls" - - body_params = [ - "name", - "index", - "tiles", - ] - 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 updateNetworkCameraVideoWall(self, networkId: str, id: str, name: str, tiles: list, **kwargs): - """ - **Update the specified video wall.** - https://developer.cisco.com/meraki/api-v1/#!update-network-camera-video-wall - - - networkId (string): Network ID - - id (string): ID - - name (string): The name of the video wall. - - tiles (array): The tiles that should appear on the video wall. - - index (integer): The order that this wall should appear on the video wall list. - """ - - kwargs.update(locals()) - - networkId = urllib.parse.quote(str(networkId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/networks/{networkId}/camera/videoWalls/{id}" - - body_params = [ - "name", - "index", - "tiles", - ] - 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 deleteNetworkCameraVideoWall(self, networkId: str, id: str): - """ - **Delete the specified video wall.** - https://developer.cisco.com/meraki/api-v1/#!delete-network-camera-video-wall - - - networkId (string): Network ID - - id (string): ID - """ - - networkId = urllib.parse.quote(str(networkId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/networks/{networkId}/camera/videoWalls/{id}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action diff --git a/meraki/api/batch/campusGateway.py b/meraki/api/batch/campusGateway.py index fb9aa94..6127c57 100644 --- a/meraki/api/batch/campusGateway.py +++ b/meraki/api/batch/campusGateway.py @@ -82,130 +82,3 @@ def updateNetworkCampusGatewayCluster(self, networkId: str, clusterId: str, **kw "body": payload, } return action - - def deleteNetworkCampusGatewayCluster(self, networkId: str, clusterId: str): - """ - **Delete a cluster** - https://developer.cisco.com/meraki/api-v1/#!delete-network-campus-gateway-cluster - - - networkId (string): Network ID - - clusterId (string): Cluster ID - """ - - networkId = urllib.parse.quote(str(networkId), safe="") - clusterId = urllib.parse.quote(str(clusterId), safe="") - resource = f"/networks/{networkId}/campusGateway/clusters/{clusterId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def updateNetworkCampusGatewaySsidMdns(self, networkId: str, number: str, **kwargs): - """ - **Update the mDNS gateway settings and rules for a SSID and cluster** - https://developer.cisco.com/meraki/api-v1/#!update-network-campus-gateway-ssid-mdns - - - networkId (string): Network ID - - number (string): Number - - enabled (boolean): If true, mDNS gateway is enabled for this SSID and cluster. - - rules (array): List of mDNS forwarding rules. - """ - - kwargs.update(locals()) - - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/campusGateway/ssids/{number}/mdns" - - body_params = [ - "enabled", - "rules", - ] - 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 provisionOrganizationCampusGatewayClusters( - self, - organizationId: str, - clusterId: str, - network: dict, - name: str, - uplinks: list, - tunnels: list, - nameservers: dict, - portChannels: list, - **kwargs, - ): - """ - **Provisions a cluster,adds campus gateways to it and associate/dissociate failover targets.** - https://developer.cisco.com/meraki/api-v1/#!provision-organization-campus-gateway-clusters - - - organizationId (string): Organization ID - - clusterId (string): ID of the cluster to be provisioned - - network (object): Network to be provisioned - - 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 - - failover (object): Failover targets for the cluster - - notes (string): Notes about cluster with max size of 511 characters allowed - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/provision" - - body_params = [ - "clusterId", - "network", - "name", - "uplinks", - "tunnels", - "nameservers", - "portChannels", - "devices", - "failover", - "notes", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "provision", - "body": payload, - } - return action - - def batchOrganizationCampusGatewayClustersTunnelingByClusterByNetworkUpdate(self, organizationId: str, **kwargs): - """ - **Update MCG cluster-network tunnel settings for multiple networks** - https://developer.cisco.com/meraki/api-v1/#!batch-organization-campus-gateway-clusters-tunneling-by-cluster-by-network-update - - - organizationId (string): Organization ID - - items (array): MCG cluster-network tunnel settings - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/tunneling/byCluster/byNetwork/batchUpdate" - - body_params = [ - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "batch_update", - "body": payload, - } - return action diff --git a/meraki/api/batch/devices.py b/meraki/api/batch/devices.py index 130c2fa..027be86 100644 --- a/meraki/api/batch/devices.py +++ b/meraki/api/batch/devices.py @@ -107,50 +107,6 @@ def createDeviceCellularUplinksBandsMasksUpdate(self, serial: str, slot: str, ty } return action - def revokeDeviceCertificate(self, serial: str, certificateSerial: str, **kwargs): - """ - **Revoke a device certificate. The device and certificate are identified by the path parameters. You may supply a revocation reason in the request body; if omitted, a default reason is applied.** - https://developer.cisco.com/meraki/api-v1/#!revoke-device-certificate - - - serial (string): Serial - - certificateSerial (string): Certificate serial - - reason (string): Revocation reason per RFC 5280; omit to use `unspecified` - """ - - kwargs.update(locals()) - - if "reason" in kwargs: - options = [ - "aACompromise", - "affiliationChanged", - "cACompromise", - "certificateHold", - "cessationOfOperation", - "keyCompromise", - "privilegeWithdrawn", - "removeFromCRL", - "superseded", - "unspecified", - ] - assert kwargs["reason"] in options, ( - f'''"reason" cannot be "{kwargs["reason"]}", & must be set to one of: {options}''' - ) - - serial = urllib.parse.quote(str(serial), safe="") - certificateSerial = urllib.parse.quote(str(certificateSerial), safe="") - resource = f"/devices/{serial}/certificates/{certificateSerial}/revoke" - - body_params = [ - "reason", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "revoke", - "body": payload, - } - return action - def createDeviceLiveToolsLedsBlink(self, serial: str, duration: int, **kwargs): """ **Enqueue a job to blink LEDs on a device. This endpoint has a rate limit of one request every 10 seconds.** @@ -228,31 +184,6 @@ def createDeviceLiveToolsPowerUsage(self, serial: str, **kwargs): } return action - def createDeviceLiveToolsReboot(self, serial: str, **kwargs): - """ - **Enqueue a job to reboot a device. This endpoint has a rate limit of one request every 60 seconds.** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-reboot - - - serial (string): Serial - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/reboot" - - body_params = [ - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "device", - "body": payload, - } - return action - def createDeviceLiveToolsRoutingTableLookup(self, serial: str, **kwargs): """ **Enqueue a job to perform a routing table lookup request for a device. The routing table lookup request fetches a specific set of routes based on filters. Any combination of search filters can be applied. Only Cisco Secure Routers are supported.** diff --git a/meraki/api/batch/insight.py b/meraki/api/batch/insight.py index aa6666f..ecadc1f 100644 --- a/meraki/api/batch/insight.py +++ b/meraki/api/batch/insight.py @@ -5,83 +5,6 @@ class ActionBatchInsight(object): def __init__(self): super(ActionBatchInsight, self).__init__() - def createOrganizationInsightApplication(self, organizationId: str, counterSetRuleId: int, **kwargs): - """ - **Add an Insight tracked application** - https://developer.cisco.com/meraki/api-v1/#!create-organization-insight-application - - - organizationId (string): Organization ID - - counterSetRuleId (integer): The id of the counter set rule - - enableSmartThresholds (boolean): Enable Smart Thresholds - - thresholds (object): Thresholds defined by a user for each application - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/insight/applications" - - body_params = [ - "counterSetRuleId", - "enableSmartThresholds", - "thresholds", - ] - 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 updateOrganizationInsightApplication(self, organizationId: str, applicationId: str, **kwargs): - """ - **Update an Insight tracked application** - https://developer.cisco.com/meraki/api-v1/#!update-organization-insight-application - - - organizationId (string): Organization ID - - applicationId (string): Application ID - - enableSmartThresholds (boolean): Enable Smart Thresholds - - thresholds (object): Thresholds defined by a user for each application - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - applicationId = urllib.parse.quote(str(applicationId), safe="") - resource = f"/organizations/{organizationId}/insight/applications/{applicationId}" - - body_params = [ - "enableSmartThresholds", - "thresholds", - ] - 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 deleteOrganizationInsightApplication(self, organizationId: str, applicationId: str): - """ - **Delete an Insight tracked application** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-insight-application - - - organizationId (string): Organization ID - - applicationId (string): Application ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - applicationId = urllib.parse.quote(str(applicationId), safe="") - resource = f"/organizations/{organizationId}/insight/applications/{applicationId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - def createOrganizationInsightMonitoredMediaServer(self, organizationId: str, name: str, address: str, **kwargs): """ **Add a media server to be monitored for this organization. Only valid for organizations with Meraki Insight.** @@ -160,78 +83,3 @@ def deleteOrganizationInsightMonitoredMediaServer(self, organizationId: str, mon "operation": "destroy", } return action - - def createOrganizationInsightWebApp(self, organizationId: str, name: str, hostname: str, **kwargs): - """ - **Add a custom web application for Insight to be able to track** - https://developer.cisco.com/meraki/api-v1/#!create-organization-insight-web-app - - - organizationId (string): Organization ID - - name (string): The name of the Web Application - - hostname (string): The hostname of Web Application - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/insight/webApps" - - body_params = [ - "name", - "hostname", - ] - 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 updateOrganizationInsightWebApp(self, organizationId: str, customCounterSetRuleId: str, **kwargs): - """ - **Update a custom web application for Insight to be able to track** - https://developer.cisco.com/meraki/api-v1/#!update-organization-insight-web-app - - - organizationId (string): Organization ID - - customCounterSetRuleId (string): Custom counter set rule ID - - name (string): The name of the Web Application - - hostname (string): The hostname of Web Application - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - customCounterSetRuleId = urllib.parse.quote(str(customCounterSetRuleId), safe="") - resource = f"/organizations/{organizationId}/insight/webApps/{customCounterSetRuleId}" - - body_params = [ - "name", - "hostname", - ] - 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 deleteOrganizationInsightWebApp(self, organizationId: str, customCounterSetRuleId: str): - """ - **Delete a custom web application by counter set rule id.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-insight-web-app - - - organizationId (string): Organization ID - - customCounterSetRuleId (string): Custom counter set rule ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - customCounterSetRuleId = urllib.parse.quote(str(customCounterSetRuleId), safe="") - resource = f"/organizations/{organizationId}/insight/webApps/{customCounterSetRuleId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action diff --git a/meraki/api/batch/nac.py b/meraki/api/batch/nac.py deleted file mode 100644 index 6852539..0000000 --- a/meraki/api/batch/nac.py +++ /dev/null @@ -1,316 +0,0 @@ -import urllib - - -class ActionBatchNac(object): - def __init__(self): - super(ActionBatchNac, self).__init__() - - def createOrganizationNacCertificatesAuthoritiesCrl( - self, organizationId: str, caId: str, content: str, isDelta: bool, **kwargs - ): - """ - **Create a new CRL (either base or delta) for an existing CA** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-certificates-authorities-crl - - - organizationId (string): Organization ID - - caId (string): ID of the CRL issuer - - content (string): CRL content in PEM format - - isDelta (boolean): Whether it's a delta CRL or not - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/authorities/crls" - - body_params = [ - "caId", - "content", - "isDelta", - ] - 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 deleteOrganizationNacCertificatesAuthoritiesCrl(self, organizationId: str, crlId: str): - """ - **Deletes a whole CRL, including all its deltas (in case of base CRL removal)** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-nac-certificates-authorities-crl - - - organizationId (string): Organization ID - - crlId (string): Crl ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - crlId = urllib.parse.quote(str(crlId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/authorities/crls/{crlId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def createOrganizationNacCertificatesImport(self, organizationId: str, contents: str, **kwargs): - """ - **Import certificate for this organization or validate without persisting** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-certificates-import - - - organizationId (string): Organization ID - - contents (string): Certificate content in valid PEM format - - dryRun (boolean): If true, validates the certificate without persisting it - - profile (object): Profile object containing certificate config fields - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/import" - - body_params = [ - "contents", - "dryRun", - "profile", - ] - 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 updateOrganizationNacCertificate(self, organizationId: str, certificateId: str, profile: dict, **kwargs): - """ - **Update certificate configuration by certificateId for this organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-nac-certificate - - - organizationId (string): Organization ID - - certificateId (string): Certificate ID - - profile (object): Profile object containing certificate config fields - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - certificateId = urllib.parse.quote(str(certificateId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/{certificateId}" - - body_params = [ - "profile", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "action", - "body": payload, - } - return action - - def bulkOrganizationNacClientsDelete(self, organizationId: str, clientIds: list, **kwargs): - """ - **Delete existing client(s) for the organization** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-nac-clients-delete - - - organizationId (string): Organization ID - - clientIds (array): List of ids for specific client retrieval - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/bulkDelete" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def createOrganizationNacClientsBulkEdit(self, organizationId: str, clientIds: list, **kwargs): - """ - **Bulk Update of existing clients for the organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-clients-bulk-edit - - - organizationId (string): Organization ID - - clientIds (array): List of clients ids to apply the bulk edit operation on. - - description (string): User provided description to be applied on the list of clients provided - - groups (object): Client group information to be applied on the list of clients provided - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/bulkEdit" - - body_params = [ - "clientIds", - "description", - "groups", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "edit", - "body": payload, - } - return action - - def createOrganizationNacClientsBulkUpload( - self, organizationId: str, contents: str, updateClients: bool, createClientGroups: bool, **kwargs - ): - """ - **Bulk upload of clients, client groups and their associations for the organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-clients-bulk-upload - - - organizationId (string): Organization ID - - contents (string): CSV file content in Base64 encoded string format - - updateClients (boolean): The updateClients indicates whether existing clients must be updated with new data from the CSV - - createClientGroups (boolean): The createClientGroups indicates whether new client groups must be created or not - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/bulkUpload" - - body_params = [ - "contents", - "updateClients", - "createClientGroups", - ] - 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 createOrganizationNacClientsGroup(self, organizationId: str, name: str, **kwargs): - """ - **Create a client group for the organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-clients-group - - - organizationId (string): Organization ID - - name (string): The name of the group for access control model - - description (string): User provided description of the group - - members (array): List of client members associated with the group - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/groups" - - body_params = [ - "name", - "description", - "members", - ] - 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 updateOrganizationNacClientsGroup(self, organizationId: str, groupId: str, **kwargs): - """ - **Update an existing client group for the organization with bulk member operations** - https://developer.cisco.com/meraki/api-v1/#!update-organization-nac-clients-group - - - organizationId (string): Organization ID - - groupId (string): Group ID - - name (string): The name of the group for access control model - - description (string): User provided description of the group - - members (object): Bulk member operations with addList/removeList arrays - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/groups/{groupId}" - - body_params = [ - "name", - "description", - "members", - ] - 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 deleteOrganizationNacClientsGroup(self, organizationId: str, groupId: str): - """ - **Delete an existing client group for the organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-nac-clients-group - - - organizationId (string): Organization ID - - groupId (string): Group ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/groups/{groupId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def updateOrganizationNacClient(self, organizationId: str, clientId: str, mac: str, **kwargs): - """ - **Update an existing client for the organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-nac-client - - - organizationId (string): Organization ID - - clientId (string): Client ID - - mac (string): The MAC address of the client - - type (string): Type describes if the network client belongs to an individual user or corporate - - owner (string): The username of the owner of the client - - description (string): User provided description for the client - - uuid (string): Universally unique identifier of the client - - userDetails (array): List of users of this network client - - oui (object): Organizationally unique identifier assigned to a vendor of the client - - groups (object): Client group membership changes - """ - - kwargs.update(locals()) - - if "type" in kwargs: - options = ["BYOD", "corporate"] - assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' - - organizationId = urllib.parse.quote(str(organizationId), safe="") - clientId = urllib.parse.quote(str(clientId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/{clientId}" - - body_params = [ - "type", - "owner", - "mac", - "description", - "uuid", - "userDetails", - "oui", - "groups", - ] - 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 5099ef4..b40f4cc 100644 --- a/meraki/api/batch/networks.py +++ b/meraki/api/batch/networks.py @@ -492,7 +492,6 @@ def updateNetworkFloorPlan(self, networkId: str, floorPlanId: str, **kwargs): - topLeftCorner (object): The longitude and latitude of the top left corner of your floor plan. - topRightCorner (object): The longitude and latitude of the top right corner of your floor plan. - floorNumber (number): The floor number of the floors within the building - - buildingId (string): The ID of the building that this floor belongs to. - imageContents (string): The file contents (a base 64 encoded string) of your new image. Supported formats are PNG, GIF, and JPG. Note that all images are saved as PNG files, regardless of the format they are uploaded in. If you upload a new image, and you do NOT specify any new geolocation fields ('center, 'topLeftCorner', etc), the floor plan will be recentered with no rotation in order to maintain the aspect ratio of your new image. """ @@ -510,7 +509,6 @@ def updateNetworkFloorPlan(self, networkId: str, floorPlanId: str, **kwargs): "topLeftCorner", "topRightCorner", "floorNumber", - "buildingId", "imageContents", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -660,58 +658,6 @@ def deleteNetworkGroupPolicy(self, networkId: str, groupPolicyId: str, **kwargs) } return action - def updateNetworkLocationScanning(self, networkId: str, **kwargs): - """ - **Change scanning API settings** - https://developer.cisco.com/meraki/api-v1/#!update-network-location-scanning - - - networkId (string): Network ID - - analyticsEnabled (boolean): Collect location and scanning analytics - - scanningApiEnabled (boolean): Enable push API for scanning events, analytics must be enabled - """ - - kwargs.update(locals()) - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/locationScanning" - - body_params = [ - "analyticsEnabled", - "scanningApiEnabled", - ] - 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 updateNetworkLocationScanningHttpServers(self, networkId: str, endpoints: list, **kwargs): - """ - **Set the list of scanning API receivers. Old receivers will be removed** - https://developer.cisco.com/meraki/api-v1/#!update-network-location-scanning-http-servers - - - networkId (string): Network ID - - endpoints (array): A set of http server configurations - """ - - kwargs = locals() - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/locationScanning/httpServers" - - body_params = [ - "endpoints", - ] - 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 createNetworkMerakiAuthUser(self, networkId: str, email: str, authorizations: list, **kwargs): """ **Authorize a user configured with Meraki Authentication for a network (currently supports 802.1X, splash guest, and client VPN users, and currently, organizations have a 50,000 user cap)** @@ -821,17 +767,10 @@ def createNetworkMqttBroker(self, networkId: str, name: str, host: str, port: in - port (integer): Host port though which the MQTT broker can be reached. - security (object): Security settings of the MQTT broker. - authentication (object): Authentication settings of the MQTT broker - - productType (string): The product type for which the MQTT broker is being created. """ kwargs.update(locals()) - if "productType" in kwargs: - options = ["camera", "wireless"] - assert kwargs["productType"] in options, ( - f'''"productType" cannot be "{kwargs["productType"]}", & must be set to one of: {options}''' - ) - networkId = urllib.parse.quote(str(networkId), safe="") resource = f"/networks/{networkId}/mqttBrokers" @@ -841,7 +780,6 @@ def createNetworkMqttBroker(self, networkId: str, name: str, host: str, port: in "port", "security", "authentication", - "productType", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -915,7 +853,6 @@ def updateNetworkSettings(self, networkId: str, **kwargs): - remoteStatusPageEnabled (boolean): Enables / disables access to the device status page (http://[device's LAN IP]). Optional. Can only be set if localStatusPageEnabled is set to true - localStatusPage (object): A hash of Local Status page(s)' authentication options applied to the Network. - securePort (object): A hash of SecureConnect options applied to the Network. - - fips (object): A hash of FIPS options applied to the Network - namedVlans (object): A hash of Named VLANs options applied to the Network. """ @@ -929,7 +866,6 @@ def updateNetworkSettings(self, networkId: str, **kwargs): "remoteStatusPageEnabled", "localStatusPage", "securePort", - "fips", "namedVlans", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -940,116 +876,6 @@ def updateNetworkSettings(self, networkId: str, **kwargs): } return action - def createNetworkSitesBuilding(self, networkId: str, name: str, **kwargs): - """ - **Create a new building** - https://developer.cisco.com/meraki/api-v1/#!create-network-sites-building - - - networkId (string): Network ID - - name (string): The name of the building - - floors (array): The floors of the building - """ - - kwargs.update(locals()) - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sites/buildings" - - body_params = [ - "name", - "floors", - ] - 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 deleteNetworkSitesBuilding(self, networkId: str, buildingId: str): - """ - **Delete a building** - https://developer.cisco.com/meraki/api-v1/#!delete-network-sites-building - - - networkId (string): Network ID - - buildingId (string): Building ID - """ - - networkId = urllib.parse.quote(str(networkId), safe="") - buildingId = urllib.parse.quote(str(buildingId), safe="") - resource = f"/networks/{networkId}/sites/buildings/{buildingId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def updateNetworkSitesBuilding(self, networkId: str, buildingId: str, **kwargs): - """ - **Update a building** - https://developer.cisco.com/meraki/api-v1/#!update-network-sites-building - - - networkId (string): Network ID - - buildingId (string): Building ID - - name (string): The name of the building - - floors (array): The floors of the building - """ - - kwargs.update(locals()) - - networkId = urllib.parse.quote(str(networkId), safe="") - buildingId = urllib.parse.quote(str(buildingId), safe="") - resource = f"/networks/{networkId}/sites/buildings/{buildingId}" - - body_params = [ - "name", - "floors", - ] - 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 updateNetworkSnmpTraps(self, networkId: str, **kwargs): - """ - **Update the SNMP trap configuration for the specified network** - https://developer.cisco.com/meraki/api-v1/#!update-network-snmp-traps - - - networkId (string): Network ID - - mode (string): SNMP trap protocol version - - receiver (object): Stores the port and address - - v2 (object): V2 mode - - v3 (object): V3 mode - """ - - kwargs.update(locals()) - - if "mode" in kwargs: - options = ["disabled", "v1/v2c", "v3"] - assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/snmp/traps" - - body_params = [ - "mode", - "receiver", - "v2", - "v3", - ] - 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 splitNetwork(self, networkId: str): """ **Split a combined network into individual networks for each type of device** @@ -1102,17 +928,15 @@ def createNetworkVlanProfile(self, networkId: str, name: str, vlanNames: list, v - vlanNames (array): An array of named VLANs - vlanGroups (array): An array of VLAN groups - iname (string): IName of the profile - - allowedVlans (string): The VLANs allowed on the VLAN profile. Only applicable to trunk ports. The given range must be inclusive of all named VLANs. """ - kwargs.update(locals()) + kwargs = locals() networkId = urllib.parse.quote(str(networkId), safe="") resource = f"/networks/{networkId}/vlanProfiles" body_params = [ "name", - "allowedVlans", "vlanNames", "vlanGroups", "iname", diff --git a/meraki/api/batch/organizations.py b/meraki/api/batch/organizations.py index b19c2bf..846c202 100644 --- a/meraki/api/batch/organizations.py +++ b/meraki/api/batch/organizations.py @@ -451,255 +451,6 @@ def deleteOrganizationAlertsProfile(self, organizationId: str, alertConfigId: st } return action - def createOrganizationApiPushProfile(self, organizationId: str, iname: str, topic: dict, receiver: dict, **kwargs): - """ - **Create a new push profile** - https://developer.cisco.com/meraki/api-v1/#!create-organization-api-push-profile - - - organizationId (string): Organization ID - - iname (string): Immutable name of the resource. Must be unique within resources of this type. - - topic (object): Push topic - - receiver (object): Push receiver profile - - name (string): Name of push profile - - description (string): Description of push profile - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/api/push/profiles" - - body_params = [ - "iname", - "name", - "description", - "topic", - "receiver", - ] - 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 updateOrganizationApiPushProfile(self, organizationId: str, iname: str, **kwargs): - """ - **Update a push profile** - https://developer.cisco.com/meraki/api-v1/#!update-organization-api-push-profile - - - organizationId (string): Organization ID - - iname (string): Iname - - name (string): Name of push profile - - description (string): Description of push profile - - topic (object): Push topic - - receiver (object): Push receiver profile - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - iname = urllib.parse.quote(str(iname), safe="") - resource = f"/organizations/{organizationId}/api/push/profiles/{iname}" - - body_params = [ - "name", - "description", - "topic", - "receiver", - ] - 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 deleteOrganizationApiPushProfile(self, organizationId: str, iname: str): - """ - **Delete a push profile** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-api-push-profile - - - organizationId (string): Organization ID - - iname (string): Iname - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - iname = urllib.parse.quote(str(iname), safe="") - resource = f"/organizations/{organizationId}/api/push/profiles/{iname}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def createOrganizationApiPushReceiversProfile(self, organizationId: str, iname: str, receiver: dict, **kwargs): - """ - **Create a new push receiver profile** - https://developer.cisco.com/meraki/api-v1/#!create-organization-api-push-receivers-profile - - - organizationId (string): Organization ID - - iname (string): Immutable name of the resource. Must be unique within resources of this type. - - receiver (object): Webhook receiver - - name (string): Name of receiver profile - - description (string): Description of receiver profile - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/api/push/receivers/profiles" - - body_params = [ - "iname", - "name", - "description", - "receiver", - ] - 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 deleteOrganizationApiPushReceiversProfile(self, organizationId: str, iname: str): - """ - **Delete a push receiver profile** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-api-push-receivers-profile - - - organizationId (string): Organization ID - - iname (string): Iname - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - iname = urllib.parse.quote(str(iname), safe="") - resource = f"/organizations/{organizationId}/api/push/receivers/profiles/{iname}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def updateOrganizationApiPushReceiversProfile(self, organizationId: str, iname: str, **kwargs): - """ - **Update a push receiver profile** - https://developer.cisco.com/meraki/api-v1/#!update-organization-api-push-receivers-profile - - - organizationId (string): Organization ID - - iname (string): Iname - - name (string): Name of the receiver profile - - description (string): Description of the receiver profile - - receiver (object): API Push Receiver details - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - iname = urllib.parse.quote(str(iname), safe="") - resource = f"/organizations/{organizationId}/api/push/receivers/profiles/{iname}" - - body_params = [ - "name", - "description", - "receiver", - ] - 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 createOrganizationAuthRadiusServer(self, organizationId: str, address: str, secret: str, **kwargs): - """ - **Add an organization-wide RADIUS server** - https://developer.cisco.com/meraki/api-v1/#!create-organization-auth-radius-server - - - organizationId (string): Organization ID - - address (string): The IP address or FQDN of the RADIUS server - - secret (string): Shared secret of the RADIUS server - - name (string): The name of the RADIUS server - - modes (array): Available server modes - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/auth/radius/servers" - - body_params = [ - "name", - "address", - "modes", - "secret", - ] - 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 updateOrganizationAuthRadiusServer(self, organizationId: str, serverId: str, **kwargs): - """ - **Update an organization-wide RADIUS server** - https://developer.cisco.com/meraki/api-v1/#!update-organization-auth-radius-server - - - organizationId (string): Organization ID - - serverId (string): Server ID - - name (string): The name of the RADIUS server - - address (string): The IP address or FQDN of the RADIUS server - - modes (array): Available server modes - - secret (string): Shared secret of the RADIUS server - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - serverId = urllib.parse.quote(str(serverId), safe="") - resource = f"/organizations/{organizationId}/auth/radius/servers/{serverId}" - - body_params = [ - "name", - "address", - "modes", - "secret", - ] - 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 deleteOrganizationAuthRadiusServer(self, organizationId: str, serverId: str): - """ - **Delete an organization-wide RADIUS server from a organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-auth-radius-server - - - organizationId (string): Organization ID - - serverId (string): Server ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - serverId = urllib.parse.quote(str(serverId), safe="") - resource = f"/organizations/{organizationId}/auth/radius/servers/{serverId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - def createOrganizationBrandingPolicy(self, organizationId: str, name: str, **kwargs): """ **Add a new branding policy to an organization** @@ -821,216 +572,6 @@ def deleteOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId } return action - def createOrganizationCertificatesAuthority(self, organizationId: str, featureType: str, **kwargs): - """ - **Create a certificate authority for an organization. The response includes job information for tracking progress.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-certificates-authority - - - organizationId (string): Organization ID - - featureType (string): Feature this CA serves (e.g., radsec, openroaming, zigbee) - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities" - - body_params = [ - "featureType", - ] - 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 updateOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, **kwargs): - """ - **Trust a newly created certificate authority (transition from untrusted to trusted).** - https://developer.cisco.com/meraki/api-v1/#!update-organization-certificates-authorities - - - organizationId (string): Organization ID - - authorityId (string): ID of the certificate authority to trust. The CA must currently be untrusted. - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities" - - body_params = [ - "authorityId", - ] - 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 deleteOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, name: str): - """ - **Delete a certificate authority. The feature CA must be untrusted or revoked. Deletion takes effect immediately and the response confirms the deleted authority.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-certificates-authorities - - - organizationId (string): Organization ID - - authorityId (string): ID of the certificate authority to delete - - name (string): Certificate authority name - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities" - - action = { - "resource": resource, - "operation": "delete", - } - return action - - def revokeOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, **kwargs): - """ - **Revoke a trusted feature certificate authority.** - https://developer.cisco.com/meraki/api-v1/#!revoke-organization-certificates-authorities - - - organizationId (string): Organization ID - - authorityId (string): ID of the feature certificate authority to revoke - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities/revoke" - - body_params = [ - "authorityId", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "revoke", - "body": payload, - } - return action - - def importOrganizationCertificates(self, organizationId: str, managedBy: str, contents: str, description: str, **kwargs): - """ - **Import certificate for this organization** - https://developer.cisco.com/meraki/api-v1/#!import-organization-certificates - - - organizationId (string): Organization ID - - managedBy (string): Certificate managed by type [system_manager, mr, encrypted_syslog, grpc_dial_out] - - contents (string): Certificate content in valid PEM format - - description (string): Certificate description - """ - - kwargs = locals() - - if "managedBy" in kwargs: - options = ["encrypted_syslog", "grpc_dial_out", "mr", "system_manager"] - assert kwargs["managedBy"] in options, ( - f'''"managedBy" cannot be "{kwargs["managedBy"]}", & must be set to one of: {options}''' - ) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/import" - - body_params = [ - "managedBy", - "contents", - "description", - ] - 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 createOrganizationComputeApplicationDeploymentsBulkCreate( - self, organizationId: str, hosts: list, application: dict, enabled: bool, **kwargs - ): - """ - **Add Application Deployment agents for a list of hosts. Only valid for hosts with access to Meraki Insight.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-compute-application-deployments-bulk-create - - - organizationId (string): Organization ID - - hosts (array): List of hosts to deploy applications on - - application (object): Application information - - enabled (boolean): Whether the deployment should be enabled - - applicationConfiguration (object): Optional: Generic object for application-specific configuration - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/compute/application/deployments/bulkCreate" - - body_params = [ - "hosts", - "application", - "enabled", - "applicationConfiguration", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "action", - "body": payload, - } - return action - - def updateOrganizationComputeApplicationDeployment(self, organizationId: str, deploymentId: str, enabled: bool, **kwargs): - """ - **Update a Deployment agent configuration. Only valid for hosts with access to Meraki Insight.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-compute-application-deployment - - - organizationId (string): Organization ID - - deploymentId (string): Deployment ID - - enabled (boolean): Whether or not the Application Deployment agent is enabled for the host. - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - deploymentId = urllib.parse.quote(str(deploymentId), safe="") - resource = f"/organizations/{organizationId}/compute/application/deployments/{deploymentId}" - - body_params = [ - "enabled", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "action", - "body": payload, - } - return action - - def deleteOrganizationComputeApplicationDeployment(self, organizationId: str, deploymentId: str): - """ - **Delete a Application Deployment agent from the host. Only valid for host with access to Meraki Insight.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-compute-application-deployment - - - organizationId (string): Organization ID - - deploymentId (string): Deployment ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - deploymentId = urllib.parse.quote(str(deploymentId), safe="") - resource = f"/organizations/{organizationId}/compute/application/deployments/{deploymentId}" - - action = { - "resource": resource, - "operation": "action", - } - return action - def createOrganizationConfigTemplate(self, organizationId: str, name: str, **kwargs): """ **Create a new configuration template** @@ -1350,26 +891,6 @@ def createOrganizationDevicesPacketCaptureSchedule(self, organizationId: str, de } return action - def bulkOrganizationDevicesPacketCaptureSchedulesDelete(self, organizationId: str, scheduleIds: list, **kwargs): - """ - **Delete packet capture schedules** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-devices-packet-capture-schedules-delete - - - organizationId (string): Organization ID - - scheduleIds (array): Delete the packet capture schedules of the specified schedule ids - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/packetCapture/schedules/bulkDelete" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - def reorderOrganizationDevicesPacketCaptureSchedules(self, organizationId: str, order: list, **kwargs): """ **Bulk update priorities of pcap schedules** @@ -1443,265 +964,41 @@ def deleteOrganizationDevicesPacketCaptureSchedule(self, organizationId: str, sc - scheduleId (string): Delete the capture schedules of the specified capture schedule id """ - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - scheduleId = urllib.parse.quote(str(scheduleId), safe="") - resource = f"/organizations/{organizationId}/devices/packetCapture/schedules/{scheduleId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def tasksOrganizationDevicesPacketCapture(self, organizationId: str, packetId: str, task: str, **kwargs): - """ - **Enqueues a task for a specific packet capture. This endpoint has a sustained rate limit of one request every 60 seconds.** - https://developer.cisco.com/meraki/api-v1/#!tasks-organization-devices-packet-capture - - - organizationId (string): Organization ID - - packetId (string): Packet ID - - task (string): Type of task to enqueue. It can be one of: ["analysis", "reasoning", "summary", "highlights", "title", "flow"] - - networkId (string): Parameter to validate authorization by network access - """ - - kwargs.update(locals()) - - if "task" in kwargs: - options = ["analysis", "flow", "highlights", "reasoning", "summary", "title"] - assert kwargs["task"] in options, f'''"task" cannot be "{kwargs["task"]}", & must be set to one of: {options}''' - - organizationId = urllib.parse.quote(str(organizationId), safe="") - packetId = urllib.parse.quote(str(packetId), safe="") - resource = f"/organizations/{organizationId}/devices/packetCaptures/{packetId}/tasks" - - body_params = [ - "networkId", - "task", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "enqueue_task", - "body": payload, - } - return action - - def bulkOrganizationDevicesPlacementPositionsUpdate(self, organizationId: str, serials: list, **kwargs): - """ - **Bulk update the attributes related to positions for provided devices** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-devices-placement-positions-update - - - organizationId (string): Organization ID - - serials (array): List of device serials on a floor plan to update - - height (object): Height of the devices on the floor plan - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/placement/positions/bulkUpdate" - - body_params = [ - "serials", - "height", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "bulk_update", - "body": payload, - } - return action - - def updateOrganizationEarlyAccessFeaturesOptIn(self, organizationId: str, optInId: str, **kwargs): - """ - **Update an early access feature opt-in for an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-early-access-features-opt-in - - - organizationId (string): Organization ID - - optInId (string): Opt in ID - - limitScopeToNetworks (array): A list of network IDs to apply the opt-in to - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - optInId = urllib.parse.quote(str(optInId), safe="") - resource = f"/organizations/{organizationId}/earlyAccess/features/optIns/{optInId}" - - body_params = [ - "limitScopeToNetworks", - ] - 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 updateOrganizationExtensionsSdwanmanagerInterconnect( - self, organizationId: str, interconnectId: str, name: str, status: str, **kwargs - ): - """ - **Update name and status of an Interconnect** - https://developer.cisco.com/meraki/api-v1/#!update-organization-extensions-sdwanmanager-interconnect - - - organizationId (string): Organization ID - - interconnectId (string): Interconnect ID - - name (string): Interconnect name - - status (string): Interconnect status - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - interconnectId = urllib.parse.quote(str(interconnectId), safe="") - resource = f"/organizations/{organizationId}/extensions/sdwanmanager/interconnects/{interconnectId}" - - body_params = [ - "name", - "status", - ] - 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 createOrganizationExtensionsThousandEyesNetwork(self, organizationId: str, enabled: bool, networkId: str, **kwargs): - """ - **Add a ThousandEyes agent for this network. Only valid for networks with access to Meraki Insight. Organization must have a ThousandEyes account connected to perform this action.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-extensions-thousand-eyes-network - - - organizationId (string): Organization ID - - enabled (boolean): Whether or not the ThousandEyes agent is enabled for the network. - - networkId (string): Network that will have the ThousandEyes agent installed on. - - tests (array): An array of tests to be created - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/networks" - - body_params = [ - "enabled", - "networkId", - "tests", - ] - 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 updateOrganizationExtensionsThousandEyesNetwork(self, organizationId: str, networkId: str, enabled: bool, **kwargs): - """ - **Update a ThousandEyes agent from this network. Only valid for networks with access to Meraki Insight. Organization must have a ThousandEyes account connected to perform this action.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-extensions-thousand-eyes-network - - - organizationId (string): Organization ID - - networkId (string): Network ID - - enabled (boolean): Whether or not the ThousandEyes agent is enabled for the network. - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/networks/{networkId}" - - body_params = [ - "enabled", - ] - 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 deleteOrganizationExtensionsThousandEyesNetwork(self, organizationId: str, networkId: str): - """ - **Delete a ThousandEyes agent from this network. Only valid for networks with access to Meraki Insight. Organization must have a ThousandEyes account connected to perform this action.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-extensions-thousand-eyes-network - - - organizationId (string): Organization ID - - networkId (string): Network ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/networks/{networkId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def createOrganizationExtensionsThousandEyesTest(self, organizationId: str, **kwargs): - """ - **Create a ThousandEyes test based on a provided test template. Only valid for networks with access to Meraki Insight. Organization must have a ThousandEyes account connected to perform this action.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-extensions-thousand-eyes-test - - - organizationId (string): Organization ID - - tests (array): An array of tests to be created - """ - - kwargs.update(locals()) + kwargs = locals() organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/tests" + scheduleId = urllib.parse.quote(str(scheduleId), safe="") + resource = f"/organizations/{organizationId}/devices/packetCapture/schedules/{scheduleId}" - body_params = [ - "tests", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, - "operation": "create", - "body": payload, + "operation": "destroy", } return action - def resolveOrganizationIamAdminsAdministratorsMePermissions( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def updateOrganizationEarlyAccessFeaturesOptIn(self, organizationId: str, optInId: str, **kwargs): """ - **List the authenticated caller admin's permissions for an organization. Org-wide read and write admins receive a single organization-scoped permission item instead of per-network items. Scoped callers receive the network resources they can access in the requested organization, along with the effective allowed action for each resource.** - https://developer.cisco.com/meraki/api-v1/#!resolve-organization-iam-admins-administrators-me-permissions + **Update an early access feature opt-in for an organization** + https://developer.cisco.com/meraki/api-v1/#!update-organization-early-access-features-opt-in - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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. + - optInId (string): Opt in ID + - limitScopeToNetworks (array): A list of network IDs to apply the opt-in to """ kwargs.update(locals()) organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/admins/administrators/me/permissions/resolve" + optInId = urllib.parse.quote(str(optInId), safe="") + resource = f"/organizations/{organizationId}/earlyAccess/features/optIns/{optInId}" body_params = [ - "perPage", - "startingAfter", - "endingBefore", + "limitScopeToNetworks", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, - "operation": "permissions/resolve", + "operation": "update", "body": payload, } return action @@ -1989,7 +1286,6 @@ def createOrganizationNetwork(self, organizationId: str, name: str, productTypes - timeZone (string): The timezone of the network. For a list of allowed timezones, please see the 'TZ' column in the table in this article. - copyFromNetworkId (string): The ID of the network to copy configuration from. Other provided parameters will override the copied configuration, except type which must match this network's type exactly. - notes (string): Add any notes or additional information about this network here. - - details (array): An array of details """ kwargs.update(locals()) @@ -2004,7 +1300,6 @@ def createOrganizationNetwork(self, organizationId: str, name: str, productTypes "timeZone", "copyFromNetworkId", "notes", - "details", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -2043,150 +1338,6 @@ def combineOrganizationNetworks(self, organizationId: str, name: str, networkIds } return action - def createOrganizationNetworksGroup(self, organizationId: str, name: str, **kwargs): - """ - **Create a network group** - https://developer.cisco.com/meraki/api-v1/#!create-organization-networks-group - - - organizationId (string): Organization ID - - name (string): The name of the network group - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/networks/groups" - - body_params = [ - "name", - ] - 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 updateOrganizationNetworksGroup(self, organizationId: str, groupId: str, name: str, **kwargs): - """ - **Update a network group** - https://developer.cisco.com/meraki/api-v1/#!update-organization-networks-group - - - organizationId (string): Organization ID - - groupId (string): Group ID - - name (string): The new name of the network group - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/networks/groups/{groupId}" - - body_params = [ - "name", - ] - 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 deleteOrganizationNetworksGroup(self, organizationId: str, groupId: str): - """ - **Delete a network group** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-networks-group - - - organizationId (string): Organization ID - - groupId (string): Group ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/networks/groups/{groupId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def bulkOrganizationNetworksGroupAssign(self, organizationId: str, groupId: str, networkIds: list, **kwargs): - """ - **Add networks to a network group** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-networks-group-assign - - - organizationId (string): Organization ID - - groupId (string): Group ID - - networkIds (array): A list of network IDs to add to the network group - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/networks/groups/{groupId}/bulkAssign" - - body_params = [ - "networkIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "bulk_assign", - "body": payload, - } - return action - - def bulkOrganizationNetworksGroupUnassign(self, organizationId: str, groupId: str, networkIds: list, **kwargs): - """ - **Remove networks from a network group** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-networks-group-unassign - - - organizationId (string): Organization ID - - groupId (string): Group ID - - networkIds (array): A list of network IDs to remove from the network group - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/networks/groups/{groupId}/bulkUnassign" - - body_params = [ - "networkIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "bulk_unassign", - "body": payload, - } - return action - - def deleteOrganizationOpenRoamingCertificate(self, organizationId: str, id: str): - """ - **Delete an open roaming certificate.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-open-roaming-certificate - - - organizationId (string): Organization ID - - id (string): ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/openRoaming/certificates/{id}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - def createOrganizationPoliciesGlobalFirewallRuleset(self, organizationId: str, name: str, **kwargs): """ **Create an Organization-Wide Policy Firewall Ruleset** @@ -2471,7 +1622,6 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( - rulesetId (string): ID of the ruleset to assign - policyId (string): ID of the policy to assign the ruleset to - priority (integer): Priority of the ruleset assignment (lower numbers = higher priority) - - staged (boolean): Stage an assignment without applying it immediately to the policy """ kwargs.update(locals()) @@ -2483,7 +1633,6 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( "rulesetId", "policyId", "priority", - "staged", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -2493,33 +1642,6 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( } return action - def commitOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments( - self, organizationId: str, policy: dict, **kwargs - ): - """ - **Commit staged Organization-Wide Policy Ruleset Assignments** - https://developer.cisco.com/meraki/api-v1/#!commit-organization-policies-global-group-policies-firewall-rulesets-assignments - - - organizationId (string): Organization ID - - policy (object): Policy in which all staged rulesets will be committed - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/policies/global/group/policies/firewall/rulesets/assignments/commit" - - body_params = [ - "policy", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "commit", - "body": payload, - } - return action - def updateOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( self, organizationId: str, assignmentId: str, **kwargs ): @@ -2800,93 +1922,6 @@ def deleteOrganizationPolicyObject(self, organizationId: str, policyObjectId: st } return action - def createOrganizationRoutingVrf(self, organizationId: str, name: str, **kwargs): - """ - **Add an organization-wide VRF (Virtual Routing and Forwarding)** - https://developer.cisco.com/meraki/api-v1/#!create-organization-routing-vrf - - - organizationId (string): Organization ID - - name (string): The name of the VRF (Virtual Routing and Forwarding) - - description (string): Description of the VRF (Virtual Routing and Forwarding) - - routeDistinguisher (string): RD (Route Distinguisher) for the VRF (Virtual Routing and Forwarding) - - routeTarget (string): Route target are used to control the import and export of routes between VRFs - - appliance (object): This parameter is used to enable or disable the VRF on the WAN appliance - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/routing/vrfs" - - body_params = [ - "name", - "description", - "routeDistinguisher", - "routeTarget", - "appliance", - ] - 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 updateOrganizationRoutingVrf(self, organizationId: str, vrfId: str, **kwargs): - """ - **Update an organization-wide VRF (Virtual Routing and Forwarding)** - https://developer.cisco.com/meraki/api-v1/#!update-organization-routing-vrf - - - organizationId (string): Organization ID - - vrfId (string): Vrf ID - - name (string): The name of the VRF (Virtual Routing and Forwarding) - - description (string): Description of the VRF (Virtual Routing and Forwarding) - - routeDistinguisher (string): RD (Route Distinguisher) for the VRF (Virtual Routing and Forwarding) - - routeTarget (string): Route target are used to control the import and export of routes between VRFs - - appliance (object): This parameter is used to enable or disable the VRF on the WAN appliance - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - vrfId = urllib.parse.quote(str(vrfId), safe="") - resource = f"/organizations/{organizationId}/routing/vrfs/{vrfId}" - - body_params = [ - "name", - "description", - "routeDistinguisher", - "routeTarget", - "appliance", - ] - 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 deleteOrganizationRoutingVrf(self, organizationId: str, vrfId: str): - """ - **Delete a VRF (Virtual Routing and Forwarding) from a organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-routing-vrf - - - organizationId (string): Organization ID - - vrfId (string): Vrf ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - vrfId = urllib.parse.quote(str(vrfId), safe="") - resource = f"/organizations/{organizationId}/routing/vrfs/{vrfId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - def createOrganizationSamlIdp(self, organizationId: str, x509certSha1Fingerprint: str, **kwargs): """ **Create a SAML IdP for your organization.** @@ -3249,94 +2284,3 @@ def createOrganizationSplashThemeAsset(self, organizationId: str, themeIdentifie "body": payload, } return action - - def createOrganizationWebhooksPayloadTemplate(self, organizationId: str, name: str, **kwargs): - """ - **Create a webhook payload template for an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-webhooks-payload-template - - - organizationId (string): Organization ID - - name (string): The name of the new template - - body (string): The liquid template used for the body of the webhook message. Either `body` or `bodyFile` must be specified. - - headers (array): The liquid template used with the webhook headers. - - bodyFile (string): A file containing liquid template used for the body of the webhook message. Either `body` or `bodyFile` must be specified. - - headersFile (string): A file containing the liquid template used with the webhook headers. - - sharing (object): Information on which entities have access to the template - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/webhooks/payloadTemplates" - - body_params = [ - "name", - "body", - "headers", - "bodyFile", - "headersFile", - "sharing", - ] - 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 deleteOrganizationWebhooksPayloadTemplate(self, organizationId: str, payloadTemplateId: str): - """ - **Destroy a webhook payload template for an organization. Does not work for included templates ('wpt_00001', 'wpt_00002', 'wpt_00003', 'wpt_00004', 'wpt_00005', 'wpt_00006', 'wpt_00007' or 'wpt_00008')** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-webhooks-payload-template - - - organizationId (string): Organization ID - - payloadTemplateId (string): Payload template ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - payloadTemplateId = urllib.parse.quote(str(payloadTemplateId), safe="") - resource = f"/organizations/{organizationId}/webhooks/payloadTemplates/{payloadTemplateId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def updateOrganizationWebhooksPayloadTemplate(self, organizationId: str, payloadTemplateId: str, **kwargs): - """ - **Update a webhook payload template for an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-webhooks-payload-template - - - organizationId (string): Organization ID - - payloadTemplateId (string): Payload template ID - - name (string): The name of the template - - body (string): The liquid template used for the body of the webhook message. - - headers (array): The liquid template used with the webhook headers. - - bodyFile (string): A file containing liquid template used for the body of the webhook message. - - headersFile (string): A file containing the liquid template used with the webhook headers. - - sharing (object): Information on which entities have access to the template - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - payloadTemplateId = urllib.parse.quote(str(payloadTemplateId), safe="") - resource = f"/organizations/{organizationId}/webhooks/payloadTemplates/{payloadTemplateId}" - - body_params = [ - "name", - "body", - "headers", - "bodyFile", - "headersFile", - "sharing", - ] - 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/secureConnect.py b/meraki/api/batch/secureConnect.py deleted file mode 100644 index 20a5f64..0000000 --- a/meraki/api/batch/secureConnect.py +++ /dev/null @@ -1,224 +0,0 @@ -import urllib - - -class ActionBatchSecureConnect(object): - def __init__(self): - super(ActionBatchSecureConnect, self).__init__() - - def createOrganizationSecureConnectPrivateResourceGroup(self, organizationId: str, name: str, **kwargs): - """ - **Adds a new private resource group to an organization.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-secure-connect-private-resource-group - - - organizationId (string): Organization ID - - name (string): Name of group. This is required and should be unique across all groups for a given organization. Name cannot have any special characters other than spaces and hyphens. - - description (string): Optional text description for a group. - - resourceIds (array): List of resource ids assigned to this group. - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResourceGroups" - - body_params = [ - "name", - "description", - "resourceIds", - ] - 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 updateOrganizationSecureConnectPrivateResourceGroup(self, organizationId: str, id: str, name: str, **kwargs): - """ - **Updates a specific private resource group.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-secure-connect-private-resource-group - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of group. This is required and should be unique across all groups for a given organization. Name cannot have any special characters other than spaces and hyphens. - - description (string): Optional text description for a group. - - resourceIds (array): List of resource ids assigned to this group. - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResourceGroups/{id}" - - body_params = [ - "name", - "description", - "resourceIds", - ] - 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 deleteOrganizationSecureConnectPrivateResourceGroup(self, organizationId: str, id: str): - """ - **Deletes a specific private resource group.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-secure-connect-private-resource-group - - - organizationId (string): Organization ID - - id (string): ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResourceGroups/{id}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def createOrganizationSecureConnectPrivateResource( - self, organizationId: str, name: str, accessTypes: list, resourceAddresses: list, **kwargs - ): - """ - **Adds a new private resource to the organization.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-secure-connect-private-resource - - - organizationId (string): Organization ID - - name (string): Name of resource. This is required and should be unique across all resources for a given organization. Name cannot have any special characters other than spaces and hyphens. - - accessTypes (array): List of access types. - - resourceAddresses (array): List of resource addresses Protocols must be unique in this list. - - description (string): Optional text description for a resource. - - resourceGroupIds (array): List of resource group ids attached to this resource. - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResources" - - body_params = [ - "name", - "description", - "accessTypes", - "resourceAddresses", - "resourceGroupIds", - ] - 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 updateOrganizationSecureConnectPrivateResource( - self, organizationId: str, id: str, name: str, accessTypes: list, resourceAddresses: list, **kwargs - ): - """ - **Updates a specific private resource.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-secure-connect-private-resource - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of resource. This is required and should be unique across all resources for a given organization.Name cannot have any special characters other than spaces and hyphens. - - accessTypes (array): List of access types. - - resourceAddresses (array): List of resource addresses Protocols must be unique in this list. - - description (string): Optional text description for resource. - - resourceGroupIds (array): List of resource group ids attached to this resource. - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResources/{id}" - - body_params = [ - "name", - "description", - "accessTypes", - "resourceAddresses", - "resourceGroupIds", - ] - 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 deleteOrganizationSecureConnectPrivateResource(self, organizationId: str, id: str): - """ - **Deletes a specific private resource. If this is the last resource in a resource group you must remove it from that resource group before deleting.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-secure-connect-private-resource - - - organizationId (string): Organization ID - - id (string): ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResources/{id}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def createOrganizationSecureConnectSite(self, organizationId: str, **kwargs): - """ - **Enroll sites in this organization to Secure Connect. For an organization, a maximum of 4000 sites can be enrolled if they are in spoke mode or a maximum of 10 sites can be enrolled in hub mode.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-secure-connect-site - - - organizationId (string): Organization ID - - enrollments (array): List of Meraki SD-WAN sites with the associated regions to be enrolled. - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/sites" - - body_params = [ - "enrollments", - "callback", - ] - 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 deleteOrganizationSecureConnectSites(self, organizationId: str, **kwargs): - """ - **Detach given sites from Secure Connect** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-secure-connect-sites - - - organizationId (string): Organization ID - - sites (array): List of site IDs to detach - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/sites" - - action = { - "resource": resource, - "operation": "destroy", - } - return action diff --git a/meraki/api/batch/sensor.py b/meraki/api/batch/sensor.py index 567ac66..c8363c1 100644 --- a/meraki/api/batch/sensor.py +++ b/meraki/api/batch/sensor.py @@ -12,10 +12,9 @@ def createDeviceSensorCommand(self, serial: str, operation: str, **kwargs): - serial (string): Serial - operation (string): Operation to run on the sensor. 'enableDownstreamPower', 'disableDownstreamPower', and 'cycleDownstreamPower' turn power on/off to the device that is connected downstream of an MT40 power monitor. 'refreshData' causes an MT15 or MT40 device to upload its latest readings so that they are immediately available in the Dashboard API. - - arguments (array): Additional options to provide to commands run on the sensor, each with a corresponding 'name' and 'value'. """ - kwargs.update(locals()) + kwargs = locals() if "operation" in kwargs: options = ["cycleDownstreamPower", "disableDownstreamPower", "enableDownstreamPower", "refreshData"] @@ -27,7 +26,6 @@ def createDeviceSensorCommand(self, serial: str, operation: str, **kwargs): resource = f"/devices/{serial}/sensor/commands" body_params = [ - "arguments", "operation", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} diff --git a/meraki/api/batch/sm.py b/meraki/api/batch/sm.py index a3a1549..939db0e 100644 --- a/meraki/api/batch/sm.py +++ b/meraki/api/batch/sm.py @@ -5,166 +5,6 @@ class ActionBatchSm(object): def __init__(self): super(ActionBatchSm, self).__init__() - def createNetworkSmScript(self, networkId: str, name: str, platform: str, **kwargs): - """ - **Create a new script** - https://developer.cisco.com/meraki/api-v1/#!create-network-sm-script - - - networkId (string): Network ID - - name (string): Unique name to identify this script. - - platform (string): Platform that this script will run on. - - scope (string): The target scope of the script. (Either scope or targetGroupId must be present.) - - tags (array): The target tags of the script as an array of strings. Required if scope is one of withAny, withoutAny, withAll, withoutAll. - - targetGroupId (string): The tag target group ID that should be used to scope devices. Either scope or targetGroupId must be present. - - description (string): Description of this script. - - runAsUsername (string): Username that script should run as. - - externalSource (object): Properties for a script provided by a url instead of an upload - - upload (object): Properties for a script provided as an upload instead of a url - - schedule (object): When the script is intended to run - """ - - kwargs.update(locals()) - - if "platform" in kwargs and kwargs["platform"] is not None: - options = ["Windows", "macOS"] - assert kwargs["platform"] in options, ( - f'''"platform" cannot be "{kwargs["platform"]}", & must be set to one of: {options}''' - ) - if "scope" in kwargs: - options = ["all", "none", "withAll", "withAny", "withoutAll", "withoutAny"] - assert kwargs["scope"] in options, f'''"scope" cannot be "{kwargs["scope"]}", & must be set to one of: {options}''' - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sm/scripts" - - body_params = [ - "name", - "platform", - "scope", - "tags", - "targetGroupId", - "description", - "runAsUsername", - "externalSource", - "upload", - "schedule", - ] - 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 createNetworkSmScriptsJob(self, networkId: str, scriptId: str, **kwargs): - """ - **Create a job that will run a script on a set of devices** - https://developer.cisco.com/meraki/api-v1/#!create-network-sm-scripts-job - - - networkId (string): Network ID - - scriptId (string): ID of script that should be run on the matching devices - - deviceIds (array): List of device IDs to run that should run this script - - deviceFilter (string): Create job on all devices in-scope or devices that have failed to run this script - """ - - kwargs.update(locals()) - - if "deviceFilter" in kwargs: - options = ["All", "Failed"] - assert kwargs["deviceFilter"] in options, ( - f'''"deviceFilter" cannot be "{kwargs["deviceFilter"]}", & must be set to one of: {options}''' - ) - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sm/scripts/jobs" - - body_params = [ - "scriptId", - "deviceIds", - "deviceFilter", - ] - 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 updateNetworkSmScript(self, networkId: str, scriptId: str, **kwargs): - """ - **Update an existing script** - https://developer.cisco.com/meraki/api-v1/#!update-network-sm-script - - - networkId (string): Network ID - - scriptId (string): Script ID - - name (string): Unique name to identify this script. - - platform (string): Platform that this script will run on. - - scope (string): The target scope of the script. (Either scope or targetGroupId must be present.) - - tags (array): The target tags of the script as an array of strings. Required if scope is one of withAny, withoutAny, withAll, withoutAll. - - targetGroupId (string): The tag target group ID that should be used to scope devices. Either scope or targetGroupId must be present. - - description (string): Description of this script. - - runAsUsername (string): Username that script should run as. - - externalSource (object): Properties for a script provided by a url instead of an upload - - upload (object): Properties for a script provided as an upload instead of a url - - schedule (object): When the script is intended to run - """ - - kwargs.update(locals()) - - if "platform" in kwargs and kwargs["platform"] is not None: - options = ["Windows", "macOS"] - assert kwargs["platform"] in options, ( - f'''"platform" cannot be "{kwargs["platform"]}", & must be set to one of: {options}''' - ) - if "scope" in kwargs: - options = ["all", "none", "withAll", "withAny", "withoutAll", "withoutAny"] - assert kwargs["scope"] in options, f'''"scope" cannot be "{kwargs["scope"]}", & must be set to one of: {options}''' - - networkId = urllib.parse.quote(str(networkId), safe="") - scriptId = urllib.parse.quote(str(scriptId), safe="") - resource = f"/networks/{networkId}/sm/scripts/{scriptId}" - - body_params = [ - "name", - "platform", - "scope", - "tags", - "targetGroupId", - "description", - "runAsUsername", - "externalSource", - "upload", - "schedule", - ] - 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 deleteNetworkSmScript(self, networkId: str, scriptId: str): - """ - **Delete a script** - https://developer.cisco.com/meraki/api-v1/#!delete-network-sm-script - - - networkId (string): Network ID - - scriptId (string): Script ID - """ - - networkId = urllib.parse.quote(str(networkId), safe="") - scriptId = urllib.parse.quote(str(scriptId), safe="") - resource = f"/networks/{networkId}/sm/scripts/{scriptId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - def deleteNetworkSmUserAccessDevice(self, networkId: str, userAccessDeviceId: str): """ **Delete a User Access Device** @@ -271,108 +111,6 @@ def deleteOrganizationSmAdminsRole(self, organizationId: str, roleId: str): } return action - def createOrganizationSmAppleCloudEnrollmentSyncJob(self, organizationId: str, **kwargs): - """ - **Enqueue a sync job for an ADE account** - https://developer.cisco.com/meraki/api-v1/#!create-organization-sm-apple-cloud-enrollment-sync-job - - - organizationId (string): Organization ID - - adeAccountId (string): ADE Account ID - - fullSync (boolean): Whether or not job is full sync (defaults to full sync) - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sm/apple/cloudEnrollment/syncJobs" - - body_params = [ - "adeAccountId", - "fullSync", - ] - 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 createOrganizationSmBulkEnrollmentToken(self, organizationId: str, networkId: str, expiresAt: str, **kwargs): - """ - **Create a PccBulkEnrollmentToken** - https://developer.cisco.com/meraki/api-v1/#!create-organization-sm-bulk-enrollment-token - - - organizationId (string): Organization ID - - networkId (string): The id of the associated node_group. - - expiresAt (string): The expiration date. - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sm/bulkEnrollment/token" - - body_params = [ - "networkId", - "expiresAt", - ] - 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 updateOrganizationSmBulkEnrollmentToken(self, organizationId: str, tokenId: str, **kwargs): - """ - **Update a PccBulkEnrollmentToken** - https://developer.cisco.com/meraki/api-v1/#!update-organization-sm-bulk-enrollment-token - - - organizationId (string): Organization ID - - tokenId (string): Token ID - - networkId (string): The id of the associated node_group. - - expiresAt (string): The expiration date. - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - tokenId = urllib.parse.quote(str(tokenId), safe="") - resource = f"/organizations/{organizationId}/sm/bulkEnrollment/token/{tokenId}" - - body_params = [ - "networkId", - "expiresAt", - ] - 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 deleteOrganizationSmBulkEnrollmentToken(self, organizationId: str, tokenId: str): - """ - **Delete a PccBulkEnrollmentToken** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-sm-bulk-enrollment-token - - - organizationId (string): Organization ID - - tokenId (string): Token ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - tokenId = urllib.parse.quote(str(tokenId), safe="") - resource = f"/organizations/{organizationId}/sm/bulkEnrollment/token/{tokenId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - def updateOrganizationSmSentryPoliciesAssignments(self, organizationId: str, items: list, **kwargs): """ **Update an Organizations Sentry Policies using the provided list. Sentry Policies are ordered in descending order of priority (i.e. highest priority at the bottom, this is opposite the Dashboard UI). Policies not present in the request will be deleted.** diff --git a/meraki/api/batch/support.py b/meraki/api/batch/support.py deleted file mode 100644 index e884c29..0000000 --- a/meraki/api/batch/support.py +++ /dev/null @@ -1,3 +0,0 @@ -class ActionBatchSupport(object): - def __init__(self): - super(ActionBatchSupport, self).__init__() diff --git a/meraki/api/batch/switch.py b/meraki/api/batch/switch.py index b7b8163..670ef83 100644 --- a/meraki/api/batch/switch.py +++ b/meraki/api/batch/switch.py @@ -30,40 +30,6 @@ def cycleDeviceSwitchPorts(self, serial: str, ports: list, **kwargs): } return action - def updateDeviceSwitchPortsMirror(self, serial: str, source: dict, destination: dict, **kwargs): - """ - **Update a port mirror** - https://developer.cisco.com/meraki/api-v1/#!update-device-switch-ports-mirror - - - serial (string): The switch identifier - - source (object): Source ports mirror configuration - - destination (object): Destination port mirror configuration - - tags (array): Port mirror tags - - role (string): Switch role can be source or destination - - comment (string): My pretty comment - """ - - kwargs.update(locals()) - - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/switch/ports/mirror" - - body_params = [ - "serial", - "source", - "destination", - "tags", - "role", - "comment", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "mirrors/update", - "body": payload, - } - return action - def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): """ **Update a switch port** @@ -79,7 +45,6 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - vlan (integer): The VLAN of the switch port. For a trunk port, this is the native VLAN. A null value will clear the value set for trunk ports. - voiceVlan (integer): The voice VLAN of the switch port. Only applicable to access ports. - allowedVlans (string): The VLANs allowed on the switch port. Only applicable to trunk ports. - - activeVlans (string): The VLANs that are active on the switch port. Only applicable to trunk ports. - isolationEnabled (boolean): The isolation status of the switch port. - rstpEnabled (boolean): The rapid spanning tree protocol status. - stpGuard (string): The state of the STP guard ('disabled', 'root guard', 'bpdu guard' or 'loop guard'). @@ -136,7 +101,6 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): "vlan", "voiceVlan", "allowedVlans", - "activeVlans", "isolationEnabled", "rstpEnabled", "stpGuard", @@ -182,12 +146,6 @@ def createDeviceSwitchRoutingInterface(self, serial: str, name: str, **kwargs): - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. - vlanId (integer): The VLAN this L3 interface is on. VLAN must be between 1 and 4094. - defaultGateway (string): The next hop for any traffic that isn't going to a directly connected subnet or over a static route. This IP address must exist in a subnet with a L3 interface. Required if this is the first IPv4 interface. - - isSwitchDefaultGateway (boolean): When true, the switch uses the IPv4 uplink gateway as its IPv4 default gateway. This can only be set if the interface is designated as the IPv4 uplink and the switch is running IOS XE version >= 17.18.3. - - uplinkV4 (boolean): When true, this interface is used as static IPv4 uplink. - - candidateUplinkV4 (boolean): When true, this interface is a UAC candidate for IPv4 Uplink. - - uplinkV6 (boolean): When true, this interface is used as static IPv6 uplink. - - staticV4Dns1 (string): Primary IPv4 DNS server address - - staticV4Dns2 (string): Secondary IPv4 DNS server address - ospfSettings (object): The OSPF routing settings of the interface. - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher @@ -218,12 +176,6 @@ def createDeviceSwitchRoutingInterface(self, serial: str, name: str, **kwargs): "multicastRouting", "vlanId", "defaultGateway", - "isSwitchDefaultGateway", - "uplinkV4", - "candidateUplinkV4", - "uplinkV6", - "staticV4Dns1", - "staticV4Dns2", "ospfSettings", "ipv6", "vrf", @@ -252,12 +204,6 @@ def updateDeviceSwitchRoutingInterface(self, serial: str, interfaceId: str, **kw - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. - vlanId (integer): The VLAN this L3 interface is on. VLAN must be between 1 and 4094. - defaultGateway (string): The next hop for any traffic that isn't going to a directly connected subnet or over a static route. This IP address must exist in a subnet with a L3 interface. Required if this is the first IPv4 interface. - - isSwitchDefaultGateway (boolean): When true, the switch uses the IPv4 uplink gateway as its IPv4 default gateway. This can only be set if the interface is designated as the IPv4 uplink and the switch is running IOS XE version >= 17.18.3. - - uplinkV4 (boolean): When true, this interface is used as static IPv4 uplink. - - candidateUplinkV4 (boolean): When true, this interface is a UAC candidate for IPv4 Uplink. - - uplinkV6 (boolean): When true, this interface is used as static IPv6 uplink. - - staticV4Dns1 (string): Primary IPv4 DNS server address - - staticV4Dns2 (string): Secondary IPv4 DNS server address - ospfSettings (object): The OSPF routing settings of the interface. - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher @@ -285,12 +231,6 @@ def updateDeviceSwitchRoutingInterface(self, serial: str, interfaceId: str, **kw "multicastRouting", "vlanId", "defaultGateway", - "isSwitchDefaultGateway", - "uplinkV4", - "candidateUplinkV4", - "uplinkV6", - "staticV4Dns1", - "staticV4Dns2", "ospfSettings", "ipv6", "vrf", @@ -862,7 +802,6 @@ def createNetworkSwitchLinkAggregation(self, networkId: str, **kwargs): - networkId (string): Network ID - switchPorts (array): Array of switch or stack ports for creating aggregation group. Minimum 2 and maximum 8 ports are supported. - switchProfilePorts (array): Array of switch profile ports for creating aggregation group. Minimum 2 and maximum 8 ports are supported. - - esiMhPairId (string): ESI-MH pair ID. Required when creating a downstream aggregation across ESI-MH pair member switches. """ kwargs.update(locals()) @@ -873,7 +812,6 @@ def createNetworkSwitchLinkAggregation(self, networkId: str, **kwargs): body_params = [ "switchPorts", "switchProfilePorts", - "esiMhPairId", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -990,97 +928,6 @@ def updateNetworkSwitchPortSchedule(self, networkId: str, portScheduleId: str, * } return action - def createNetworkSwitchPortsProfile(self, networkId: str, **kwargs): - """ - **Create a port profile in a network** - https://developer.cisco.com/meraki/api-v1/#!create-network-switch-ports-profile - - - networkId (string): Network ID - - name (string): The name of the profile. - - description (string): Text describing the profile. - - tags (array): Space-seperated list of tags - - defaultRadiusProfileName (string): When present, the default RADIUS attribute value for RADIUS-based port profile application - - authentication (object): Authentication settings for RADIUS-based port profile application. - - port (object): Configuration settings for port profile - """ - - kwargs.update(locals()) - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/switch/ports/profiles" - - body_params = [ - "name", - "description", - "tags", - "defaultRadiusProfileName", - "authentication", - "port", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "profiles/create", - "body": payload, - } - return action - - def updateNetworkSwitchPortsProfile(self, networkId: str, id: str, **kwargs): - """ - **Update a port profile in a network** - https://developer.cisco.com/meraki/api-v1/#!update-network-switch-ports-profile - - - networkId (string): Network ID - - id (string): ID - - name (string): The name of the profile. - - description (string): Text describing the profile. - - tags (array): Space-seperated list of tags - - defaultRadiusProfileName (string): When present, the default RADIUS attribute value for RADIUS-based port profile application - - authentication (object): Authentication settings for RADIUS-based port profile application. - - port (object): Configuration settings for port profile - """ - - kwargs.update(locals()) - - networkId = urllib.parse.quote(str(networkId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/networks/{networkId}/switch/ports/profiles/{id}" - - body_params = [ - "name", - "description", - "tags", - "defaultRadiusProfileName", - "authentication", - "port", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "profiles/update", - "body": payload, - } - return action - - def deleteNetworkSwitchPortsProfile(self, networkId: str, id: str): - """ - **Delete a port profile from a network** - https://developer.cisco.com/meraki/api-v1/#!delete-network-switch-ports-profile - - - networkId (string): Network ID - - id (string): ID - """ - - networkId = urllib.parse.quote(str(networkId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/networks/{networkId}/switch/ports/profiles/{id}" - - action = { - "resource": resource, - "operation": "profiles/destroy", - } - return action - def createNetworkSwitchQosRule(self, networkId: str, vlan: int, **kwargs): """ **Add a quality of service rule** @@ -1398,39 +1245,6 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): } return action - def updateNetworkSwitchSpanningTree(self, networkId: str, **kwargs): - """ - **Updates Spanning Tree configuration** - https://developer.cisco.com/meraki/api-v1/#!update-network-switch-spanning-tree - - - networkId (string): Network ID - - enabled (boolean): Network-level spanning Tree enable - - mode (string): Catalyst Spanning Tree Protocol mode (mst, rpvst+) - - priorities (array): Spanning tree priority for switches/stacks or switch templates. An empty array will clear the priority settings. - """ - - kwargs.update(locals()) - - if "mode" in kwargs: - options = ["mst", "rpvst+"] - assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/switch/spanningTree" - - body_params = [ - "enabled", - "mode", - "priorities", - ] - 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 updateNetworkSwitchStack(self, networkId: str, switchStackId: str, **kwargs): """ **Update a switch stack. At least one of 'name' or 'members' must be provided. If 'members' is provided, it replaces the entire stack membership.** @@ -1460,43 +1274,6 @@ def updateNetworkSwitchStack(self, networkId: str, switchStackId: str, **kwargs) } return action - def updateNetworkSwitchStackPortsMirror( - self, networkId: str, switchStackId: str, source: dict, destination: dict, **kwargs - ): - """ - **Update switch port mirrors for switch stacks** - https://developer.cisco.com/meraki/api-v1/#!update-network-switch-stack-ports-mirror - - - networkId (string): Network ID - - switchStackId (string): Switch stack ID - - source (object): Source port details - - destination (object): Destination port Details - - tags (array): Port mirror tags - - role (string): Switch role can be source or destination - - comment (string): My pretty comment - """ - - kwargs.update(locals()) - - networkId = urllib.parse.quote(str(networkId), safe="") - switchStackId = urllib.parse.quote(str(switchStackId), safe="") - resource = f"/networks/{networkId}/switch/stacks/{switchStackId}/ports/mirror" - - body_params = [ - "source", - "destination", - "tags", - "role", - "comment", - ] - 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 createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId: str, name: str, **kwargs): """ **Create a layer 3 interface for a switch stack** @@ -1513,12 +1290,6 @@ def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. - vlanId (integer): The VLAN this L3 interface is on. VLAN must be between 1 and 4094. - defaultGateway (string): The next hop for any traffic that isn't going to a directly connected subnet or over a static route. This IP address must exist in a subnet with a L3 interface. Required if this is the first IPv4 interface. - - isSwitchDefaultGateway (boolean): When true, the switch uses the IPv4 uplink gateway as its IPv4 default gateway. This can only be set if the interface is designated as the IPv4 uplink and the switch is running IOS XE version >= 17.18.3. - - uplinkV4 (boolean): When true, this interface is used as static IPv4 uplink. - - candidateUplinkV4 (boolean): When true, this interface is a UAC candidate for IPv4 Uplink. - - uplinkV6 (boolean): When true, this interface is used as static IPv6 uplink. - - staticV4Dns1 (string): Primary IPv4 DNS server address - - staticV4Dns2 (string): Secondary IPv4 DNS server address - ospfSettings (object): The OSPF routing settings of the interface. - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher @@ -1550,12 +1321,6 @@ def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId "multicastRouting", "vlanId", "defaultGateway", - "isSwitchDefaultGateway", - "uplinkV4", - "candidateUplinkV4", - "uplinkV6", - "staticV4Dns1", - "staticV4Dns2", "ospfSettings", "ipv6", "vrf", @@ -1585,12 +1350,6 @@ def updateNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. - vlanId (integer): The VLAN this L3 interface is on. VLAN must be between 1 and 4094. - defaultGateway (string): The next hop for any traffic that isn't going to a directly connected subnet or over a static route. This IP address must exist in a subnet with a L3 interface. Required if this is the first IPv4 interface. - - isSwitchDefaultGateway (boolean): When true, the switch uses the IPv4 uplink gateway as its IPv4 default gateway. This can only be set if the interface is designated as the IPv4 uplink and the switch is running IOS XE version >= 17.18.3. - - uplinkV4 (boolean): When true, this interface is used as static IPv4 uplink. - - candidateUplinkV4 (boolean): When true, this interface is a UAC candidate for IPv4 Uplink. - - uplinkV6 (boolean): When true, this interface is used as static IPv6 uplink. - - staticV4Dns1 (string): Primary IPv4 DNS server address - - staticV4Dns2 (string): Secondary IPv4 DNS server address - ospfSettings (object): The OSPF routing settings of the interface. - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher @@ -1619,12 +1378,6 @@ def updateNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId "multicastRouting", "vlanId", "defaultGateway", - "isSwitchDefaultGateway", - "uplinkV4", - "candidateUplinkV4", - "uplinkV6", - "staticV4Dns1", - "staticV4Dns2", "ospfSettings", "ipv6", "vrf", @@ -1889,47 +1642,6 @@ def updateNetworkSwitchStp(self, networkId: str, **kwargs): } return action - def updateOrganizationConfigTemplateSwitchProfilePortsMirror( - self, organizationId: str, configTemplateId: str, profileId: str, source: dict, destination: dict, **kwargs - ): - """ - **Update a port mirror** - https://developer.cisco.com/meraki/api-v1/#!update-organization-config-template-switch-profile-ports-mirror - - - organizationId (string): Organization ID - - configTemplateId (string): Config template ID - - profileId (string): Profile ID - - source (object): Source ports mirror configuration - - destination (object): Destination port mirror configuration - - tags (array): Port mirror tags - - role (string): Switch role can be source or destination - - comment (string): My pretty comment - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - configTemplateId = urllib.parse.quote(str(configTemplateId), safe="") - profileId = urllib.parse.quote(str(profileId), safe="") - resource = ( - f"/organizations/{organizationId}/configTemplates/{configTemplateId}/switch/profiles/{profileId}/ports/mirror" - ) - - body_params = [ - "source", - "destination", - "tags", - "role", - "comment", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "mirrors/update", - "body": payload, - } - return action - def updateOrganizationConfigTemplateSwitchProfilePort( self, organizationId: str, configTemplateId: str, profileId: str, portId: str, **kwargs ): @@ -1949,7 +1661,6 @@ def updateOrganizationConfigTemplateSwitchProfilePort( - vlan (integer): The VLAN of the switch template port. For a trunk port, this is the native VLAN. A null value will clear the value set for trunk ports. - voiceVlan (integer): The voice VLAN of the switch template port. Only applicable to access ports. - allowedVlans (string): The VLANs allowed on the switch template port. Only applicable to trunk ports. - - activeVlans (string): The VLANs that are active on the switch template port. Only applicable to trunk ports. - isolationEnabled (boolean): The isolation status of the switch template port. - rstpEnabled (boolean): The rapid spanning tree protocol status. - stpGuard (string): The state of the STP guard ('disabled', 'root guard', 'bpdu guard' or 'loop guard'). @@ -2008,7 +1719,6 @@ def updateOrganizationConfigTemplateSwitchProfilePort( "vlan", "voiceVlan", "allowedVlans", - "activeVlans", "isolationEnabled", "rstpEnabled", "stpGuard", @@ -2037,33 +1747,6 @@ def updateOrganizationConfigTemplateSwitchProfilePort( } return action - def cloneOrganizationSwitchProfilesToTemplateNetwork(self, organizationId: str, **kwargs): - """ - **Clone existing switch templates into a destination template network.** - https://developer.cisco.com/meraki/api-v1/#!clone-organization-switch-profiles-to-template-network - - - organizationId (string): Organization ID - - profileIds (array): Switch profile IDs to clone - - templateNodeGroupId (string): Destination template network ID - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/cloneProfilesToTemplateNetwork" - - body_params = [ - "profileIds", - "templateNodeGroupId", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "cloneProfilesToTemplateNetwork", - "body": payload, - } - return action - def cloneOrganizationSwitchDevices(self, organizationId: str, sourceSerial: str, targetSerials: list, **kwargs): """ **Clone port-level and some switch-level configuration settings from a source switch to one or more target switches. Cloned settings include: Aggregation Groups, Power Settings, Multicast Settings, MTU Configuration, STP Bridge priority, Port Mirroring** @@ -2090,762 +1773,3 @@ def cloneOrganizationSwitchDevices(self, organizationId: str, sourceSerial: str, "body": payload, } return action - - def createOrganizationSwitchPortsProfile(self, organizationId: str, **kwargs): - """ - **Create a port profile in an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-ports-profile - - - organizationId (string): Organization ID - - name (string): The name of the profile. - - description (string): Text describing the profile. - - isOrganizationWide (boolean): The scope of the profile whether it is organization level or network level - - networks (object): The networks which are included/excluded in the profile - - networkId (string): The network identifier - - tags (array): Space-seperated list of tags - - defaultRadiusProfileName (string): When present, the default RADIUS attribute value for RADIUS-based port profile application - - authentication (object): Authentication settings for RADIUS-based port profile application. - - port (object): Configuration settings for port profile - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles" - - body_params = [ - "name", - "description", - "isOrganizationWide", - "networks", - "networkId", - "tags", - "defaultRadiusProfileName", - "authentication", - "port", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "profiles/create", - "body": payload, - } - return action - - def batchOrganizationSwitchPortsProfilesAssignmentsAssign(self, organizationId: str, items: list, **kwargs): - """ - **Batch assign or unassign port profiles to switch ports** - https://developer.cisco.com/meraki/api-v1/#!batch-organization-switch-ports-profiles-assignments-assign - - - organizationId (string): Organization ID - - items (array): Array of assignment operations (max 100) - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/assignments/batchAssign" - - body_params = [ - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "batch_assign", - "body": payload, - } - return action - - def createOrganizationSwitchPortsProfilesAutomation(self, organizationId: str, **kwargs): - """ - **Create a port profile automation for an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-ports-profiles-automation - - - organizationId (string): Organization ID - - name (string): Name of the port profile automation. - - description (string): Text describing the port profile automation. - - fallbackProfile (object): Configuration settings for port profile - - rules (array): Configuration settings for port profile automation rules - - assignedSwitchPorts (array): assigned switch ports - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/automations" - - body_params = [ - "name", - "description", - "fallbackProfile", - "rules", - "assignedSwitchPorts", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "automations/actions/update", - "body": payload, - } - return action - - def updateOrganizationSwitchPortsProfilesAutomation(self, organizationId: str, id: str, **kwargs): - """ - **Update a port profile automation in an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-switch-ports-profiles-automation - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of the port profile automation. - - description (string): Text describing the port profile automation. - - fallbackProfile (object): Configuration settings for port profile - - rules (array): Configuration settings for port profile automation rules - - assignedSwitchPorts (array): assigned switch ports - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/automations/{id}" - - body_params = [ - "name", - "description", - "fallbackProfile", - "rules", - "assignedSwitchPorts", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "automations/actions/update", - "body": payload, - } - return action - - def deleteOrganizationSwitchPortsProfilesAutomation(self, organizationId: str, id: str): - """ - **Delete an automation port profile from an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-ports-profiles-automation - - - organizationId (string): Organization ID - - id (string): ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/automations/{id}" - - action = { - "resource": resource, - "operation": "automations/actions/destroy", - } - return action - - def createOrganizationSwitchPortsProfilesNetworksAssignment( - self, organizationId: str, type: str, profile: dict, network: dict, **kwargs - ): - """ - **Create Network and Smart Ports Profile association for a specific profile** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-ports-profiles-networks-assignment - - - organizationId (string): Organization ID - - type (string): Type of association - - profile (object): Smart Port Profile object - - network (object): Network object - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/networks/assignments" - - body_params = [ - "type", - "profile", - "network", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "profiles/create", - "body": payload, - } - return action - - def batchOrganizationSwitchPortsProfilesNetworksAssignmentsCreate(self, organizationId: str, items: list, **kwargs): - """ - **Batch Create Network and Smart Ports Profile associations for a specific profile** - https://developer.cisco.com/meraki/api-v1/#!batch-organization-switch-ports-profiles-networks-assignments-create - - - organizationId (string): Organization ID - - items (array): Array of network and profile associations - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/networks/assignments/batchCreate" - - body_params = [ - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "batch_create", - "body": payload, - } - return action - - def bulkOrganizationSwitchPortsProfilesNetworksAssignmentsDelete(self, organizationId: str, items: list, **kwargs): - """ - **Bulk delete Network and Smart Port Profile associations** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-switch-ports-profiles-networks-assignments-delete - - - organizationId (string): Organization ID - - items (array): Array of assignments to delete - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/networks/assignments/bulkDelete" - - body_params = [ - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "bulk_destroy", - "body": payload, - } - return action - - def deleteOrganizationSwitchPortsProfilesNetworksAssignment(self, organizationId: str, assignmentId: str): - """ - **Delete Network and Smart Port profile association for a specific profile** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-ports-profiles-networks-assignment - - - organizationId (string): Organization ID - - assignmentId (string): Assignment ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - assignmentId = urllib.parse.quote(str(assignmentId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/networks/assignments/{assignmentId}" - - action = { - "resource": resource, - "operation": "profiles/destroy", - } - return action - - def createOrganizationSwitchPortsProfilesRadiusAssignment(self, organizationId: str, network: dict, **kwargs): - """ - **Create a port profile RADIUS assignment** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-ports-profiles-radius-assignment - - - organizationId (string): Organization ID - - network (object): The network where the RADIUS name is assigned - - portProfile (object): The assigned port profile - - radius (object): The RADIUS options for this assignment - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/radius/assignments" - - body_params = [ - "network", - "portProfile", - "radius", - ] - 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 updateOrganizationSwitchPortsProfilesRadiusAssignment(self, organizationId: str, id: str, **kwargs): - """ - **Update a port profile RADIUS assignment** - https://developer.cisco.com/meraki/api-v1/#!update-organization-switch-ports-profiles-radius-assignment - - - organizationId (string): Organization ID - - id (string): ID - - network (object): The network where the RADIUS name is assigned - - portProfile (object): The assigned port profile - - radius (object): The RADIUS options for this assignment - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/radius/assignments/{id}" - - body_params = [ - "network", - "portProfile", - "radius", - ] - 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 deleteOrganizationSwitchPortsProfilesRadiusAssignment(self, organizationId: str, id: str): - """ - **Deletes a port profile RADIUS assignment** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-ports-profiles-radius-assignment - - - organizationId (string): Organization ID - - id (string): ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/radius/assignments/{id}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def updateOrganizationSwitchPortsProfile(self, organizationId: str, id: str, **kwargs): - """ - **Update a port profile in an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-switch-ports-profile - - - organizationId (string): Organization ID - - id (string): ID - - name (string): The name of the profile. - - description (string): Text describing the profile. - - isOrganizationWide (boolean): The scope of the profile whether it is organization level or network level - - networks (object): The networks which are included/excluded in the profile - - networkId (string): The network identifier - - tags (array): Space-seperated list of tags - - defaultRadiusProfileName (string): When present, the default RADIUS attribute value for RADIUS-based port profile application - - authentication (object): Authentication settings for RADIUS-based port profile application. - - port (object): Configuration settings for port profile - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/{id}" - - body_params = [ - "name", - "description", - "isOrganizationWide", - "networks", - "networkId", - "tags", - "defaultRadiusProfileName", - "authentication", - "port", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "profiles/update", - "body": payload, - } - return action - - def deleteOrganizationSwitchPortsProfile(self, organizationId: str, id: str): - """ - **Delete a port profile from an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-ports-profile - - - organizationId (string): Organization ID - - id (string): ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/{id}" - - action = { - "resource": resource, - "operation": "profiles/destroy", - } - return action - - def createOrganizationSwitchRoutingBgpAutonomousSystem(self, organizationId: str, number: int, **kwargs): - """ - **Create an autonomous system. Border Gateway Protocol requires IOS XE 17.18 or higher** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-autonomous-system - - - organizationId (string): Organization ID - - number (integer): The autonomous system number (CLI: 'router bgp ') - - description (string): A description for the autonomous system - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/autonomousSystems" - - body_params = [ - "number", - "description", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "systems/create", - "body": payload, - } - return action - - def updateOrganizationSwitchRoutingBgpAutonomousSystem(self, organizationId: str, autonomousSystemId: str, **kwargs): - """ - **Update an autonomous system. Border Gateway Protocol requires IOS XE 17.18 or higher** - https://developer.cisco.com/meraki/api-v1/#!update-organization-switch-routing-bgp-autonomous-system - - - organizationId (string): Organization ID - - autonomousSystemId (string): Autonomous system ID - - number (integer): The autonomous system number (CLI: 'router bgp ') - - description (string): A description for the autonomous system - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - autonomousSystemId = urllib.parse.quote(str(autonomousSystemId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/autonomousSystems/{autonomousSystemId}" - - body_params = [ - "number", - "description", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "systems/update", - "body": payload, - } - return action - - def deleteOrganizationSwitchRoutingBgpAutonomousSystem(self, organizationId: str, autonomousSystemId: str): - """ - **Delete an autonomous system from an organization. Border Gateway Protocol requires IOS XE 17.18 or higher** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-routing-bgp-autonomous-system - - - organizationId (string): Organization ID - - autonomousSystemId (string): Autonomous system ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - autonomousSystemId = urllib.parse.quote(str(autonomousSystemId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/autonomousSystems/{autonomousSystemId}" - - action = { - "resource": resource, - "operation": "systems/destroy", - } - return action - - def createOrganizationSwitchRoutingBgpFiltersFilterListsDeploy( - self, organizationId: str, filterList: dict, network: dict, rules: list, **kwargs - ): - """ - **Create or update a filter list, in addition to its associated rules. Border Gateway Protocol requires IOS XE 17.18 or higher** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-filters-filter-lists-deploy - - - organizationId (string): Organization ID - - filterList (object): Information regarding the filter list - - network (object): Information regarding the network the filter list belongs to - - rules (array): Information regarding the filter list rules - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/filterLists/deploy" - - body_params = [ - "filterList", - "network", - "rules", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "deploy", - "body": payload, - } - return action - - def deleteOrganizationSwitchRoutingBgpFiltersFilterList(self, organizationId: str, listId: str): - """ - **Delete a filter list. Border Gateway Protocol requires IOS XE 17.18 or higher** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-routing-bgp-filters-filter-list - - - organizationId (string): Organization ID - - listId (string): List ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - listId = urllib.parse.quote(str(listId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/filterLists/{listId}" - - action = { - "resource": resource, - "operation": "lists/destroy", - } - return action - - def createOrganizationSwitchRoutingBgpFiltersPrefixListsDeploy( - self, organizationId: str, network: dict, prefixList: dict, rules: list, **kwargs - ): - """ - **Create or update a prefix list, in addition to its associated rules. Border Gateway Protocol requires IOS XE 17.18 or higher** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-filters-prefix-lists-deploy - - - organizationId (string): Organization ID - - network (object): Information regarding the network the prefix list belongs to - - prefixList (object): Information regarding the prefix list - - rules (array): Information regarding the prefix list rules - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/prefixLists/deploy" - - body_params = [ - "network", - "prefixList", - "rules", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "deploy", - "body": payload, - } - return action - - def deleteOrganizationSwitchRoutingBgpFiltersPrefixList(self, organizationId: str, listId: str): - """ - **Delete a prefix list. Border Gateway Protocol requires IOS XE 17.18 or higher** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-routing-bgp-filters-prefix-list - - - organizationId (string): Organization ID - - listId (string): List ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - listId = urllib.parse.quote(str(listId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/prefixLists/{listId}" - - action = { - "resource": resource, - "operation": "lists/destroy", - } - return action - - def createOrganizationSwitchRoutingBgpPeersGroupsDeploy( - self, - organizationId: str, - addressFamily: dict, - network: dict, - peerGroup: dict, - peerGroupAddressFamilyBindingProfile: dict, - peerGroupProfile: dict, - policies: list, - router: dict, - **kwargs, - ): - """ - **Create or update a peer group, in addition to an associated peer group profile, peer group address family binding, peer group address family binding profile and routing policies associated with the peer group. Border Gateway Protocol requires IOS XE 17.18 or higher** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-peers-groups-deploy - - - organizationId (string): Organization ID - - addressFamily (object): Information regarding the address family the peer group address family binding belongs to - - network (object): Information regarding the network the peer group profile belongs to - - peerGroup (object): Information regarding the peer group - - peerGroupAddressFamilyBindingProfile (object): Information regarding the peer group address family binding profile - - peerGroupProfile (object): Information regarding the peer group profile - - policies (array): Information regarding the routing policies - - router (object): Information regarding the router this peer group belongs to - - peerGroupAddressFamilyBinding (object): Information regarding the peer group address family binding. Only required when updating. - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/groups/deploy" - - body_params = [ - "addressFamily", - "network", - "peerGroup", - "peerGroupAddressFamilyBinding", - "peerGroupAddressFamilyBindingProfile", - "peerGroupProfile", - "policies", - "router", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "deploy", - "body": payload, - } - return action - - def createOrganizationSwitchRoutingBgpPeersNeighborsDeploy( - self, - organizationId: str, - addressFamily: dict, - neighbor: dict, - neighborAddressFamilyBinding: dict, - peerGroup: dict, - policies: list, - router: dict, - **kwargs, - ): - """ - **Create or update a neighor, in addition to an associated neighbor address family binding and routing policies associated with the neighbor. Border Gateway Protocol requires IOS XE 17.18 or higher** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-peers-neighbors-deploy - - - organizationId (string): Organization ID - - addressFamily (object): Information regarding the address family this binding is bound to - - neighbor (object): Information regarding the BPG neighbor - - neighborAddressFamilyBinding (object): Information regarding the neighbor address family binding - - peerGroup (object): Information regarding the peer group this neighbor belongs to - - policies (array): Information regarding the routing policies related to the neighbor - - router (object): Information regarding the router this neighbor peers with - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/neighbors/deploy" - - body_params = [ - "addressFamily", - "neighbor", - "neighborAddressFamilyBinding", - "peerGroup", - "policies", - "router", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "deploy", - "body": payload, - } - return action - - def createOrganizationSwitchRoutingBgpRoutersDeploy( - self, - organizationId: str, - addressFamily: dict, - addressFamilyPrefixes: list, - addressFamilyProfile: dict, - autonomousSystem: dict, - router: dict, - switch: dict, - **kwargs, - ): - """ - **Create a BGP router, in addition to an associated address family, address family prefixes, and address family profile. This is helpful for the initial deployment of a BGP router.. Border Gateway Protocol requires IOS XE 17.18 or higher** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-routers-deploy - - - organizationId (string): Organization ID - - addressFamily (object): Information regarding the address family - - addressFamilyPrefixes (array): The list of network prefixes to which the address family applies - - addressFamilyProfile (object): Information regarding the profile applied to the address family - - autonomousSystem (object): Information regarding the router's autonomous system - - router (object): Information regarding the BPG router - - switch (object): The router's switch node. When the router is part of a switch stack, this is the switch stack's active node - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/routers/deploy" - - body_params = [ - "addressFamily", - "addressFamilyPrefixes", - "addressFamilyProfile", - "autonomousSystem", - "router", - "switch", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "deploy", - "body": payload, - } - return action - - def createOrganizationSwitchRoutingBgpRoutersPeersDeploy( - self, organizationId: str, addressFamily: dict, peerGroups: list, router: dict, **kwargs - ): - """ - **Create and update listen ranges, update peers' enabled flag, and delete peer groups for a BGP router. Border Gateway Protocol requires IOS XE 17.18 or higher** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-routers-peers-deploy - - - organizationId (string): Organization ID - - addressFamily (object): Information regarding the address family - - peerGroups (array): Information regarding the peer group peers for a router's peer group - - router (object): Information regarding the BPG router - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/routers/peers/deploy" - - body_params = [ - "addressFamily", - "peerGroups", - "router", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "peers_deploy", - "body": payload, - } - return action - - def deleteOrganizationSwitchRoutingBgpRouter(self, organizationId: str, routerId: str): - """ - **Delete a router from an organization. Border Gateway Protocol requires IOS XE 17.18 or higher** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-routing-bgp-router - - - organizationId (string): Organization ID - - routerId (string): Router ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - routerId = urllib.parse.quote(str(routerId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/routers/{routerId}" - - action = { - "resource": resource, - "operation": "ms/actions/bgp/routers/destroy", - } - return action diff --git a/meraki/api/batch/users.py b/meraki/api/batch/users.py deleted file mode 100644 index ef21c3e..0000000 --- a/meraki/api/batch/users.py +++ /dev/null @@ -1,359 +0,0 @@ -import urllib - - -class ActionBatchUsers(object): - def __init__(self): - super(ActionBatchUsers, self).__init__() - - def createOrganizationIamUsersAuthorization(self, organizationId: str, authZone: dict, **kwargs): - """ - **Authorize a Meraki end user for an auth zone.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-authorization - - - organizationId (string): Organization ID - - authZone (object): Auth zone - - email (string): Meraki end user's email - - idpUserId (string): Meraki end user's ID - - startsAt (string): Start time of the desired access for the authorization. Defaults to now. - - expiresAt (string): Expiration time of the desired access for the authorization - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations" - - body_params = [ - "email", - "idpUserId", - "authZone", - "startsAt", - "expiresAt", - ] - 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 updateOrganizationIamUsersAuthorizations(self, organizationId: str, **kwargs): - """ - **Update a Meraki end user's access to an auth zone.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-iam-users-authorizations - - - organizationId (string): Organization ID - - authorizationId (string): Authorization ID - - email (string): Meraki end user's email - - authZone (object): Auth zone - - startsAt (string): Start time of the desired access for the authorization - - expiresAt (string): Expiration time of the desired access for the authorization - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations" - - body_params = [ - "authorizationId", - "email", - "authZone", - "startsAt", - "expiresAt", - ] - 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 revokeOrganizationIamUsersAuthorizationsAuthorization(self, organizationId: str, authZone: dict, **kwargs): - """ - **Revoke a Meraki end user's access to an auth zone.** - https://developer.cisco.com/meraki/api-v1/#!revoke-organization-iam-users-authorizations-authorization - - - organizationId (string): Organization ID - - authZone (object): Auth zone - - email (string): Meraki end user's email - - authorizationId (string): Authorization ID - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations/authorization/revoke" - - body_params = [ - "email", - "authorizationId", - "authZone", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "revoke", - "body": payload, - } - return action - - def deleteOrganizationIamUsersAuthorization(self, organizationId: str, authorizationId: str): - """ - **Delete an authorization for a Meraki end user.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-iam-users-authorization - - - organizationId (string): Organization ID - - authorizationId (string): Authorization ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - authorizationId = urllib.parse.quote(str(authorizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations/{authorizationId}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def createOrganizationIamUsersIdp(self, organizationId: str, name: str, type: str, idpConfig: dict, **kwargs): - """ - **Create an identity provider for an organization. Only Entra ID(Azure AD) is supported at this time.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-idp - - - organizationId (string): Organization ID - - name (string): Name of the identity provider - - type (string): Type of the identity provider - - idpConfig (object): Identity provider configuration. Required for external identity providers. - - description (string): Optional. Description of the identity provider - - syncType (string): The synchronization method for the identity provider. Set to 'proactive' to sync all users and groups from your identity provider. - """ - - kwargs.update(locals()) - - if "type" in kwargs: - options = ["Azure AD"] - assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' - if "syncType" in kwargs and kwargs["syncType"] is not None: - options = ["proactive"] - assert kwargs["syncType"] in options, ( - f'''"syncType" cannot be "{kwargs["syncType"]}", & must be set to one of: {options}''' - ) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps" - - body_params = [ - "name", - "type", - "description", - "idpConfig", - "syncType", - ] - 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 createOrganizationIamUsersIdpsTestConnectivity(self, organizationId: str, **kwargs): - """ - **Test connectivity to an Entra ID identity provider.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-idps-test-connectivity - - - organizationId (string): Organization ID - - idpId (string): Id of the identity provider - - idpConfig (object): Identity provider configuration. Required for external identity providers. - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/testConnectivity" - - body_params = [ - "idpId", - "idpConfig", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "test_connectivity", - "body": payload, - } - return action - - def createOrganizationIamUsersIdpsUser(self, organizationId: str, **kwargs): - """ - **Create a Meraki user** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-idps-user - - - organizationId (string): Organization ID - - displayName (string): A human-readable identifier for the created user. - - email (string): An email address identified with the user. - - password (string): The password for the user account. - - sendPassword (boolean): If true, sends an email with the password to the user. - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/users" - - body_params = [ - "displayName", - "email", - "password", - "sendPassword", - ] - 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 updateOrganizationIamUsersIdpsUser(self, organizationId: str, id: str, **kwargs): - """ - **Update a Meraki user** - https://developer.cisco.com/meraki/api-v1/#!update-organization-iam-users-idps-user - - - organizationId (string): Organization ID - - id (string): ID - - displayName (string): A human-readable identifier for the created user. - - email (string): An email address identified with the user. - - password (string): The password for the user account. - - sendPassword (boolean): If true, sends an email with the password to the user. - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/users/{id}" - - body_params = [ - "displayName", - "email", - "password", - "sendPassword", - ] - 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 deleteOrganizationIamUsersIdpsUser(self, organizationId: str, id: str): - """ - **Delete a Meraki end user** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-iam-users-idps-user - - - organizationId (string): Organization ID - - id (string): ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/users/{id}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def createOrganizationIamUsersIdpSync(self, organizationId: str, idpId: str, **kwargs): - """ - **Trigger an IdP sync for an identity provider. Only Entra ID(Azure AD) is supported at this time.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-idp-sync - - - organizationId (string): Organization ID - - idpId (string): Idp ID - - emails (array): List of emails to sync - - force (boolean): Force a complete sync of all users and groups - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - idpId = urllib.parse.quote(str(idpId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/{idpId}/sync" - - body_params = [ - "emails", - "force", - ] - 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 updateOrganizationIamUsersIdp(self, organizationId: str, id: str, **kwargs): - """ - **Update an identity provider. Only Entra ID(Azure AD) is supported at this time.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-iam-users-idp - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of the identity provider - - description (string): Description of the identity provider - - idpConfig (object): Identity provider configuration. You can update individual attributes - - syncType (string): The synchronization method for the identity provider. Set to 'proactive' to sync all users and groups from your identity provider. Set to 'null' for on-demand user and group provisioning. - """ - - kwargs.update(locals()) - - if "syncType" in kwargs and kwargs["syncType"] is not None: - options = ["proactive"] - assert kwargs["syncType"] in options, ( - f'''"syncType" cannot be "{kwargs["syncType"]}", & must be set to one of: {options}''' - ) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/{id}" - - body_params = [ - "name", - "description", - "idpConfig", - "syncType", - ] - 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 deleteOrganizationIamUsersIdp(self, organizationId: str, id: str): - """ - **Delete a identity provider from an organization. Only Entra ID(Azure AD) is supported at this time.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-iam-users-idp - - - organizationId (string): Organization ID - - id (string): ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/{id}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action diff --git a/meraki/api/batch/wireless.py b/meraki/api/batch/wireless.py index f9026a7..69e45e3 100644 --- a/meraki/api/batch/wireless.py +++ b/meraki/api/batch/wireless.py @@ -42,7 +42,6 @@ def updateDeviceWirelessBluetoothSettings(self, serial: str, **kwargs): Dashboard's automatically generated value. - minor (integer): Desired minor value of the beacon. If the value is set to null it will reset to Dashboard's automatically generated value. - - transmit (object): Transmit settings including power, interval, and advertised power. """ kwargs.update(locals()) @@ -54,7 +53,6 @@ def updateDeviceWirelessBluetoothSettings(self, serial: str, **kwargs): "uuid", "major", "minor", - "transmit", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -91,60 +89,6 @@ def updateDeviceWirelessElectronicShelfLabel(self, serial: str, **kwargs): } return action - def updateDeviceWirelessRadioAfcPosition(self, serial: str, **kwargs): - """ - **Update the position attributes for this device** - https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-radio-afc-position - - - serial (string): Serial - - height (object): Height attributes - - gps (object): GPS attributes - """ - - kwargs.update(locals()) - - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/radio/afc/position" - - body_params = [ - "height", - "gps", - ] - 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 updateDeviceWirelessRadioOverrides(self, serial: str, **kwargs): - """ - **Update 2.4 GHz, 5 GHz, and 6 GHz radio settings (channel, channel width, power, and enable/disable) that override RF profiles.** - https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-radio-overrides - - - serial (string): Serial - - rfProfile (object): This device's RF profile - - radios (array): Radio overrides. - """ - - kwargs.update(locals()) - - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/radio/overrides" - - body_params = [ - "rfProfile", - "radios", - ] - 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 updateDeviceWirelessRadioSettings(self, serial: str, **kwargs): """ **Update 2.4 GHz and 5 GHz radio settings (channel, channel width, power) that override RF profiles. For 6 GHz support or radio enable/disable, use updateDeviceWirelessRadioOverrides instead.** @@ -388,7 +332,6 @@ def createNetworkWirelessEthernetPortsProfile(self, networkId: str, name: str, p - name (string): AP port profile name - ports (array): AP ports configuration - usbPorts (array): AP usb ports configuration - - security (object): AP port security configuration """ kwargs.update(locals()) @@ -400,7 +343,6 @@ def createNetworkWirelessEthernetPortsProfile(self, networkId: str, name: str, p "name", "ports", "usbPorts", - "security", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -472,7 +414,6 @@ def updateNetworkWirelessEthernetPortsProfile(self, networkId: str, profileId: s - name (string): AP port profile name - ports (array): AP ports configuration - usbPorts (array): AP usb ports configuration - - security (object): AP port security configuration """ kwargs.update(locals()) @@ -485,7 +426,6 @@ def updateNetworkWirelessEthernetPortsProfile(self, networkId: str, profileId: s "name", "ports", "usbPorts", - "security", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -541,89 +481,6 @@ def updateNetworkWirelessLocationScanning(self, networkId: str, **kwargs): } return action - def updateNetworkWirelessLocationWayfinding(self, networkId: str, **kwargs): - """ - **Change client wayfinding settings** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-location-wayfinding - - - networkId (string): Network ID - - enabled (boolean): Whether to enable client wayfinding on that network (only supported on Wireless networks). - - maintenanceWindow (object): Maintenance window during which optimization might take place to improve location accuracy. - """ - - kwargs.update(locals()) - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/location/wayfinding" - - body_params = [ - "enabled", - "maintenanceWindow", - ] - 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 updateNetworkWirelessOpportunisticPcap(self, networkId: str, **kwargs): - """ - **Update the Opportunistic Pcap settings for a wireless network** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-opportunistic-pcap - - - networkId (string): Network ID - - enablement (object): Enablement settings - """ - - kwargs.update(locals()) - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/opportunisticPcap" - - body_params = [ - "enablement", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "factory", - "body": payload, - } - return action - - def updateNetworkWirelessRadioAutoRf(self, networkId: str, **kwargs): - """ - **Update the AutoRF settings for a wireless network** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-radio-auto-rf - - - networkId (string): Network ID - - busyHour (object): Busy Hour settings - - channel (object): Channel settings - - fra (object): FRA settings - - aiRrm (object): AI-RRM settings - """ - - kwargs.update(locals()) - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/radio/autoRf" - - body_params = [ - "busyHour", - "channel", - "fra", - "aiRrm", - ] - 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 updateNetworkWirelessRadioRrm(self, networkId: str, **kwargs): """ **Update the AutoRF settings for a wireless network** @@ -672,7 +529,6 @@ def createNetworkWirelessRfProfile(self, networkId: str, name: str, bandSelectio - transmission (object): Settings related to radio transmission. - perSsidSettings (object): Per-SSID radio settings by number. - flexRadios (object): Flex radio settings. - - dot11be (object): 802.11be settings """ kwargs.update(locals()) @@ -703,7 +559,6 @@ def createNetworkWirelessRfProfile(self, networkId: str, name: str, bandSelectio "transmission", "perSsidSettings", "flexRadios", - "dot11be", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -733,7 +588,6 @@ def updateNetworkWirelessRfProfile(self, networkId: str, rfProfileId: str, **kwa - transmission (object): Settings related to radio transmission. - perSsidSettings (object): Per-SSID radio settings by number. - flexRadios (object): Flex radio settings. - - dot11be (object): 802.11be settings """ kwargs.update(locals()) @@ -767,7 +621,6 @@ def updateNetworkWirelessRfProfile(self, networkId: str, rfProfileId: str, **kwa "transmission", "perSsidSettings", "flexRadios", - "dot11be", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -850,7 +703,6 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - number (string): Number - name (string): The name of the SSID - enabled (boolean): Whether or not the SSID is enabled - - localAuth (boolean): Extended local auth flag for Enterprise NAC - authMode (string): The association control method for the SSID ('open', 'open-enhanced', 'psk', 'open-with-radius', 'open-enhanced-with-radius', 'open-with-nac', '8021x-meraki', '8021x-nac', '8021x-radius', '8021x-google', '8021x-entra', '8021x-localradius', 'ipsk-with-radius', 'ipsk-without-radius', 'ipsk-with-nac' or 'ipsk-with-radius-easy-psk') - enterpriseAdminAccess (string): Whether or not an SSID is accessible by 'enterprise' administrators ('access disabled' or 'access enabled') - ssidAdminAccessible (boolean): SSID Administrator access status @@ -882,7 +734,6 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - radiusAccountingInterimInterval (integer): The interval (in seconds) in which accounting information is updated and sent to the RADIUS accounting server. - radiusAttributeForGroupPolicies (string): Specify the RADIUS attribute used to look up group policies ('Filter-Id', 'Reply-Message', 'Airespace-ACL-Name' or 'Aruba-User-Role'). Access points must receive this attribute in the RADIUS Access-Accept message - ipAssignmentMode (string): The client IP assignment mode ('NAT mode', 'Bridge mode', 'Layer 3 roaming', 'Ethernet over GRE', 'Layer 3 roaming with a concentrator', 'VPN' or 'Campus Gateway') - - campusGateway (object): Campus gateway settings - useVlanTagging (boolean): Whether or not traffic should be directed to use specific VLANs. This param is only valid if the ipAssignmentMode is 'Bridge mode' or 'Layer 3 roaming' - concentratorNetworkId (string): The concentrator to use when the ipAssignmentMode is 'Layer 3 roaming with a concentrator' or 'VPN'. - secondaryConcentratorNetworkId (string): The secondary concentrator to use when the ipAssignmentMode is 'VPN'. If configured, the APs will switch to using this concentrator if the primary concentrator is unreachable. This param is optional. ('disabled' represents no secondary concentrator.) @@ -1000,7 +851,6 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): body_params = [ "name", "enabled", - "localAuth", "authMode", "enterpriseAdminAccess", "ssidAdminAccessible", @@ -1032,7 +882,6 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): "radiusAccountingInterimInterval", "radiusAttributeForGroupPolicies", "ipAssignmentMode", - "campusGateway", "useVlanTagging", "concentratorNetworkId", "secondaryConcentratorNetworkId", @@ -1397,117 +1246,6 @@ def updateNetworkWirelessSsidOpenRoaming(self, networkId: str, number: str, **kw } return action - def updateNetworkWirelessSsidPoliciesClientExclusion(self, networkId: str, number: str, **kwargs): - """ - **Update the client exclusion status configuration for a given SSID** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ssid-policies-client-exclusion - - - networkId (string): Network ID - - number (string): Number - - static (object): Static client exclusion status - - dynamic (object): Dynamic client exclusion configuration - """ - - kwargs.update(locals()) - - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/wireless/ssids/{number}/policies/clientExclusion" - - body_params = [ - "static", - "dynamic", - ] - 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 updateNetworkWirelessSsidPoliciesClientExclusionStaticExclusions( - self, networkId: str, number: str, macs: list, **kwargs - ): - """ - **Replace the static client exclusion list for the given SSID (use PUT /exclusions)** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ssid-policies-client-exclusion-static-exclusions - - - networkId (string): Network ID - - number (string): Number - - macs (array): MAC addresses to set as static exclusion list - """ - - kwargs = locals() - - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/wireless/ssids/{number}/policies/clientExclusion/static/exclusions" - - body_params = [ - "macs", - ] - 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 createNetworkWirelessSsidPoliciesClientExclusionStaticExclusionsBulkAdd( - self, networkId: str, number: str, macs: list, **kwargs - ): - """ - **Add MAC addresses to the existing static client exclusion list for the given SSID (use POST /bulkAdd)** - https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-ssid-policies-client-exclusion-static-exclusions-bulk-add - - - networkId (string): Network ID - - number (string): Number - - macs (array): MAC addresses to add to static exclusion - """ - - kwargs = locals() - - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/wireless/ssids/{number}/policies/clientExclusion/static/exclusions/bulkAdd" - - body_params = [ - "macs", - ] - 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 createNetworkWirelessSsidPoliciesClientExclusionStaticExclusionsBulkRemove( - self, networkId: str, number: str, macs: list, **kwargs - ): - """ - **Remove MAC addresses from the existing static client exclusion list for the given SSID (use POST /bulkRemove)** - https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-ssid-policies-client-exclusion-static-exclusions-bulk-remove - - - networkId (string): Network ID - - number (string): Number - - macs (array): MAC addresses to remove from static exclusion - """ - - kwargs = locals() - - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/wireless/ssids/{number}/policies/clientExclusion/static/exclusions/bulkRemove" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - def updateNetworkWirelessSsidSchedules(self, networkId: str, number: str, **kwargs): """ **Update the outage schedule for the SSID** @@ -1552,7 +1290,6 @@ def updateNetworkWirelessSsidSplashSettings(self, networkId: str, number: str, * - redirectUrl (string): The custom redirect URL where the users will go after the splash page. - useRedirectUrl (boolean): The Boolean indicating whether the the user will be redirected to the custom redirect URL after the splash page. A custom redirect URL must be set if this is true. - welcomeMessage (string): The welcome message for the users on the splash page. - - language (string): Language of splash page. - userConsent (object): User consent settings - themeId (string): The id of the selected splash theme. - splashLogo (object): The logo used in the splash page. @@ -1574,32 +1311,6 @@ def updateNetworkWirelessSsidSplashSettings(self, networkId: str, number: str, * assert kwargs["splashTimeout"] in options, ( f'''"splashTimeout" cannot be "{kwargs["splashTimeout"]}", & must be set to one of: {options}''' ) - if "language" in kwargs: - options = [ - "DA", - "DE", - "EL", - "EN", - "ES", - "FI", - "FR", - "GL", - "IT", - "JA", - "KO", - "NL", - "NO", - "PL", - "PT", - "RU", - "SK", - "SV", - "UK", - "ZH", - ] - assert kwargs["language"] in options, ( - f'''"language" cannot be "{kwargs["language"]}", & must be set to one of: {options}''' - ) if "controllerDisconnectionBehavior" in kwargs: options = ["default", "open", "restricted"] assert kwargs["controllerDisconnectionBehavior"] in options, ( @@ -1617,7 +1328,6 @@ def updateNetworkWirelessSsidSplashSettings(self, networkId: str, number: str, * "redirectUrl", "useRedirectUrl", "welcomeMessage", - "language", "userConsent", "themeId", "splashLogo", @@ -1735,33 +1445,6 @@ def updateNetworkWirelessZigbee(self, networkId: str, **kwargs): } return action - def createOrganizationWirelessDevicesLiveToolsClientDisconnect(self, organizationId: str, clientId: str, **kwargs): - """ - **Enqueue a job to disconnect a client from an AP. This endpoint has a sustained rate limit of one request every five seconds per device, with an allowed burst of five requests.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-devices-live-tools-client-disconnect - - - organizationId (string): Organization ID - - clientId (string): Client ID - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - clientId = urllib.parse.quote(str(clientId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/liveTools/clients/{clientId}/disconnect" - - body_params = [ - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "disconnect", - "body": payload, - } - return action - def createOrganizationWirelessDevicesProvisioningDeployment(self, organizationId: str, items: list, **kwargs): """ **Create a zero touch deployment for a wireless access point** @@ -2057,133 +1740,6 @@ def updateOrganizationWirelessSsidsFirewallIsolationAllowlistEntry(self, organiz } return action - def createOrganizationWirelessSsidsProfile(self, organizationId: str, name: str, ssid: dict, **kwargs): - """ - **Create a new SSID profile in an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-ssids-profile - - - organizationId (string): Organization ID - - name (string): Name of the SSID profile - - ssid (object): SSID configuration for the profile - - precedence (object): Precedence configuration for the SSID profile - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles" - - body_params = [ - "name", - "precedence", - "ssid", - ] - 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 createOrganizationWirelessSsidsProfilesAssignment(self, organizationId: str, profile: dict, ssid: dict, **kwargs): - """ - **Assigns an SSID profile to an SSID in the organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-ssids-profiles-assignment - - - organizationId (string): Organization ID - - profile (object): SSID profile to assign - - ssid (object): SSID to assign the SSID profile to - - network (object): Network containing the SSID (required if SSID number is used) - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/assignments" - - body_params = [ - "profile", - "ssid", - "network", - ] - 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 deleteOrganizationWirelessSsidsProfilesAssignments(self, organizationId: str, ssid: dict, **kwargs): - """ - **Unassigns the SSID profile assigned to an SSID** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-ssids-profiles-assignments - - - organizationId (string): Organization ID - - ssid (object): SSID to delete the SSID profile assignment of - - network (object): Network containing the SSID (required if SSID number is used) - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/assignments" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - - def updateOrganizationWirelessSsidsProfile(self, organizationId: str, id: str, **kwargs): - """ - **Update this SSID profile** - https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-ssids-profile - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of the SSID profile - - ssid (object): SSID configuration for the profile - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/{id}" - - body_params = [ - "name", - "ssid", - ] - 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 deleteOrganizationWirelessSsidsProfile(self, organizationId: str, id: str): - """ - **Delete an SSID profile** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-ssids-profile - - - organizationId (string): Organization ID - - id (string): ID - """ - - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/{id}" - - action = { - "resource": resource, - "operation": "destroy", - } - return action - def updateOrganizationWirelessZigbeeDevice(self, organizationId: str, id: str, enrolled: bool, **kwargs): """ **Endpoint to update zigbee gateways** diff --git a/meraki/api/camera.py b/meraki/api/camera.py index 7d98331..2f83425 100644 --- a/meraki/api/camera.py +++ b/meraki/api/camera.py @@ -739,97 +739,6 @@ def getNetworkCameraSchedules(self, networkId: str): return self._session.get(metadata, resource) - def createNetworkCameraVideoWall(self, networkId: str, name: str, tiles: list, **kwargs): - """ - **Create a new video wall.** - https://developer.cisco.com/meraki/api-v1/#!create-network-camera-video-wall - - - networkId (string): Network ID - - name (string): The name of the video wall. - - tiles (array): The tiles that should appear on the video wall. - - index (integer): The order that this wall should appear on the video wall list. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["camera", "configure", "videoWalls"], - "operation": "createNetworkCameraVideoWall", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/camera/videoWalls" - - body_params = [ - "name", - "index", - "tiles", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createNetworkCameraVideoWall: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def updateNetworkCameraVideoWall(self, networkId: str, id: str, name: str, tiles: list, **kwargs): - """ - **Update the specified video wall.** - https://developer.cisco.com/meraki/api-v1/#!update-network-camera-video-wall - - - networkId (string): Network ID - - id (string): ID - - name (string): The name of the video wall. - - tiles (array): The tiles that should appear on the video wall. - - index (integer): The order that this wall should appear on the video wall list. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["camera", "configure", "videoWalls"], - "operation": "updateNetworkCameraVideoWall", - } - networkId = urllib.parse.quote(str(networkId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/networks/{networkId}/camera/videoWalls/{id}" - - body_params = [ - "name", - "index", - "tiles", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkCameraVideoWall: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteNetworkCameraVideoWall(self, networkId: str, id: str): - """ - **Delete the specified video wall.** - https://developer.cisco.com/meraki/api-v1/#!delete-network-camera-video-wall - - - networkId (string): Network ID - - id (string): ID - """ - - metadata = { - "tags": ["camera", "configure", "videoWalls"], - "operation": "deleteNetworkCameraVideoWall", - } - networkId = urllib.parse.quote(str(networkId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/networks/{networkId}/camera/videoWalls/{id}" - - return self._session.delete(metadata, resource) - def createNetworkCameraWirelessProfile(self, networkId: str, name: str, ssid: dict, **kwargs): """ **Creates a new camera wireless profile for this network.** @@ -1182,45 +1091,6 @@ def getOrganizationCameraDetectionsHistoryByBoundaryByInterval( return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationCameraDevicesConfigurations(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Lists all the capabilities of cameras in this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-devices-configurations - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 20. - - 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": ["camera", "configure", "devices", "configurations"], - "operation": "getOrganizationCameraDevicesConfigurations", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/camera/devices/configurations" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCameraDevicesConfigurations: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationCameraOnboardingStatuses(self, organizationId: str, **kwargs): """ **Fetch onboarding status of cameras** @@ -1466,104 +1336,3 @@ def updateOrganizationCameraRole(self, organizationId: str, roleId: str, **kwarg self._session._logger.warning(f"updateOrganizationCameraRole: ignoring unrecognized kwargs: {invalid}") return self._session.put(metadata, resource, payload) - - def getOrganizationCameraVideoWalls(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return a list of video walls.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-video-walls - - - 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 10 - 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): A list of network ids to filter video walls on - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["camera", "configure", "videoWalls"], - "operation": "getOrganizationCameraVideoWalls", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/camera/videoWalls" - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationCameraVideoWalls: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationCameraVideoWall(self, organizationId: str, id: str): - """ - **Return the specified video wall.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-video-wall - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["camera", "configure", "videoWalls"], - "operation": "getOrganizationCameraVideoWall", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/camera/videoWalls/{id}" - - return self._session.get(metadata, resource) - - def getOrganizationCameraVideoWallVideoLink(self, organizationId: str, id: str, **kwargs): - """ - **Returns video wall link to the specified video wall id** - https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-video-wall-video-link - - - organizationId (string): Organization ID - - id (string): ID - - timestamp (string): [optional] The video link will start at this time. The timestamp should be a string in ISO8601 format. If no timestamp is specified, we will assume current time. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["camera", "configure", "videoWalls", "videoLink"], - "operation": "getOrganizationCameraVideoWallVideoLink", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/camera/videoWalls/{id}/videoLink" - - query_params = [ - "timestamp", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCameraVideoWallVideoLink: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) diff --git a/meraki/api/campusGateway.py b/meraki/api/campusGateway.py index cc456d9..c563618 100644 --- a/meraki/api/campusGateway.py +++ b/meraki/api/campusGateway.py @@ -96,150 +96,6 @@ def updateNetworkCampusGatewayCluster(self, networkId: str, clusterId: str, **kw return self._session.put(metadata, resource, payload) - def deleteNetworkCampusGatewayCluster(self, networkId: str, clusterId: str): - """ - **Delete a cluster** - https://developer.cisco.com/meraki/api-v1/#!delete-network-campus-gateway-cluster - - - networkId (string): Network ID - - clusterId (string): Cluster ID - """ - - metadata = { - "tags": ["campusGateway", "configure", "clusters"], - "operation": "deleteNetworkCampusGatewayCluster", - } - networkId = urllib.parse.quote(str(networkId), safe="") - clusterId = urllib.parse.quote(str(clusterId), safe="") - resource = f"/networks/{networkId}/campusGateway/clusters/{clusterId}" - - return self._session.delete(metadata, resource) - - def getNetworkCampusGatewaySsidMdns(self, networkId: str, number: str): - """ - **List the currently configured mDNS settings for the SSID** - https://developer.cisco.com/meraki/api-v1/#!get-network-campus-gateway-ssid-mdns - - - networkId (string): Network ID - - number (string): Number - """ - - metadata = { - "tags": ["campusGateway", "configure", "ssids", "mdns"], - "operation": "getNetworkCampusGatewaySsidMdns", - } - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/campusGateway/ssids/{number}/mdns" - - return self._session.get(metadata, resource) - - def updateNetworkCampusGatewaySsidMdns(self, networkId: str, number: str, **kwargs): - """ - **Update the mDNS gateway settings and rules for a SSID and cluster** - https://developer.cisco.com/meraki/api-v1/#!update-network-campus-gateway-ssid-mdns - - - networkId (string): Network ID - - number (string): Number - - enabled (boolean): If true, mDNS gateway is enabled for this SSID and cluster. - - rules (array): List of mDNS forwarding rules. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["campusGateway", "configure", "ssids", "mdns"], - "operation": "updateNetworkCampusGatewaySsidMdns", - } - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/campusGateway/ssids/{number}/mdns" - - body_params = [ - "enabled", - "rules", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkCampusGatewaySsidMdns: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getOrganizationCampusGatewayClientsUsageByNetworkByCluster( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns client usage details for campus gateway clusters within an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-clients-usage-by-network-by-cluster - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 1 hour and be less than or equal to 7 days. The default is 2 hours. - - networkIds (array): Filter results by a list of network IDs. - - networkGroupIds (array): Limit the results to clients that belong to one of the provided network groups. - - clusterIds (array): Filter results by a list of cluster IDs. - - usageUnits (string): Usage units to use in the response. - """ - - kwargs.update(locals()) - - if "usageUnits" in kwargs: - options = ["GB", "KB", "MB", "TB"] - assert kwargs["usageUnits"] in options, ( - f'''"usageUnits" cannot be "{kwargs["usageUnits"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["campusGateway", "monitor", "clients", "usage", "byNetwork", "byCluster"], - "operation": "getOrganizationCampusGatewayClientsUsageByNetworkByCluster", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clients/usage/byNetwork/byCluster" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "networkIds", - "networkGroupIds", - "clusterIds", - "usageUnits", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "networkGroupIds", - "clusterIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayClientsUsageByNetworkByCluster: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationCampusGatewayClusters(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Get the details of campus gateway clusters** @@ -287,556 +143,6 @@ def getOrganizationCampusGatewayClusters(self, organizationId: str, total_pages= return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationCampusGatewayClustersFailoverTargets( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the details of a Failover Targets for a Campus Gateway cluster** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-clusters-failover-targets - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter networks. This filter uses multiple exact matches. - - clusterIds (array): Optional parameter to filter clusters. This filter uses multiple exact matches. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["campusGateway", "configure", "clusters", "failover", "targets"], - "operation": "getOrganizationCampusGatewayClustersFailoverTargets", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/failover/targets" - - query_params = [ - "networkIds", - "clusterIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "clusterIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayClustersFailoverTargets: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationCampusGatewayClustersFailoverTargetsByCluster( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get available backup cluster targets for campus gateway failover configuration** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-clusters-failover-targets-by-cluster - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Networks for which backup cluster targets should be gathered. - - clusterIds (array): Cluster IDs to filter backup cluster targets. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["campusGateway", "configure", "clusters", "failover", "targets", "byCluster"], - "operation": "getOrganizationCampusGatewayClustersFailoverTargetsByCluster", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/failover/targets/byCluster" - - query_params = [ - "networkIds", - "clusterIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "clusterIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayClustersFailoverTargetsByCluster: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationCampusGatewayClustersNetworksOverviews( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List networks tunneling through Campus Gateway clusters with their AP, ssids and client counts** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-clusters-networks-overviews - - - 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 - - clusterIds (array): Optional parameter to filter by MCG cluster IDs. This filter uses multiple exact matches. - - siteIds (array): Optional parameter to filter by site IDs. This filter uses multiple exact matches. - - networkIds (array): Optional parameter to filter networks. This filter uses multiple exact matches. - - tunnelingSources (array): Optional parameter to filter networks by tunneling source. 'configured' returns networks explicitly set up to tunnel through the campus gateway. 'roaming' returns networks tunneling due to AP roaming or disaster recovery. 'roaming' is only effective when 'clusterIds' is also provided; without 'clusterIds', the filter defaults to configured-only behavior. Defaults to 'configured' if omitted. - - search (string): Optional parameter to filter networks by wireless network name. This filter uses case-insensitive substring matching. - - sortBy (string): Optional parameter to sort results. Default is 'name'. Use 'siteName' to sort by site name. - - sortOrder (string): Optional parameter to specify sort direction. Default is 'asc'. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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()) - - if "sortBy" in kwargs: - options = ["clients", "clusterId", "connections", "name", "networkId", "siteName", "ssids"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["campusGateway", "configure", "clusters", "networks", "overviews"], - "operation": "getOrganizationCampusGatewayClustersNetworksOverviews", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/networks/overviews" - - query_params = [ - "clusterIds", - "siteIds", - "networkIds", - "tunnelingSources", - "search", - "sortBy", - "sortOrder", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "clusterIds", - "siteIds", - "networkIds", - "tunnelingSources", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayClustersNetworksOverviews: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def provisionOrganizationCampusGatewayClusters( - self, - organizationId: str, - clusterId: str, - network: dict, - name: str, - uplinks: list, - tunnels: list, - nameservers: dict, - portChannels: list, - **kwargs, - ): - """ - **Provisions a cluster,adds campus gateways to it and associate/dissociate failover targets.** - https://developer.cisco.com/meraki/api-v1/#!provision-organization-campus-gateway-clusters - - - organizationId (string): Organization ID - - clusterId (string): ID of the cluster to be provisioned - - network (object): Network to be provisioned - - 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 - - failover (object): Failover targets for the cluster - - notes (string): Notes about cluster with max size of 511 characters allowed - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["campusGateway", "configure", "clusters"], - "operation": "provisionOrganizationCampusGatewayClusters", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/provision" - - body_params = [ - "clusterId", - "network", - "name", - "uplinks", - "tunnels", - "nameservers", - "portChannels", - "devices", - "failover", - "notes", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"provisionOrganizationCampusGatewayClusters: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationCampusGatewayClustersSsids(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List SSIDs tunneling through Campus Gateway clusters** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-clusters-ssids - - - 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 - - clusterIds (array): Optional parameter to filter by MCG cluster IDs. This filter uses multiple exact matches. - - networkIds (array): Optional parameter to filter networks. This filter uses multiple exact matches. - - search (string): Optional parameter to filter SSIDs by name. This filter uses case-insensitive starts with string matching. - - sortBy (string): Optional parameter to sort results. Default is 'networkId'. - - sortOrder (string): Optional parameter to specify sort direction. Default is 'asc'. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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()) - - if "sortBy" in kwargs: - options = ["clusterId", "name", "networkId", "ssidId"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["campusGateway", "configure", "clusters", "ssids"], - "operation": "getOrganizationCampusGatewayClustersSsids", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/ssids" - - query_params = [ - "clusterIds", - "networkIds", - "search", - "sortBy", - "sortOrder", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "clusterIds", - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayClustersSsids: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationCampusGatewayClustersTunnelingByClusterByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List all the MCG cluster-network tunnel settings** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-clusters-tunneling-by-cluster-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 - - clusterIds (array): Optional parameter to filter MCG clusters. This filter uses multiple exact matches - - dataEncryptionEnabled (boolean): Optional parameter to filter cluster-network tunnel settings by data encryption configuration - - networkIds (array): Optional parameter to filter networks. This filter uses multiple exact matches - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["campusGateway", "configure", "clusters", "tunneling", "byCluster", "byNetwork"], - "operation": "getOrganizationCampusGatewayClustersTunnelingByClusterByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/tunneling/byCluster/byNetwork" - - query_params = [ - "clusterIds", - "dataEncryptionEnabled", - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "clusterIds", - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayClustersTunnelingByClusterByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def batchOrganizationCampusGatewayClustersTunnelingByClusterByNetworkUpdate(self, organizationId: str, **kwargs): - """ - **Update MCG cluster-network tunnel settings for multiple networks** - https://developer.cisco.com/meraki/api-v1/#!batch-organization-campus-gateway-clusters-tunneling-by-cluster-by-network-update - - - organizationId (string): Organization ID - - items (array): MCG cluster-network tunnel settings - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["campusGateway", "configure", "clusters", "tunneling", "byCluster", "byNetwork"], - "operation": "batchOrganizationCampusGatewayClustersTunnelingByClusterByNetworkUpdate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/clusters/tunneling/byCluster/byNetwork/batchUpdate" - - body_params = [ - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"batchOrganizationCampusGatewayClustersTunnelingByClusterByNetworkUpdate: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationCampusGatewayConnections(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the details of APs tunneling through the Campus Gateway clusters** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-connections - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter networks. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter connections(APs) by its own serials. This filter uses multiple exact matches. - - campusGatewaySerials (array): Optional parameter to filter connections(APs) by MCG serials. This filter uses multiple exact matches. - - campusGatewayClusterIds (array): Optional parameter to filter connections(APs) by MCG cluster IDs. This filter uses multiple exact matches. - - campusGatewayTunnelStatuses (array): Optional parameter to filter connections(APs) by tunnel statuses. This filter uses multiple exact matches. - - search (string): Optional parameter to filter connections(APs) on AP name, serial, MAC address, network name, or interface IP address. This filter uses partial string matching (ILIKE). - - models (array): Optional parameter to filter connections(APs) by device model names. This filter uses multiple exact matches. - - dataEncryptionStatuses (array): Optional parameter to filter connections(APs) by data encryption status. This filter uses multiple exact matches. - - sortBy (string): Optional parameter to sort results. Available options: name, serial, status, interfaces, clients, dataEncryption, networkName. Default is 'serial'. - - sortOrder (string): Optional parameter to specify sort direction. Default is 'asc'. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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()) - - if "sortBy" in kwargs: - options = ["clients", "dataEncryption", "interfaces", "name", "networkName", "serial", "status"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["campusGateway", "configure", "connections"], - "operation": "getOrganizationCampusGatewayConnections", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/connections" - - query_params = [ - "networkIds", - "serials", - "campusGatewaySerials", - "campusGatewayClusterIds", - "campusGatewayTunnelStatuses", - "search", - "models", - "dataEncryptionStatuses", - "sortBy", - "sortOrder", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "campusGatewaySerials", - "campusGatewayClusterIds", - "campusGatewayTunnelStatuses", - "models", - "dataEncryptionStatuses", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayConnections: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, **kwargs): - """ - **List the count of connections(APs) with tunneling status up and down through the Campus Gateway clusters** - https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-connections-overview - - - organizationId (string): Organization ID - - networkIds (array): Optional parameter to filter networks. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter connections(APs) by its own serials. This filter uses multiple exact matches. - - campusGatewaySerials (array): Optional parameter to filter connections(APs) by Campus Gateway serials. This filter uses multiple exact matches. - - campusGatewayClusterIds (array): Optional parameter to filter connections(APs) by Campus Gateway cluster IDs. This filter uses multiple exact matches. - - campusGatewayTunnelStatuses (array): Optional parameter to filter connections(APs) by tunnel statuses. This filter uses multiple exact matches. - - search (string): Optional setting that lets you filter access points (APs) by name, serial number, MAC address, network name, or interface IP address. The filter matches partial text, not just exact values (uses ILIKE matching). - - models (array): Optional parameter to filter connections(APs) by device model names. This filter uses multiple exact matches. - - dataEncryptionStatuses (array): Optional parameter to filter connections(APs) by data encryption status. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["campusGateway", "configure", "connections", "overview"], - "operation": "getOrganizationCampusGatewayConnectionsOverview", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/campusGateway/connections/overview" - - query_params = [ - "networkIds", - "serials", - "campusGatewaySerials", - "campusGatewayClusterIds", - "campusGatewayTunnelStatuses", - "search", - "models", - "dataEncryptionStatuses", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "campusGatewaySerials", - "campusGatewayClusterIds", - "campusGatewayTunnelStatuses", - "models", - "dataEncryptionStatuses", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCampusGatewayConnectionsOverview: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - def getOrganizationCampusGatewayDevicesUplinksLocalOverridesByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): diff --git a/meraki/api/devices.py b/meraki/api/devices.py index 8a43605..a89bc23 100644 --- a/meraki/api/devices.py +++ b/meraki/api/devices.py @@ -232,56 +232,6 @@ def createDeviceCellularUplinksBandsMasksUpdate(self, serial: str, slot: str, ty return self._session.post(metadata, resource, payload) - def revokeDeviceCertificate(self, serial: str, certificateSerial: str, **kwargs): - """ - **Revoke a device certificate** - https://developer.cisco.com/meraki/api-v1/#!revoke-device-certificate - - - serial (string): Serial - - certificateSerial (string): Certificate serial - - reason (string): Revocation reason per RFC 5280; omit to use `unspecified` - """ - - kwargs.update(locals()) - - if "reason" in kwargs: - options = [ - "aACompromise", - "affiliationChanged", - "cACompromise", - "certificateHold", - "cessationOfOperation", - "keyCompromise", - "privilegeWithdrawn", - "removeFromCRL", - "superseded", - "unspecified", - ] - assert kwargs["reason"] in options, ( - f'''"reason" cannot be "{kwargs["reason"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["devices", "configure", "certificates"], - "operation": "revokeDeviceCertificate", - } - serial = urllib.parse.quote(str(serial), safe="") - certificateSerial = urllib.parse.quote(str(certificateSerial), safe="") - resource = f"/devices/{serial}/certificates/{certificateSerial}/revoke" - - body_params = [ - "reason", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"revokeDeviceCertificate: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - def getDeviceClients(self, serial: str, **kwargs): """ **List the clients of a device, up to a maximum of a month ago** @@ -315,56 +265,6 @@ def getDeviceClients(self, serial: str, **kwargs): return self._session.get(metadata, resource, params) - def createDeviceLiveToolsAclHitCount(self, serial: str, **kwargs): - """ - **Enqueue a job to perform an ACL hit count for the device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-acl-hit-count - - - serial (string): Serial - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["devices", "liveTools", "aclHitCount"], - "operation": "createDeviceLiveToolsAclHitCount", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/aclHitCount" - - body_params = [ - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsAclHitCount: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getDeviceLiveToolsAclHitCount(self, serial: str, id: str): - """ - **Return an ACL hit count live tool job.** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-acl-hit-count - - - serial (string): Serial - - id (string): ID - """ - - metadata = { - "tags": ["devices", "liveTools", "aclHitCount"], - "operation": "getDeviceLiveToolsAclHitCount", - } - serial = urllib.parse.quote(str(serial), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/devices/{serial}/liveTools/aclHitCount/{id}" - - return self._session.get(metadata, resource) - def createDeviceLiveToolsArpTable(self, serial: str, **kwargs): """ **Enqueue a job to perform a ARP table request for the device** @@ -467,75 +367,6 @@ def getDeviceLiveToolsCableTest(self, serial: str, id: str): return self._session.get(metadata, resource) - def getDeviceLiveToolsClientsDisconnect(self, serial: str, id: str): - """ - **Return a client disconnect job.** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-clients-disconnect - - - serial (string): Serial - - id (string): ID - """ - - metadata = { - "tags": ["devices", "liveTools", "clients", "disconnect"], - "operation": "getDeviceLiveToolsClientsDisconnect", - } - serial = urllib.parse.quote(str(serial), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/devices/{serial}/liveTools/clients/disconnect/{id}" - - return self._session.get(metadata, resource) - - def createDeviceLiveToolsDhcpLease(self, serial: str, **kwargs): - """ - **Enqueue a job to perform a DHCP leases request for the device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-dhcp-lease - - - serial (string): Serial - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["devices", "liveTools", "dhcpLeases"], - "operation": "createDeviceLiveToolsDhcpLease", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/dhcpLeases" - - body_params = [ - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsDhcpLease: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getDeviceLiveToolsDhcpLease(self, serial: str, dhcpLeasesId: str): - """ - **Return a DHCP leases live tool job.** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-dhcp-lease - - - serial (string): Serial - - dhcpLeasesId (string): Dhcp leases ID - """ - - metadata = { - "tags": ["devices", "liveTools", "dhcpLeases"], - "operation": "getDeviceLiveToolsDhcpLease", - } - serial = urllib.parse.quote(str(serial), safe="") - dhcpLeasesId = urllib.parse.quote(str(dhcpLeasesId), safe="") - resource = f"/devices/{serial}/liveTools/dhcpLeases/{dhcpLeasesId}" - - return self._session.get(metadata, resource) - def createDeviceLiveToolsLedsBlink(self, serial: str, duration: int, **kwargs): """ **Enqueue a job to blink LEDs on a device** @@ -692,56 +523,6 @@ def getDeviceLiveToolsMulticastRouting(self, serial: str, multicastRoutingId: st return self._session.get(metadata, resource) - def createDeviceLiveToolsOspfNeighbor(self, serial: str, **kwargs): - """ - **Enqueue a job to perform a OSPF neighbors request for the device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-ospf-neighbor - - - serial (string): Serial - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["devices", "liveTools", "ospfNeighbors"], - "operation": "createDeviceLiveToolsOspfNeighbor", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/ospfNeighbors" - - body_params = [ - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsOspfNeighbor: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getDeviceLiveToolsOspfNeighbor(self, serial: str, ospfNeighborsId: str): - """ - **Return an OSPF neighbors live tool job.** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-ospf-neighbor - - - serial (string): Serial - - ospfNeighborsId (string): Ospf neighbors ID - """ - - metadata = { - "tags": ["devices", "liveTools", "ospfNeighbors"], - "operation": "getDeviceLiveToolsOspfNeighbor", - } - serial = urllib.parse.quote(str(serial), safe="") - ospfNeighborsId = urllib.parse.quote(str(ospfNeighborsId), safe="") - resource = f"/devices/{serial}/liveTools/ospfNeighbors/{ospfNeighborsId}" - - return self._session.get(metadata, resource) - def createDeviceLiveToolsPing(self, serial: str, target: str, **kwargs): """ **Enqueue a job to ping a target host from the device** @@ -1000,89 +781,6 @@ def getDeviceLiveToolsPowerUsage(self, serial: str, jobId: str): return self._session.get(metadata, resource) - def createDeviceLiveToolsReboot(self, serial: str, **kwargs): - """ - **Enqueue a job to reboot a device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-reboot - - - serial (string): Serial - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["devices", "liveTools", "reboot"], - "operation": "createDeviceLiveToolsReboot", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/reboot" - - body_params = [ - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsReboot: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getDeviceLiveToolsReboot(self, serial: str, rebootId: str): - """ - **Return a reboot job** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-reboot - - - serial (string): Serial - - rebootId (string): Reboot ID - """ - - metadata = { - "tags": ["devices", "liveTools", "reboot"], - "operation": "getDeviceLiveToolsReboot", - } - serial = urllib.parse.quote(str(serial), safe="") - rebootId = urllib.parse.quote(str(rebootId), safe="") - resource = f"/devices/{serial}/liveTools/reboot/{rebootId}" - - return self._session.get(metadata, resource) - - def createDeviceLiveToolsRoutingTable(self, serial: str, **kwargs): - """ - **Enqueue a job to perform a routing table request for the device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-routing-table - - - serial (string): Serial - - destination (object): Optional destination filter used to return routes containing the supplied destination. - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["devices", "liveTools", "routingTable"], - "operation": "createDeviceLiveToolsRoutingTable", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/routingTable" - - body_params = [ - "destination", - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsRoutingTable: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - def createDeviceLiveToolsRoutingTableLookup(self, serial: str, **kwargs): """ **Enqueue a job to perform a routing table lookup request for a device** @@ -1215,81 +913,6 @@ def getDeviceLiveToolsRoutingTableSummary(self, serial: str, id: str): return self._session.get(metadata, resource) - def getDeviceLiveToolsRoutingTable(self, serial: str, id: str): - """ - **Return an routing table live tool job.** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-routing-table - - - serial (string): Serial - - id (string): ID - """ - - metadata = { - "tags": ["devices", "liveTools", "routingTable"], - "operation": "getDeviceLiveToolsRoutingTable", - } - serial = urllib.parse.quote(str(serial), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/devices/{serial}/liveTools/routingTable/{id}" - - return self._session.get(metadata, resource) - - def createDeviceLiveToolsSpeedTest(self, serial: str, **kwargs): - """ - **Enqueue a job to execute a speed test from a device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-speed-test - - - serial (string): Serial - - interface (string): Optional filter for a specific WAN interface. Valid interfaces are wan1, wan2, wan3, wan4. Default will return wan1. - """ - - kwargs.update(locals()) - - if "interface" in kwargs: - options = ["wan1", "wan2", "wan3", "wan4"] - assert kwargs["interface"] in options, ( - f'''"interface" cannot be "{kwargs["interface"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["devices", "liveTools", "speedTest"], - "operation": "createDeviceLiveToolsSpeedTest", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/speedTest" - - body_params = [ - "interface", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsSpeedTest: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getDeviceLiveToolsSpeedTest(self, serial: str, id: str): - """ - **Returns a speed test result in megabits per second** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-speed-test - - - serial (string): Serial - - id (string): ID - """ - - metadata = { - "tags": ["devices", "liveTools", "speedTest"], - "operation": "getDeviceLiveToolsSpeedTest", - } - serial = urllib.parse.quote(str(serial), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/devices/{serial}/liveTools/speedTest/{id}" - - return self._session.get(metadata, resource) - def createDeviceLiveToolsThroughputTest(self, serial: str, **kwargs): """ **Enqueue a job to test a device throughput, the test will run for 10 secs to test throughput** @@ -1340,110 +963,6 @@ def getDeviceLiveToolsThroughputTest(self, serial: str, throughputTestId: str): return self._session.get(metadata, resource) - def createDeviceLiveToolsTraceRoute(self, serial: str, target: str, sourceInterface: str, **kwargs): - """ - **Enqueue a job to run trace route in the device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-trace-route - - - serial (string): Serial - - target (string): Destination Host name or address - - sourceInterface (string): Source Interface IP address - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["devices", "liveTools", "traceRoute"], - "operation": "createDeviceLiveToolsTraceRoute", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/traceRoute" - - body_params = [ - "target", - "sourceInterface", - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsTraceRoute: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getDeviceLiveToolsTraceRoute(self, serial: str, traceRouteId: str): - """ - **Return a trace route job** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-trace-route - - - serial (string): Serial - - traceRouteId (string): Trace route ID - """ - - metadata = { - "tags": ["devices", "liveTools", "traceRoute"], - "operation": "getDeviceLiveToolsTraceRoute", - } - serial = urllib.parse.quote(str(serial), safe="") - traceRouteId = urllib.parse.quote(str(traceRouteId), safe="") - resource = f"/devices/{serial}/liveTools/traceRoute/{traceRouteId}" - - return self._session.get(metadata, resource) - - def createDeviceLiveToolsVrrpTable(self, serial: str, **kwargs): - """ - **Enqueue a job to perform a VRRP table request for the device** - https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-vrrp-table - - - serial (string): Serial - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["devices", "liveTools", "vrrpTable"], - "operation": "createDeviceLiveToolsVrrpTable", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/liveTools/vrrpTable" - - body_params = [ - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createDeviceLiveToolsVrrpTable: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getDeviceLiveToolsVrrpTable(self, serial: str, vrrpTableId: str): - """ - **Return an VRRP table live tool job.** - https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-vrrp-table - - - serial (string): Serial - - vrrpTableId (string): Vrrp table ID - """ - - metadata = { - "tags": ["devices", "liveTools", "vrrpTable"], - "operation": "getDeviceLiveToolsVrrpTable", - } - serial = urllib.parse.quote(str(serial), safe="") - vrrpTableId = urllib.parse.quote(str(vrrpTableId), safe="") - resource = f"/devices/{serial}/liveTools/vrrpTable/{vrrpTableId}" - - return self._session.get(metadata, resource) - def createDeviceLiveToolsWakeOnLan(self, serial: str, vlanId: int, mac: str, **kwargs): """ **Enqueue a job to send a Wake-on-LAN packet from the device** diff --git a/meraki/api/insight.py b/meraki/api/insight.py index 08b7cb4..79b0283 100644 --- a/meraki/api/insight.py +++ b/meraki/api/insight.py @@ -64,95 +64,6 @@ def getOrganizationInsightApplications(self, organizationId: str): return self._session.get(metadata, resource) - def createOrganizationInsightApplication(self, organizationId: str, counterSetRuleId: int, **kwargs): - """ - **Add an Insight tracked application** - https://developer.cisco.com/meraki/api-v1/#!create-organization-insight-application - - - organizationId (string): Organization ID - - counterSetRuleId (integer): The id of the counter set rule - - enableSmartThresholds (boolean): Enable Smart Thresholds - - thresholds (object): Thresholds defined by a user for each application - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["insight", "configure", "applications"], - "operation": "createOrganizationInsightApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/insight/applications" - - body_params = [ - "counterSetRuleId", - "enableSmartThresholds", - "thresholds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationInsightApplication: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def updateOrganizationInsightApplication(self, organizationId: str, applicationId: str, **kwargs): - """ - **Update an Insight tracked application** - https://developer.cisco.com/meraki/api-v1/#!update-organization-insight-application - - - organizationId (string): Organization ID - - applicationId (string): Application ID - - enableSmartThresholds (boolean): Enable Smart Thresholds - - thresholds (object): Thresholds defined by a user for each application - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["insight", "configure", "applications"], - "operation": "updateOrganizationInsightApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - applicationId = urllib.parse.quote(str(applicationId), safe="") - resource = f"/organizations/{organizationId}/insight/applications/{applicationId}" - - body_params = [ - "enableSmartThresholds", - "thresholds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationInsightApplication: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationInsightApplication(self, organizationId: str, applicationId: str): - """ - **Delete an Insight tracked application** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-insight-application - - - organizationId (string): Organization ID - - applicationId (string): Application ID - """ - - metadata = { - "tags": ["insight", "configure", "applications"], - "operation": "deleteOrganizationInsightApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - applicationId = urllib.parse.quote(str(applicationId), safe="") - resource = f"/organizations/{organizationId}/insight/applications/{applicationId}" - - return self._session.delete(metadata, resource) - def getOrganizationInsightMonitoredMediaServers(self, organizationId: str): """ **List the monitored media servers for this organization** @@ -283,154 +194,3 @@ def deleteOrganizationInsightMonitoredMediaServer(self, organizationId: str, mon resource = f"/organizations/{organizationId}/insight/monitoredMediaServers/{monitoredMediaServerId}" return self._session.delete(metadata, resource) - - def getOrganizationInsightSpeedTestResults(self, organizationId: str, serials: list, **kwargs): - """ - **List the speed tests for the given devices under this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-insight-speed-test-results - - - organizationId (string): Organization ID - - serials (array): A list of serial numbers. The returned results will be filtered to only include these serials. - - timespan (integer): Amount of seconds ago to query for results. Only include timespan OR both t0 & t1. - - t0 (integer): Start time to query for results in epoch seconds. Only include timespan OR both t0 & t1. - - t1 (integer): End time to query for results in epoch seconds. Only include timespan OR both t0 & t1. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["insight", "configure", "speedTestResults"], - "operation": "getOrganizationInsightSpeedTestResults", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/insight/speedTestResults" - - query_params = [ - "serials", - "timespan", - "t0", - "t1", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationInsightSpeedTestResults: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationInsightWebApps(self, organizationId: str): - """ - **Lists all default web applications rules with counter set rule ids** - https://developer.cisco.com/meraki/api-v1/#!get-organization-insight-web-apps - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["insight", "configure", "webApps"], - "operation": "getOrganizationInsightWebApps", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/insight/webApps" - - return self._session.get(metadata, resource) - - def createOrganizationInsightWebApp(self, organizationId: str, name: str, hostname: str, **kwargs): - """ - **Add a custom web application for Insight to be able to track** - https://developer.cisco.com/meraki/api-v1/#!create-organization-insight-web-app - - - organizationId (string): Organization ID - - name (string): The name of the Web Application - - hostname (string): The hostname of Web Application - """ - - kwargs = locals() - - metadata = { - "tags": ["insight", "configure", "webApps"], - "operation": "createOrganizationInsightWebApp", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/insight/webApps" - - body_params = [ - "name", - "hostname", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationInsightWebApp: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def updateOrganizationInsightWebApp(self, organizationId: str, customCounterSetRuleId: str, **kwargs): - """ - **Update a custom web application for Insight to be able to track** - https://developer.cisco.com/meraki/api-v1/#!update-organization-insight-web-app - - - organizationId (string): Organization ID - - customCounterSetRuleId (string): Custom counter set rule ID - - name (string): The name of the Web Application - - hostname (string): The hostname of Web Application - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["insight", "configure", "webApps"], - "operation": "updateOrganizationInsightWebApp", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - customCounterSetRuleId = urllib.parse.quote(str(customCounterSetRuleId), safe="") - resource = f"/organizations/{organizationId}/insight/webApps/{customCounterSetRuleId}" - - body_params = [ - "name", - "hostname", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationInsightWebApp: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationInsightWebApp(self, organizationId: str, customCounterSetRuleId: str): - """ - **Delete a custom web application by counter set rule id.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-insight-web-app - - - organizationId (string): Organization ID - - customCounterSetRuleId (string): Custom counter set rule ID - """ - - metadata = { - "tags": ["insight", "configure", "webApps"], - "operation": "deleteOrganizationInsightWebApp", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - customCounterSetRuleId = urllib.parse.quote(str(customCounterSetRuleId), safe="") - resource = f"/organizations/{organizationId}/insight/webApps/{customCounterSetRuleId}" - - return self._session.delete(metadata, resource) diff --git a/meraki/api/licensing.py b/meraki/api/licensing.py index 5911aa6..df89824 100644 --- a/meraki/api/licensing.py +++ b/meraki/api/licensing.py @@ -45,39 +45,6 @@ def getAdministeredLicensingSubscriptionEntitlements(self, **kwargs): return self._session.get(metadata, resource, params) - def batchAdministeredLicensingSubscriptionNetworksFeatureTiersUpdate(self, **kwargs): - """ - **Batch change networks to their desired feature tier for specified product types** - https://developer.cisco.com/meraki/api-v1/#!batch-administered-licensing-subscription-networks-feature-tiers-update - - - items (array): List of networks and corresponding product types to update. Maximum 500 networks - - isAtomic (boolean): Flag to determine if the operation should act atomically - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["licensing", "configure", "subscription", "featureTiers"], - "operation": "batchAdministeredLicensingSubscriptionNetworksFeatureTiersUpdate", - } - resource = "/administered/licensing/subscription/networks/featureTiers/batchUpdate" - - body_params = [ - "items", - "isAtomic", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"batchAdministeredLicensingSubscriptionNetworksFeatureTiersUpdate: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - def getAdministeredLicensingSubscriptionSubscriptions( self, organizationIds: list, total_pages=1, direction="next", **kwargs ): diff --git a/meraki/api/nac.py b/meraki/api/nac.py deleted file mode 100644 index 067cc48..0000000 --- a/meraki/api/nac.py +++ /dev/null @@ -1,1151 +0,0 @@ -import urllib - - -class Nac(object): - def __init__(self, session): - super(Nac, self).__init__() - self._session = session - - def getOrganizationNacAuthorizationPolicies(self, organizationId: str, **kwargs): - """ - **Get all nac authorization policies for this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-authorization-policies - - - organizationId (string): Organization ID - - policyIds (array): List of ids for specific authorization policies retrieval - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "authorization", "policies"], - "operation": "getOrganizationNacAuthorizationPolicies", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/authorization/policies" - - query_params = [ - "policyIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "policyIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationNacAuthorizationPolicies: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def createOrganizationNacAuthorizationPolicyRule( - self, organizationId: str, policyId: str, name: str, rank: int, authorizationProfile: dict, **kwargs - ): - """ - **Create a rule in an authorization policy set of an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-authorization-policy-rule - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - name (string): Name of Authorization rule - - rank (integer): Rank of Authorization rule - - authorizationProfile (object): Authorization profile associated with the rule - - enabled (boolean): Enabled status of authorization rule. Default is False. - - sourcePolicyVersion (string): Source policy version of the policy set containing this rule - - condition (object): Condition of Authorization rule. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "authorization", "policies", "rules"], - "operation": "createOrganizationNacAuthorizationPolicyRule", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - resource = f"/organizations/{organizationId}/nac/authorization/policies/{policyId}/rules" - - body_params = [ - "name", - "rank", - "enabled", - "sourcePolicyVersion", - "authorizationProfile", - "condition", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationNacAuthorizationPolicyRule: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationNacAuthorizationPolicyRule( - self, organizationId: str, policyId: str, ruleId: str, name: str, rank: int, authorizationProfile: dict, **kwargs - ): - """ - **Update an existing rule of an authorization policy set within an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-nac-authorization-policy-rule - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleId (string): Rule ID - - name (string): Name of Authorization rule - - rank (integer): Rank of Authorization rule - - authorizationProfile (object): Authorization profile associated with the rule - - enabled (boolean): Enabled status of authorization rule. Default is False. - - sourcePolicyVersion (string): Source policy version of the policy set containing this rule - - condition (object): Condition of Authorization rule. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "authorization", "policies", "rules"], - "operation": "updateOrganizationNacAuthorizationPolicyRule", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleId = urllib.parse.quote(str(ruleId), safe="") - resource = f"/organizations/{organizationId}/nac/authorization/policies/{policyId}/rules/{ruleId}" - - body_params = [ - "name", - "rank", - "enabled", - "sourcePolicyVersion", - "authorizationProfile", - "condition", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationNacAuthorizationPolicyRule: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationNacAuthorizationPolicyRule(self, organizationId: str, policyId: str, ruleId: str, **kwargs): - """ - **Delete a rule in an authorization policy set of an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-nac-authorization-policy-rule - - - organizationId (string): Organization ID - - policyId (string): Policy ID - - ruleId (string): Rule ID - - sourcePolicyVersion (string): Source policy version of the policy set containing this rule - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "authorization", "policies", "rules"], - "operation": "deleteOrganizationNacAuthorizationPolicyRule", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - policyId = urllib.parse.quote(str(policyId), safe="") - ruleId = urllib.parse.quote(str(ruleId), safe="") - resource = f"/organizations/{organizationId}/nac/authorization/policies/{policyId}/rules/{ruleId}" - - return self._session.delete(metadata, resource) - - def getOrganizationNacCertificates(self, organizationId: str, **kwargs): - """ - **Gets all certificates for an organization and can filter by certificate status, expiry date and last used date** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-certificates - - - organizationId (string): Organization ID - - status (string): Status Parameter for GetAll request - - expiry (boolean): Boolean indicating whether to filter by expiry in one month - - lastUsed (boolean): Boolean indicating whether to filter by last used in over one month - """ - - kwargs.update(locals()) - - if "status" in kwargs: - options = ["Disabled", "Enabled"] - assert kwargs["status"] in options, ( - f'''"status" cannot be "{kwargs["status"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["nac", "configure", "certificates"], - "operation": "getOrganizationNacCertificates", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates" - - query_params = [ - "status", - "expiry", - "lastUsed", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationNacCertificates: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def getOrganizationNacCertificatesAuthoritiesCrls(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get all the organization's CRL.It's possible to filter results by CRL issuers (CA) or CRL's ID - see caIds and crlIds query parameters.This endpoint could be used for 'show' action when you specify a single CRL ID in crlIds parameter** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-certificates-authorities-crls - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 5. - - 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. - - sortBy (string): Optional parameter to specify the field used to sort results. (default: caId) - - sortOrder (string): Optional parameter to specify the sort order. (default: asc) - - crlIds (array): A list of CRL ids. The returned CRLs will be filtered to only include these ids - - caIds (array): When ca Ids are provided, only CRLs associated to the given CA will be returned. Otherwise, all the CRLs created for an organization will be returned. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["caId", "createdAt", "lastUpdatedAt"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["nac", "configure", "certificates", "authorities", "crls"], - "operation": "getOrganizationNacCertificatesAuthoritiesCrls", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/authorities/crls" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "sortBy", - "sortOrder", - "crlIds", - "caIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "crlIds", - "caIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationNacCertificatesAuthoritiesCrls: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationNacCertificatesAuthoritiesCrl( - self, organizationId: str, caId: str, content: str, isDelta: bool, **kwargs - ): - """ - **Create a new CRL (either base or delta) for an existing CA** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-certificates-authorities-crl - - - organizationId (string): Organization ID - - caId (string): ID of the CRL issuer - - content (string): CRL content in PEM format - - isDelta (boolean): Whether it's a delta CRL or not - """ - - kwargs = locals() - - metadata = { - "tags": ["nac", "configure", "certificates", "authorities", "crls"], - "operation": "createOrganizationNacCertificatesAuthoritiesCrl", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/authorities/crls" - - body_params = [ - "caId", - "content", - "isDelta", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationNacCertificatesAuthoritiesCrl: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationNacCertificatesAuthoritiesCrlsDescriptors( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get all the organization's CRL descriptors (metadata only - revocation list data is excluded)** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-certificates-authorities-crls-descriptors - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 20. - - 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. - - sortBy (string): Optional parameter to specify the field used to sort results. (default: caId) - - sortOrder (string): Optional parameter to specify the sort order. (default: asc) - - caIds (array): When ca Ids are provided, only CRLs associated to the given CA will be returned. Otherwise, all the CRLs created for an organization will be returned. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["caId", "createdAt", "lastUpdatedAt"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["nac", "configure", "certificates", "authorities", "crls", "descriptors"], - "operation": "getOrganizationNacCertificatesAuthoritiesCrlsDescriptors", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/authorities/crls/descriptors" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "sortBy", - "sortOrder", - "caIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "caIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationNacCertificatesAuthoritiesCrlsDescriptors: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def deleteOrganizationNacCertificatesAuthoritiesCrl(self, organizationId: str, crlId: str): - """ - **Deletes a whole CRL, including all its deltas (in case of base CRL removal)** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-nac-certificates-authorities-crl - - - organizationId (string): Organization ID - - crlId (string): Crl ID - """ - - metadata = { - "tags": ["nac", "configure", "certificates", "authorities", "crls"], - "operation": "deleteOrganizationNacCertificatesAuthoritiesCrl", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - crlId = urllib.parse.quote(str(crlId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/authorities/crls/{crlId}" - - return self._session.delete(metadata, resource) - - def createOrganizationNacCertificatesImport(self, organizationId: str, contents: str, **kwargs): - """ - **Import certificate for this organization or validate without persisting** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-certificates-import - - - organizationId (string): Organization ID - - contents (string): Certificate content in valid PEM format - - dryRun (boolean): If true, validates the certificate without persisting it - - profile (object): Profile object containing certificate config fields - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "certificates", "import"], - "operation": "createOrganizationNacCertificatesImport", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/import" - - body_params = [ - "contents", - "dryRun", - "profile", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationNacCertificatesImport: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationNacCertificatesOverview(self, organizationId: str): - """ - **Get counts of Enabled, Disabled, Expired and Last Used certificates for this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-certificates-overview - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["nac", "configure", "certificates", "overview"], - "operation": "getOrganizationNacCertificatesOverview", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/overview" - - return self._session.get(metadata, resource) - - def updateOrganizationNacCertificate(self, organizationId: str, certificateId: str, profile: dict, **kwargs): - """ - **Update certificate configuration by certificateId for this organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-nac-certificate - - - organizationId (string): Organization ID - - certificateId (string): Certificate ID - - profile (object): Profile object containing certificate config fields - """ - - kwargs = locals() - - metadata = { - "tags": ["nac", "configure", "certificates"], - "operation": "updateOrganizationNacCertificate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - certificateId = urllib.parse.quote(str(certificateId), safe="") - resource = f"/organizations/{organizationId}/nac/certificates/{certificateId}" - - body_params = [ - "profile", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationNacCertificate: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getOrganizationNacClients(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get all known clients for the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-clients - - - 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 - - sortOrder (string): Query parameter for specifying the direction of sorting to use for the given sortKey. - - sortKey (string): Query parameter to sort the clients by the value of the specified key. - - 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. - - search (string): Optional parameter to fuzzy search on clients. - - clientIds (array): List of ids for specific client retrieval - - groupIds (array): List of group ids for client retrieval by group - - lastNetworkName (array): List of network names for client retrieval by last login network name - - ssid (array): List of SSID's to filter - - classification (object): Classification filters for client retrieval - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["ASC", "DESC"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - if "sortKey" in kwargs: - options = ["mac"] - assert kwargs["sortKey"] in options, ( - f'''"sortKey" cannot be "{kwargs["sortKey"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["nac", "configure", "clients"], - "operation": "getOrganizationNacClients", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients" - - query_params = [ - "sortOrder", - "sortKey", - "perPage", - "startingAfter", - "endingBefore", - "search", - "clientIds", - "groupIds", - "lastNetworkName", - "ssid", - "classification", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "clientIds", - "groupIds", - "lastNetworkName", - "ssid", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationNacClients: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationNacClient(self, organizationId: str, mac: str, **kwargs): - """ - **Create a client for the organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-client - - - organizationId (string): Organization ID - - mac (string): The MAC address of the client - - type (string): Type describes if the network client belongs to an individual user or corporate - - owner (string): The username of the owner of the client - - description (string): User provided description for the client - - uuid (string): Universally unique identifier of the client - - userDetails (array): List of users of this network client - - oui (object): Organizationally unique identifier assigned to a vendor of the client - - groups (array): List of group members associated with the client - """ - - kwargs.update(locals()) - - if "type" in kwargs: - options = ["BYOD", "corporate"] - assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["nac", "configure", "clients"], - "operation": "createOrganizationNacClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients" - - body_params = [ - "type", - "owner", - "mac", - "description", - "uuid", - "userDetails", - "oui", - "groups", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationNacClient: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def bulkOrganizationNacClientsDelete(self, organizationId: str, clientIds: list, **kwargs): - """ - **Delete existing client(s) for the organization** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-nac-clients-delete - - - organizationId (string): Organization ID - - clientIds (array): List of ids for specific client retrieval - """ - - kwargs = locals() - - metadata = { - "tags": ["nac", "configure", "clients"], - "operation": "bulkOrganizationNacClientsDelete", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/bulkDelete" - - body_params = [ - "clientIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"bulkOrganizationNacClientsDelete: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def createOrganizationNacClientsBulkEdit(self, organizationId: str, clientIds: list, **kwargs): - """ - **Bulk Update of existing clients for the organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-clients-bulk-edit - - - organizationId (string): Organization ID - - clientIds (array): List of clients ids to apply the bulk edit operation on. - - description (string): User provided description to be applied on the list of clients provided - - groups (object): Client group information to be applied on the list of clients provided - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "clients", "bulkEdit"], - "operation": "createOrganizationNacClientsBulkEdit", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/bulkEdit" - - body_params = [ - "clientIds", - "description", - "groups", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationNacClientsBulkEdit: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def createOrganizationNacClientsBulkUpload( - self, organizationId: str, contents: str, updateClients: bool, createClientGroups: bool, **kwargs - ): - """ - **Bulk upload of clients, client groups and their associations for the organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-clients-bulk-upload - - - organizationId (string): Organization ID - - contents (string): CSV file content in Base64 encoded string format - - updateClients (boolean): The updateClients indicates whether existing clients must be updated with new data from the CSV - - createClientGroups (boolean): The createClientGroups indicates whether new client groups must be created or not - """ - - kwargs = locals() - - metadata = { - "tags": ["nac", "configure", "clients", "bulkUpload"], - "operation": "createOrganizationNacClientsBulkUpload", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/bulkUpload" - - body_params = [ - "contents", - "updateClients", - "createClientGroups", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationNacClientsBulkUpload: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationNacClientsGroups(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get all known client groups for the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-clients-groups - - - 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 - - sortOrder (string): Query parameter for specifying the direction of sorting to use for the given sortKey. - - sortKey (string): Query parameter to sort the client groups by the value of the specified key. - - 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. - - search (string): Optional parameter to fuzzy search on client groups. - - groupIds (array): List of ids for specific group retrieval - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["ASC", "DESC"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - if "sortKey" in kwargs: - options = ["name"] - assert kwargs["sortKey"] in options, ( - f'''"sortKey" cannot be "{kwargs["sortKey"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["nac", "configure", "clients", "groups"], - "operation": "getOrganizationNacClientsGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/groups" - - query_params = [ - "sortOrder", - "sortKey", - "perPage", - "startingAfter", - "endingBefore", - "search", - "groupIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "groupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationNacClientsGroups: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationNacClientsGroup(self, organizationId: str, name: str, **kwargs): - """ - **Create a client group for the organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-nac-clients-group - - - organizationId (string): Organization ID - - name (string): The name of the group for access control model - - description (string): User provided description of the group - - members (array): List of client members associated with the group - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "clients", "groups"], - "operation": "createOrganizationNacClientsGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/groups" - - body_params = [ - "name", - "description", - "members", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationNacClientsGroup: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def updateOrganizationNacClientsGroup(self, organizationId: str, groupId: str, **kwargs): - """ - **Update an existing client group for the organization with bulk member operations** - https://developer.cisco.com/meraki/api-v1/#!update-organization-nac-clients-group - - - organizationId (string): Organization ID - - groupId (string): Group ID - - name (string): The name of the group for access control model - - description (string): User provided description of the group - - members (object): Bulk member operations with addList/removeList arrays - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "clients", "groups"], - "operation": "updateOrganizationNacClientsGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/groups/{groupId}" - - body_params = [ - "name", - "description", - "members", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationNacClientsGroup: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationNacClientsGroup(self, organizationId: str, groupId: str): - """ - **Delete an existing client group for the organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-nac-clients-group - - - organizationId (string): Organization ID - - groupId (string): Group ID - """ - - metadata = { - "tags": ["nac", "configure", "clients", "groups"], - "operation": "deleteOrganizationNacClientsGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/groups/{groupId}" - - return self._session.delete(metadata, resource) - - def getOrganizationNacClientsOverview(self, organizationId: str): - """ - **Get overview data for all known clients for the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-clients-overview - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["nac", "configure", "clients", "overview"], - "operation": "getOrganizationNacClientsOverview", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/overview" - - return self._session.get(metadata, resource) - - def updateOrganizationNacClient(self, organizationId: str, clientId: str, mac: str, **kwargs): - """ - **Update an existing client for the organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-nac-client - - - organizationId (string): Organization ID - - clientId (string): Client ID - - mac (string): The MAC address of the client - - type (string): Type describes if the network client belongs to an individual user or corporate - - owner (string): The username of the owner of the client - - description (string): User provided description for the client - - uuid (string): Universally unique identifier of the client - - userDetails (array): List of users of this network client - - oui (object): Organizationally unique identifier assigned to a vendor of the client - - groups (object): Client group membership changes - """ - - kwargs.update(locals()) - - if "type" in kwargs: - options = ["BYOD", "corporate"] - assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["nac", "configure", "clients"], - "operation": "updateOrganizationNacClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - clientId = urllib.parse.quote(str(clientId), safe="") - resource = f"/organizations/{organizationId}/nac/clients/{clientId}" - - body_params = [ - "type", - "owner", - "mac", - "description", - "uuid", - "userDetails", - "oui", - "groups", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationNacClient: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getOrganizationNacDictionaries(self, organizationId: str): - """ - **Get all NAC dictionaries** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-dictionaries - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["nac", "configure", "dictionaries"], - "operation": "getOrganizationNacDictionaries", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/dictionaries" - - return self._session.get(metadata, resource) - - def getOrganizationNacDictionaryAttributes(self, organizationId: str, dictionaryId: str, **kwargs): - """ - **Get all attributes by dictionary ID** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-dictionary-attributes - - - organizationId (string): Organization ID - - dictionaryId (string): Dictionary ID - - networkIds (array): An optional list of network IDs to filter the 'enum' field. Only enum values applicable to the specified networks will be returned. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "dictionaries", "attributes"], - "operation": "getOrganizationNacDictionaryAttributes", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - dictionaryId = urllib.parse.quote(str(dictionaryId), safe="") - resource = f"/organizations/{organizationId}/nac/dictionaries/{dictionaryId}/attributes" - - query_params = [ - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationNacDictionaryAttributes: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationNacDictionaryAttributeValues( - self, organizationId: str, dictionaryId: str, attributeName: str, **kwargs - ): - """ - **Search allowed values for a dictionary attribute** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-dictionary-attribute-values - - - organizationId (string): Organization ID - - dictionaryId (string): Dictionary ID - - attributeName (string): Attribute name - - search (string): Optional search string for contains-match filtering of allowed values - - networkIds (array): An optional list of network IDs to filter the allowed values. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "dictionaries", "attributes", "values"], - "operation": "getOrganizationNacDictionaryAttributeValues", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - dictionaryId = urllib.parse.quote(str(dictionaryId), safe="") - attributeName = urllib.parse.quote(str(attributeName), safe="") - resource = f"/organizations/{organizationId}/nac/dictionaries/{dictionaryId}/attributes/{attributeName}/values" - - query_params = [ - "search", - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationNacDictionaryAttributeValues: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationNacLicenseUsage(self, organizationId: str, startDate: str, **kwargs): - """ - **Returns license usage data for a specific organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-license-usage - - - organizationId (string): Organization ID - - startDate (string): Start date for the usage data in UTC timezone - - endDate (string): End date for the usage data in UTC timezone - - networkIds (array): List of locale and node group ids - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["nac", "configure", "license", "usage"], - "operation": "getOrganizationNacLicenseUsage", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/license/usage" - - query_params = [ - "startDate", - "endDate", - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationNacLicenseUsage: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def getOrganizationNacSessionsHistory(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the NAC Sessions for this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-sessions-history - - - 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 - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is 1 hour. - - 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": ["nac", "configure", "sessions", "history"], - "operation": "getOrganizationNacSessionsHistory", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/nac/sessions/history" - - query_params = [ - "t0", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationNacSessionsHistory: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationNacSessionDetails(self, organizationId: str, sessionId: str): - """ - **Return the details of selected NAC Sessions** - https://developer.cisco.com/meraki/api-v1/#!get-organization-nac-session-details - - - organizationId (string): Organization ID - - sessionId (string): Session ID - """ - - metadata = { - "tags": ["nac", "configure", "sessions", "details"], - "operation": "getOrganizationNacSessionDetails", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - sessionId = urllib.parse.quote(str(sessionId), safe="") - resource = f"/organizations/{organizationId}/nac/sessions/{sessionId}/details" - - return self._session.get(metadata, resource) diff --git a/meraki/api/networks.py b/meraki/api/networks.py index 7310750..c1858a7 100644 --- a/meraki/api/networks.py +++ b/meraki/api/networks.py @@ -855,23 +855,6 @@ def vmxNetworkDevicesClaim(self, networkId: str, size: str, **kwargs): return self._session.post(metadata, resource, payload) - def getNetworkDevicesJson(self, networkId: str): - """ - **Extraction of the legacy nodes JSON endpoint for a network** - https://developer.cisco.com/meraki/api-v1/#!get-network-devices-json - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["networks", "configure", "devices", "json"], - "operation": "getNetworkDevicesJson", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/devices/json" - - return self._session.get(metadata, resource) - def removeNetworkDevices(self, networkId: str, serial: str, **kwargs): """ **Remove a single device** @@ -1503,7 +1486,6 @@ def createNetworkFloorPlan(self, networkId: str, name: str, imageContents: str, - topLeftCorner (object): The longitude and latitude of the top left corner of your floor plan. - topRightCorner (object): The longitude and latitude of the top right corner of your floor plan. - floorNumber (number): The floor number of the floors within the building - - buildingId (string): The ID of the building that this floor belongs to. """ kwargs.update(locals()) @@ -1523,7 +1505,6 @@ def createNetworkFloorPlan(self, networkId: str, name: str, imageContents: str, "topLeftCorner", "topRightCorner", "floorNumber", - "buildingId", "imageContents", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1720,7 +1701,6 @@ def updateNetworkFloorPlan(self, networkId: str, floorPlanId: str, **kwargs): - topLeftCorner (object): The longitude and latitude of the top left corner of your floor plan. - topRightCorner (object): The longitude and latitude of the top right corner of your floor plan. - floorNumber (number): The floor number of the floors within the building - - buildingId (string): The ID of the building that this floor belongs to. - imageContents (string): The file contents (a base 64 encoded string) of your new image. Supported formats are PNG, GIF, and JPG. Note that all images are saved as PNG files, regardless of the format they are uploaded in. If you upload a new image, and you do NOT specify any new geolocation fields ('center, 'topLeftCorner', etc), the floor plan will be recentered with no rotation in order to maintain the aspect ratio of your new image. """ @@ -1742,7 +1722,6 @@ def updateNetworkFloorPlan(self, networkId: str, floorPlanId: str, **kwargs): "topLeftCorner", "topRightCorner", "floorNumber", - "buildingId", "imageContents", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1970,106 +1949,6 @@ def getNetworkHealthAlerts(self, networkId: str): return self._session.get(metadata, resource) - def getNetworkLocationScanning(self, networkId: str): - """ - **Return scanning API settings** - https://developer.cisco.com/meraki/api-v1/#!get-network-location-scanning - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["networks", "configure", "locationScanning"], - "operation": "getNetworkLocationScanning", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/locationScanning" - - return self._session.get(metadata, resource) - - def updateNetworkLocationScanning(self, networkId: str, **kwargs): - """ - **Change scanning API settings** - https://developer.cisco.com/meraki/api-v1/#!update-network-location-scanning - - - networkId (string): Network ID - - analyticsEnabled (boolean): Collect location and scanning analytics - - scanningApiEnabled (boolean): Enable push API for scanning events, analytics must be enabled - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["networks", "configure", "locationScanning"], - "operation": "updateNetworkLocationScanning", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/locationScanning" - - body_params = [ - "analyticsEnabled", - "scanningApiEnabled", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkLocationScanning: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getNetworkLocationScanningHttpServers(self, networkId: str): - """ - **Return list of scanning API receivers** - https://developer.cisco.com/meraki/api-v1/#!get-network-location-scanning-http-servers - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["networks", "configure", "locationScanning", "httpServers"], - "operation": "getNetworkLocationScanningHttpServers", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/locationScanning/httpServers" - - return self._session.get(metadata, resource) - - def updateNetworkLocationScanningHttpServers(self, networkId: str, endpoints: list, **kwargs): - """ - **Set the list of scanning API receivers** - https://developer.cisco.com/meraki/api-v1/#!update-network-location-scanning-http-servers - - - networkId (string): Network ID - - endpoints (array): A set of http server configurations - """ - - kwargs = locals() - - metadata = { - "tags": ["networks", "configure", "locationScanning", "httpServers"], - "operation": "updateNetworkLocationScanningHttpServers", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/locationScanning/httpServers" - - body_params = [ - "endpoints", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateNetworkLocationScanningHttpServers: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - def getNetworkMerakiAuthUsers(self, networkId: str): """ **List the authorized users configured under Meraki Authentication for a network (splash guest or RADIUS users for a wireless network, or client VPN users for a MX network)** @@ -2227,17 +2106,14 @@ def updateNetworkMerakiAuthUser(self, networkId: str, merakiAuthUserId: str, **k return self._session.put(metadata, resource, payload) - def getNetworkMqttBrokers(self, networkId: str, **kwargs): + def getNetworkMqttBrokers(self, networkId: str): """ **List the MQTT brokers for this network** https://developer.cisco.com/meraki/api-v1/#!get-network-mqtt-brokers - networkId (string): Network ID - - productTypes (array): Optional parameter to filter MQTT brokers by product type. If multiple types are provided, the query will return brokers that match any of the provided types. """ - kwargs.update(locals()) - metadata = { "tags": ["networks", "configure", "mqttBrokers"], "operation": "getNetworkMqttBrokers", @@ -2245,26 +2121,7 @@ def getNetworkMqttBrokers(self, networkId: str, **kwargs): networkId = urllib.parse.quote(str(networkId), safe="") resource = f"/networks/{networkId}/mqttBrokers" - query_params = [ - "productTypes", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "productTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getNetworkMqttBrokers: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) + return self._session.get(metadata, resource) def createNetworkMqttBroker(self, networkId: str, name: str, host: str, port: int, **kwargs): """ @@ -2277,17 +2134,10 @@ def createNetworkMqttBroker(self, networkId: str, name: str, host: str, port: in - port (integer): Host port though which the MQTT broker can be reached. - security (object): Security settings of the MQTT broker. - authentication (object): Authentication settings of the MQTT broker - - productType (string): The product type for which the MQTT broker is being created. """ kwargs.update(locals()) - if "productType" in kwargs: - options = ["camera", "wireless"] - assert kwargs["productType"] in options, ( - f'''"productType" cannot be "{kwargs["productType"]}", & must be set to one of: {options}''' - ) - metadata = { "tags": ["networks", "configure", "mqttBrokers"], "operation": "createNetworkMqttBroker", @@ -2301,7 +2151,6 @@ def createNetworkMqttBroker(self, networkId: str, name: str, host: str, port: in "port", "security", "authentication", - "productType", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2788,7 +2637,6 @@ def updateNetworkSettings(self, networkId: str, **kwargs): - remoteStatusPageEnabled (boolean): Enables / disables access to the device status page (http://[device's LAN IP]). Optional. Can only be set if localStatusPageEnabled is set to true - localStatusPage (object): A hash of Local Status page(s)' authentication options applied to the Network. - securePort (object): A hash of SecureConnect options applied to the Network. - - fips (object): A hash of FIPS options applied to the Network - namedVlans (object): A hash of Named VLANs options applied to the Network. """ @@ -2806,7 +2654,6 @@ def updateNetworkSettings(self, networkId: str, **kwargs): "remoteStatusPageEnabled", "localStatusPage", "securePort", - "fips", "namedVlans", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2819,93 +2666,6 @@ def updateNetworkSettings(self, networkId: str, **kwargs): return self._session.put(metadata, resource, payload) - def createNetworkSitesBuilding(self, networkId: str, name: str, **kwargs): - """ - **Create a new building** - https://developer.cisco.com/meraki/api-v1/#!create-network-sites-building - - - networkId (string): Network ID - - name (string): The name of the building - - floors (array): The floors of the building - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["networks", "configure", "sites", "buildings"], - "operation": "createNetworkSitesBuilding", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sites/buildings" - - body_params = [ - "name", - "floors", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createNetworkSitesBuilding: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def deleteNetworkSitesBuilding(self, networkId: str, buildingId: str): - """ - **Delete a building** - https://developer.cisco.com/meraki/api-v1/#!delete-network-sites-building - - - networkId (string): Network ID - - buildingId (string): Building ID - """ - - metadata = { - "tags": ["networks", "configure", "sites", "buildings"], - "operation": "deleteNetworkSitesBuilding", - } - networkId = urllib.parse.quote(str(networkId), safe="") - buildingId = urllib.parse.quote(str(buildingId), safe="") - resource = f"/networks/{networkId}/sites/buildings/{buildingId}" - - return self._session.delete(metadata, resource) - - def updateNetworkSitesBuilding(self, networkId: str, buildingId: str, **kwargs): - """ - **Update a building** - https://developer.cisco.com/meraki/api-v1/#!update-network-sites-building - - - networkId (string): Network ID - - buildingId (string): Building ID - - name (string): The name of the building - - floors (array): The floors of the building - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["networks", "configure", "sites", "buildings"], - "operation": "updateNetworkSitesBuilding", - } - networkId = urllib.parse.quote(str(networkId), safe="") - buildingId = urllib.parse.quote(str(buildingId), safe="") - resource = f"/networks/{networkId}/sites/buildings/{buildingId}" - - body_params = [ - "name", - "floors", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkSitesBuilding: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def getNetworkSnmp(self, networkId: str): """ **Return the SNMP settings for a network** @@ -2968,47 +2728,6 @@ def updateNetworkSnmp(self, networkId: str, **kwargs): return self._session.put(metadata, resource, payload) - def updateNetworkSnmpTraps(self, networkId: str, **kwargs): - """ - **Update the SNMP trap configuration for the specified network** - https://developer.cisco.com/meraki/api-v1/#!update-network-snmp-traps - - - networkId (string): Network ID - - mode (string): SNMP trap protocol version - - receiver (object): Stores the port and address - - v2 (object): V2 mode - - v3 (object): V3 mode - """ - - kwargs.update(locals()) - - if "mode" in kwargs: - options = ["disabled", "v1/v2c", "v3"] - assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["networks", "configure", "snmp", "traps"], - "operation": "updateNetworkSnmpTraps", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/snmp/traps" - - body_params = [ - "mode", - "receiver", - "v2", - "v3", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkSnmpTraps: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def getNetworkSplashLoginAttempts(self, networkId: str, **kwargs): """ **List the splash login attempts for a network** @@ -3321,10 +3040,9 @@ def createNetworkVlanProfile(self, networkId: str, name: str, vlanNames: list, v - vlanNames (array): An array of named VLANs - vlanGroups (array): An array of VLAN groups - iname (string): IName of the profile - - allowedVlans (string): The VLANs allowed on the VLAN profile. Only applicable to trunk ports. The given range must be inclusive of all named VLANs. """ - kwargs.update(locals()) + kwargs = locals() metadata = { "tags": ["networks", "configure", "vlanProfiles"], @@ -3335,7 +3053,6 @@ def createNetworkVlanProfile(self, networkId: str, name: str, vlanNames: list, v body_params = [ "name", - "allowedVlans", "vlanNames", "vlanGroups", "iname", @@ -3471,10 +3188,9 @@ def updateNetworkVlanProfile(self, networkId: str, iname: str, name: str, vlanNa - name (string): Name of the profile, string length must be from 1 to 255 characters - vlanNames (array): An array of named VLANs - vlanGroups (array): An array of VLAN groups - - allowedVlans (string): The VLANs allowed on the VLAN profile. Only applicable to trunk ports. The given range must be inclusive of all named VLANs. """ - kwargs.update(locals()) + kwargs = locals() metadata = { "tags": ["networks", "configure", "vlanProfiles"], @@ -3486,7 +3202,6 @@ def updateNetworkVlanProfile(self, networkId: str, iname: str, name: str, vlanNa body_params = [ "name", - "allowedVlans", "vlanNames", "vlanGroups", ] diff --git a/meraki/api/organizations.py b/meraki/api/organizations.py index 3122924..896e794 100644 --- a/meraki/api/organizations.py +++ b/meraki/api/organizations.py @@ -1083,329 +1083,6 @@ def deleteOrganizationAlertsProfile(self, organizationId: str, alertConfigId: st return self._session.delete(metadata, resource) - def getOrganizationApiPushProfiles(self, organizationId: str, **kwargs): - """ - **List the push profiles in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-push-profiles - - - organizationId (string): Organization ID - - inames (array): Optional parameter to filter the result set by the included set of push profile inames - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "api", "push", "profiles"], - "operation": "getOrganizationApiPushProfiles", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/api/push/profiles" - - query_params = [ - "inames", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "inames", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationApiPushProfiles: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def createOrganizationApiPushProfile(self, organizationId: str, iname: str, topic: dict, receiver: dict, **kwargs): - """ - **Create a new push profile** - https://developer.cisco.com/meraki/api-v1/#!create-organization-api-push-profile - - - organizationId (string): Organization ID - - iname (string): Immutable name of the resource. Must be unique within resources of this type. - - topic (object): Push topic - - receiver (object): Push receiver profile - - name (string): Name of push profile - - description (string): Description of push profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "api", "push", "profiles"], - "operation": "createOrganizationApiPushProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/api/push/profiles" - - body_params = [ - "iname", - "name", - "description", - "topic", - "receiver", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationApiPushProfile: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def updateOrganizationApiPushProfile(self, organizationId: str, iname: str, **kwargs): - """ - **Update a push profile** - https://developer.cisco.com/meraki/api-v1/#!update-organization-api-push-profile - - - organizationId (string): Organization ID - - iname (string): Iname - - name (string): Name of push profile - - description (string): Description of push profile - - topic (object): Push topic - - receiver (object): Push receiver profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "api", "push", "profiles"], - "operation": "updateOrganizationApiPushProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - iname = urllib.parse.quote(str(iname), safe="") - resource = f"/organizations/{organizationId}/api/push/profiles/{iname}" - - body_params = [ - "name", - "description", - "topic", - "receiver", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationApiPushProfile: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationApiPushProfile(self, organizationId: str, iname: str): - """ - **Delete a push profile** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-api-push-profile - - - organizationId (string): Organization ID - - iname (string): Iname - """ - - metadata = { - "tags": ["organizations", "configure", "api", "push", "profiles"], - "operation": "deleteOrganizationApiPushProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - iname = urllib.parse.quote(str(iname), safe="") - resource = f"/organizations/{organizationId}/api/push/profiles/{iname}" - - return self._session.delete(metadata, resource) - - def getOrganizationApiPushReceiversProfiles(self, organizationId: str): - """ - **List the push receiver profiles in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-push-receivers-profiles - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "api", "push", "receivers", "profiles"], - "operation": "getOrganizationApiPushReceiversProfiles", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/api/push/receivers/profiles" - - return self._session.get(metadata, resource) - - def createOrganizationApiPushReceiversProfile(self, organizationId: str, iname: str, receiver: dict, **kwargs): - """ - **Create a new push receiver profile** - https://developer.cisco.com/meraki/api-v1/#!create-organization-api-push-receivers-profile - - - organizationId (string): Organization ID - - iname (string): Immutable name of the resource. Must be unique within resources of this type. - - receiver (object): Webhook receiver - - name (string): Name of receiver profile - - description (string): Description of receiver profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "api", "push", "receivers", "profiles"], - "operation": "createOrganizationApiPushReceiversProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/api/push/receivers/profiles" - - body_params = [ - "iname", - "name", - "description", - "receiver", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationApiPushReceiversProfile: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def deleteOrganizationApiPushReceiversProfile(self, organizationId: str, iname: str): - """ - **Delete a push receiver profile** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-api-push-receivers-profile - - - organizationId (string): Organization ID - - iname (string): Iname - """ - - metadata = { - "tags": ["organizations", "configure", "api", "push", "receivers", "profiles"], - "operation": "deleteOrganizationApiPushReceiversProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - iname = urllib.parse.quote(str(iname), safe="") - resource = f"/organizations/{organizationId}/api/push/receivers/profiles/{iname}" - - return self._session.delete(metadata, resource) - - def updateOrganizationApiPushReceiversProfile(self, organizationId: str, iname: str, **kwargs): - """ - **Update a push receiver profile** - https://developer.cisco.com/meraki/api-v1/#!update-organization-api-push-receivers-profile - - - organizationId (string): Organization ID - - iname (string): Iname - - name (string): Name of the receiver profile - - description (string): Description of the receiver profile - - receiver (object): API Push Receiver details - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "api", "push", "receivers", "profiles"], - "operation": "updateOrganizationApiPushReceiversProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - iname = urllib.parse.quote(str(iname), safe="") - resource = f"/organizations/{organizationId}/api/push/receivers/profiles/{iname}" - - body_params = [ - "name", - "description", - "receiver", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationApiPushReceiversProfile: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def getOrganizationApiPushTopics(self, organizationId: str): - """ - **List of push topics** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-push-topics - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "api", "push", "topics"], - "operation": "getOrganizationApiPushTopics", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/api/push/topics" - - return self._session.get(metadata, resource) - - def getOrganizationApiRestProvisioningPipelines(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List pipelines with operation and status metadata, sorted by pipeline ID** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-rest-provisioning-pipelines - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'descending'. - - status (string): If provided, filters pipelines by status. If omitted, pipelines of all statuses are returned. `pending` pipelines have not started, `active` pipelines have started but not finished, `success` pipelines completed successfully, and `error` pipelines failed. - - timespan (integer): Created-at lookback for matching pipelines, in seconds. Defaults to 7200 seconds. The maximum is 30 days. - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["ascending", "descending"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - if "status" in kwargs: - options = ["active", "error", "pending", "success"] - assert kwargs["status"] in options, ( - f'''"status" cannot be "{kwargs["status"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "api", "rest", "provisioning", "pipelines"], - "operation": "getOrganizationApiRestProvisioningPipelines", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/api/rest/provisioning/pipelines" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "sortOrder", - "status", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApiRestProvisioningPipelines: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationApiRestProvisioningPipelinesJobs(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **List pipeline jobs, with optional status filtering** @@ -1692,180 +1369,32 @@ def getOrganizationApiRequestsOverviewResponseCodesByInterval(self, organization return self._session.get(metadata, resource, params) - def getOrganizationApiRequestsResponseCodesHistoryByAdmin(self, organizationId: str, **kwargs): + def getOrganizationAssuranceAlerts(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Lists API request response codes and their counts aggregated by admin** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-requests-response-codes-history-by-admin + **Return all health alerts for an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-alerts - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "apiRequests", "responseCodes", "history", "byAdmin"], - "operation": "getOrganizationApiRequestsResponseCodesHistoryByAdmin", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/apiRequests/responseCodes/history/byAdmin" - - query_params = [ - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApiRequestsResponseCodesHistoryByAdmin: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationApiRequestsResponseCodesHistoryByApplication(self, organizationId: str, **kwargs): - """ - **Lists API request response codes and their counts aggregated by application** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-requests-response-codes-history-by-application - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "apiRequests", "responseCodes", "history", "byApplication"], - "operation": "getOrganizationApiRequestsResponseCodesHistoryByApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/apiRequests/responseCodes/history/byApplication" - - query_params = [ - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApiRequestsResponseCodesHistoryByApplication: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationApiRequestsResponseCodesHistoryByOperation(self, organizationId: str, **kwargs): - """ - **Aggregates API usage data by operationId** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-requests-response-codes-history-by-operation - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "apiRequests", "responseCodes", "history", "byOperation"], - "operation": "getOrganizationApiRequestsResponseCodesHistoryByOperation", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/apiRequests/responseCodes/history/byOperation" - - query_params = [ - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApiRequestsResponseCodesHistoryByOperation: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationApiRequestsResponseCodesHistoryBySourceIp(self, organizationId: str, **kwargs): - """ - **Aggregates API usage by source ip** - https://developer.cisco.com/meraki/api-v1/#!get-organization-api-requests-response-codes-history-by-source-ip - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "apiRequests", "responseCodes", "history", "bySourceIp"], - "operation": "getOrganizationApiRequestsResponseCodesHistoryBySourceIp", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/apiRequests/responseCodes/history/bySourceIp" - - query_params = [ - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationApiRequestsResponseCodesHistoryBySourceIp: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceAlerts(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return all health alerts for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-alerts - - - 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 4 - 300. Default is 30. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'ascending'. - - networkId (string): Optional parameter to filter alerts by network ids. - - severity (string): Optional parameter to filter by severity type. - - types (array): Optional parameter to filter by alert type. - - tsStart (string): Optional parameter to filter by starting timestamp - - tsEnd (string): Optional parameter to filter by end timestamp - - category (string): Optional parameter to filter by category. - - sortBy (string): Optional parameter to set column to sort by. - - serials (array): Optional parameter to filter by primary device serial - - deviceTypes (array): Optional parameter to filter by device types - - deviceTags (array): Optional parameter to filter by device tags - - active (boolean): Optional parameter to filter by active alerts defaults to true - - dismissed (boolean): Optional parameter to filter by dismissed alerts defaults to false - - resolved (boolean): Optional parameter to filter by resolved alerts defaults to false - - suppressAlertsForOfflineNodes (boolean): When set to true the api will only return connectivity alerts for a given device if that device is in an offline state. This only applies to devices. This is ignored when resolved is true. Example: If a Switch has a VLan Mismatch and is Unreachable. only the Unreachable alert will be returned. Defaults to false. + - 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 4 - 300. Default is 30. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'ascending'. + - networkId (string): Optional parameter to filter alerts by network ids. + - severity (string): Optional parameter to filter by severity type. + - types (array): Optional parameter to filter by alert type. + - tsStart (string): Optional parameter to filter by starting timestamp + - tsEnd (string): Optional parameter to filter by end timestamp + - category (string): Optional parameter to filter by category. + - sortBy (string): Optional parameter to set column to sort by. + - serials (array): Optional parameter to filter by primary device serial + - deviceTypes (array): Optional parameter to filter by device types + - deviceTags (array): Optional parameter to filter by device tags + - active (boolean): Optional parameter to filter by active alerts defaults to true + - dismissed (boolean): Optional parameter to filter by dismissed alerts defaults to false + - resolved (boolean): Optional parameter to filter by resolved alerts defaults to false + - suppressAlertsForOfflineNodes (boolean): When set to true the api will only return connectivity alerts for a given device if that device is in an offline state. This only applies to devices. This is ignored when resolved is true. Example: If a Switch has a VLan Mismatch and is Unreachable. only the Unreachable alert will be returned. Defaults to false. """ kwargs.update(locals()) @@ -2379,2218 +1908,170 @@ def getOrganizationAssuranceAlert(self, organizationId: str, id: str): return self._session.get(metadata, resource) - def getOrganizationAssuranceClientsConnectedCountHistory(self, organizationId: str, networkId: str, **kwargs): + def getOrganizationBrandingPolicies(self, organizationId: str): """ - **Return combined wireless and wired connected client counts over time for a network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-clients-connected-count-history + **List the branding policies of an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-branding-policies - organizationId (string): Organization ID - - networkId (string): Network ID to query. - - serials (array): A list of serials of wireless AP or wired switch devices - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - ssidNumbers (array): Filter results by SSID number - - deviceType (string): Filter connected client counts by device type. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 8 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600. The default is 600. Interval is calculated if time params are provided. """ - kwargs.update(locals()) + metadata = { + "tags": ["organizations", "configure", "brandingPolicies"], + "operation": "getOrganizationBrandingPolicies", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/brandingPolicies" - if "deviceType" in kwargs: - options = ["access_point", "switch"] - assert kwargs["deviceType"] in options, ( - f'''"deviceType" cannot be "{kwargs["deviceType"]}", & must be set to one of: {options}''' - ) + return self._session.get(metadata, resource) + + 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 + + - organizationId (string): Organization ID + - name (string): Name of the Dashboard branding policy. + - enabled (boolean): Boolean indicating whether this policy is enabled. + - adminSettings (object): Settings for describing which kinds of admins this policy applies to. + - helpSettings (object): Settings for describing the modifications to various Help page features. Each property in this object accepts one of + 'default or inherit' (do not modify functionality), 'hide' (remove the section from Dashboard), or 'show' (always show + the section on Dashboard). Some properties in this object also accept custom HTML used to replace the section on + Dashboard; see the documentation for each property to see the allowed values. + Each property defaults to 'default or inherit' when not provided. + - customLogo (object): Properties describing the custom logo attached to the branding policy. + """ + + kwargs.update(locals()) metadata = { - "tags": ["organizations", "monitor", "clients", "connectedCountHistory"], - "operation": "getOrganizationAssuranceClientsConnectedCountHistory", + "tags": ["organizations", "configure", "brandingPolicies"], + "operation": "createOrganizationBrandingPolicy", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/clients/connectedCountHistory" - - query_params = [ - "networkId", - "serials", - "bands", - "ssidNumbers", - "deviceType", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + resource = f"/organizations/{organizationId}/brandingPolicies" - array_params = [ - "serials", - "bands", - "ssidNumbers", + body_params = [ + "name", + "enabled", + "adminSettings", + "helpSettings", + "customLogo", ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceClientsConnectedCountHistory: ignoring unrecognized kwargs: {invalid}" - ) + self._session._logger.warning(f"createOrganizationBrandingPolicy: ignoring unrecognized kwargs: {invalid}") - return self._session.get(metadata, resource, params) + return self._session.post(metadata, resource, payload) - def getOrganizationAssuranceClientsEvents(self, organizationId: str, clientId: str, networkId: str, **kwargs): + def getOrganizationBrandingPoliciesPriorities(self, organizationId: str): """ - **Given a client, get all alerts and events for a given timespan** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-clients-events + **Return the branding policy IDs of an organization in priority order** + https://developer.cisco.com/meraki/api-v1/#!get-organization-branding-policies-priorities - organizationId (string): Organization ID - - clientId (string): ID of client to query - - networkId (string): Network ID where client is connected - - filter (array): Optional parameter to filter by issue - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. """ - kwargs.update(locals()) - metadata = { - "tags": ["organizations", "configure", "clients", "events"], - "operation": "getOrganizationAssuranceClientsEvents", + "tags": ["organizations", "configure", "brandingPolicies", "priorities"], + "operation": "getOrganizationBrandingPoliciesPriorities", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/clients/events" - - query_params = [ - "filter", - "clientId", - "networkId", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "filter", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceClientsEvents: ignoring unrecognized kwargs: {invalid}" - ) + resource = f"/organizations/{organizationId}/brandingPolicies/priorities" - return self._session.get(metadata, resource, params) + return self._session.get(metadata, resource) - def getOrganizationAssuranceClientsEventsCorrelated( - self, organizationId: str, clientId: str, category: str, networkId: str, timestamp: str, **kwargs - ): + def updateOrganizationBrandingPoliciesPriorities(self, organizationId: str, **kwargs): """ - **Given a client, category, and timespan, return events that have a close connection to each other.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-clients-events-correlated + **Update the priority ordering of an organization's branding policies.** + https://developer.cisco.com/meraki/api-v1/#!update-organization-branding-policies-priorities - organizationId (string): Organization ID - - clientId (string): Client ID - - category (string): Category of events - - networkId (string): Network used by the client - - timestamp (string): Timestamp for the event - - lookback (integer): Amount of time in minutes to look back - - lookforward (integer): Amount of time in minutes to look forwards + - brandingPolicyIds (array): An ordered list of branding policy IDs that determines the priority order of how to apply the policies + """ kwargs.update(locals()) - if "category" in kwargs: - options = ["application", "association", "authentication", "dhcp", "dns"] - assert kwargs["category"] in options, ( - f'''"category" cannot be "{kwargs["category"]}", & must be set to one of: {options}''' - ) - metadata = { - "tags": ["organizations", "configure", "clients", "events", "correlated"], - "operation": "getOrganizationAssuranceClientsEventsCorrelated", + "tags": ["organizations", "configure", "brandingPolicies", "priorities"], + "operation": "updateOrganizationBrandingPoliciesPriorities", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/clients/events/correlated" + resource = f"/organizations/{organizationId}/brandingPolicies/priorities" - query_params = [ - "clientId", - "category", - "networkId", - "timestamp", - "lookback", - "lookforward", + body_params = [ + "brandingPolicyIds", ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} if self._session._validate_kwargs: - all_params = query_params + all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceClientsEventsCorrelated: ignoring unrecognized kwargs: {invalid}" + f"updateOrganizationBrandingPoliciesPriorities: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.put(metadata, resource, payload) - def getOrganizationAssuranceClientsTopologyCurrent(self, organizationId: str, clientId: str, networkId: str, **kwargs): + def getOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: str): """ - **Given a client, return current topology** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-clients-topology-current + **Return a branding policy** + https://developer.cisco.com/meraki/api-v1/#!get-organization-branding-policy - organizationId (string): Organization ID - - clientId (string): ID of client to query - - networkId (string): Network ID where client is connected + - brandingPolicyId (string): Branding policy ID """ - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "clients", "topology", "current"], - "operation": "getOrganizationAssuranceClientsTopologyCurrent", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/clients/topology/current" - - query_params = [ - "clientId", - "networkId", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceClientsTopologyCurrent: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceClientsTopologyNew(self, organizationId: str, clientIds: list, networkId: str, **kwargs): - """ - **Given a client, return current topology** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-clients-topology-new - - - organizationId (string): Organization ID - - clientIds (array): List of IDs for client retrieval for a given network. Limited to 1 client for now - - networkId (string): Network ID where client is connected - - timestamp (string): Timestamp for client topology path - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "clients", "topology", "new"], - "operation": "getOrganizationAssuranceClientsTopologyNew", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/clients/topology/new" - - query_params = [ - "clientIds", - "networkId", - "timestamp", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "clientIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceClientsTopologyNew: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceDevicesStatusesOverview(self, organizationId: str, **kwargs): - """ - **Returns counts of online, offline, and recovered devices by product type, along with offline intervals for impacted devices in the organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-devices-statuses-overview - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "devices", "statuses", "overview"], - "operation": "getOrganizationAssuranceDevicesStatusesOverview", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/devices/statuses/overview" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceDevicesStatusesOverview: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceFetchTableQuery(self, organizationId: str, tableName: str, **kwargs): - """ - **Returns the table data for a given timespan** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-fetch-table-query - - - organizationId (string): Organization ID - - tableName (string): The table from which we want to get data - - t0 (string): The beginning of the timespan for the data. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 365 days, 5 hours, 49 minutes, and 12 seconds. The default is 30 days, 10 hours, 29 minutes, and 6 seconds. - - userEmail (string): The user email for whom we want to calculate lookback - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "fetchTableQuery"], - "operation": "getOrganizationAssuranceFetchTableQuery", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/fetchTableQuery" - - query_params = [ - "t0", - "timespan", - "tableName", - "userEmail", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceFetchTableQuery: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceNetworkServicesServerHealthByServer(self, organizationId: str, **kwargs): - """ - **Returns network server health in organization by server.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-network-services-server-health-by-server - - - organizationId (string): Organization ID - - networkIds (array): Filter results for these networks. - - serverTypes (array): Filter results for these server types. - - serverIps (array): Filter results for these server IP addresses. - - ssidNumbers (array): Filter results for these SSID Numbers. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "networkServices", "serverHealth", "byServer"], - "operation": "getOrganizationAssuranceNetworkServicesServerHealthByServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/networkServices/serverHealth/byServer" - - query_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceNetworkServicesServerHealthByServer: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceNetworkServicesServerHealthByServerByInterval(self, organizationId: str, **kwargs): - """ - **Returns network server health in organization by server and by interval.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-network-services-server-health-by-server-by-interval - - - organizationId (string): Organization ID - - networkIds (array): Filter results for these networks. - - serverTypes (array): Filter results for these server types. - - serverIps (array): Filter results for these server IP addresses. - - ssidNumbers (array): Filter results for these SSID Numbers. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 14400, 86400. The default is 300. Interval is calculated if time params are provided. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "networkServices", "serverHealth", "byServer", "byInterval"], - "operation": "getOrganizationAssuranceNetworkServicesServerHealthByServerByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/networkServices/serverHealth/byServer/byInterval" - - query_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceNetworkServicesServerHealthByServerByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceNetworkServicesServerHealthByServerType(self, organizationId: str, **kwargs): - """ - **Returns network server health in organization by server type.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-network-services-server-health-by-server-type - - - organizationId (string): Organization ID - - networkIds (array): Filter results for these networks. - - serverTypes (array): Filter results for these server types. - - serverIps (array): Filter results for these server IP addresses. - - ssidNumbers (array): Filter results for these SSID Numbers. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "networkServices", "serverHealth", "byServerType"], - "operation": "getOrganizationAssuranceNetworkServicesServerHealthByServerType", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/networkServices/serverHealth/byServerType" - - query_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceNetworkServicesServerHealthByServerType: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceNetworkServicesServerHealthByServerTypeByInterval(self, organizationId: str, **kwargs): - """ - **Returns network server health in organization by server type and by interval.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-network-services-server-health-by-server-type-by-interval - - - organizationId (string): Organization ID - - networkIds (array): Filter results for these networks. - - serverTypes (array): Filter results for these server types. - - serverIps (array): Filter results for these server IP addresses. - - ssidNumbers (array): Filter results for these SSID Numbers. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 14400, 86400. The default is 300. Interval is calculated if time params are provided. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "networkServices", "serverHealth", "byServerType", "byInterval"], - "operation": "getOrganizationAssuranceNetworkServicesServerHealthByServerTypeByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/networkServices/serverHealth/byServerType/byInterval" - - query_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serverTypes", - "serverIps", - "ssidNumbers", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceNetworkServicesServerHealthByServerTypeByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def checkupOrganizationAssuranceOptimization(self, organizationId: str, **kwargs): - """ - **Returns an array of checkup results for the organization** - https://developer.cisco.com/meraki/api-v1/#!checkup-organization-assurance-optimization - - - organizationId (string): Organization ID - - forceRefresh (boolean): Optional parameter to reassess best practices - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "optimization"], - "operation": "checkupOrganizationAssuranceOptimization", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/optimization/checkup" - - query_params = [ - "forceRefresh", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"checkupOrganizationAssuranceOptimization: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceOptimizationCheckupByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns an array of checkup results for the networks** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-optimization-checkup-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 - 20. Default is 7. - - 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 checkups by Network Id - - forceRefresh (boolean): Optional parameter to reassess best practices - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "optimization", "checkup", "byNetwork"], - "operation": "getOrganizationAssuranceOptimizationCheckupByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/optimization/checkup/byNetwork" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "forceRefresh", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceOptimizationCheckupByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceProductAnnouncements(self, organizationId: str, **kwargs): - """ - **Gets relevant product announcements for a user** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-product-announcements - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 365 days, 5 hours, 49 minutes, and 12 seconds. The default is 91 days, 7 hours, 27 minutes, and 18 seconds. - - onlyRelevant (boolean): Limits product announcements that are considered relevant to this user when true - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "productAnnouncements"], - "operation": "getOrganizationAssuranceProductAnnouncements", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/productAnnouncements" - - query_params = [ - "t0", - "timespan", - "onlyRelevant", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceProductAnnouncements: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceScores(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get network health scores for a list of networks.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-scores - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 5000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 2 hours and be less than or equal to 14 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "scores"], - "operation": "getOrganizationAssuranceScores", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/scores" - - query_params = [ - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationAssuranceScores: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceThousandEyesApplications(self, organizationId: str, networkIds: list, **kwargs): - """ - **Get a list of Thousand Eyes applications with their alerts.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-thousand-eyes-applications - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - clientId (string): Filter results by client. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "thousandEyes", "applications"], - "operation": "getOrganizationAssuranceThousandEyesApplications", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/thousandEyes/applications" - - query_params = [ - "networkIds", - "clientId", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceThousandEyesApplications: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wired connection successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wired-experience-successful-connections-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "wired", "experience", "successfulConnections", "byNetwork"], - "operation": "getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wired/experience/successfulConnections/byNetwork" - - query_params = [ - "networkIds", - "serials", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClient(self, organizationId: str, **kwargs): - """ - **Summarizes wired connection successes and failures by client.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wired-experience-successful-connections-by-network-by-client - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "wired", "experience", "successfulConnections", "byNetwork", "byClient"], - "operation": "getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wired/experience/successfulConnections/byNetwork/byClient" - - query_params = [ - "networkIds", - "serials", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClientOs(self, organizationId: str, **kwargs): - """ - **Summarizes wired connection successes and failures by client OS.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wired-experience-successful-connections-by-network-by-client-os - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "wired", "experience", "successfulConnections", "byNetwork", "byClientOs"], - "operation": "getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClientOs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wired/experience/successfulConnections/byNetwork/byClientOs" - - query_params = [ - "networkIds", - "serials", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClientOs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClientType( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wired connection successes and failures by client type.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wired-experience-successful-connections-by-network-by-client-type - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": [ - "organizations", - "configure", - "wired", - "experience", - "successfulConnections", - "byNetwork", - "byClientType", - ], - "operation": "getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClientType", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wired/experience/successfulConnections/byNetwork/byClientType" - - query_params = [ - "networkIds", - "serials", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByClientType: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wired connection successes and failures by device.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wired-experience-successful-connections-by-network-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "wired", "experience", "successfulConnections", "byNetwork", "byDevice"], - "operation": "getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wired/experience/successfulConnections/byNetwork/byDevice" - - query_params = [ - "networkIds", - "serials", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByInterval(self, organizationId: str, **kwargs): - """ - **Time-series of wired connection successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wired-experience-successful-connections-by-network-by-interval - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 60, 300, 600, 3600, 14400, 86400. The default is 300. Interval is calculated if time params are provided. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "wired", "experience", "successfulConnections", "byNetwork", "byInterval"], - "operation": "getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wired/experience/successfulConnections/byNetwork/byInterval" - - query_params = [ - "networkIds", - "serials", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByServer(self, organizationId: str, **kwargs): - """ - **Summarizes wired connection successes and failures by server.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wired-experience-successful-connections-by-network-by-server - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "wired", "experience", "successfulConnections", "byNetwork", "byServer"], - "operation": "getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wired/experience/successfulConnections/byNetwork/byServer" - - query_params = [ - "networkIds", - "serials", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWiredExperienceSuccessfulConnectionsByNetworkByServer: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWorkflows(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return workflows filtered by organization ID, network ID, type, and category** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-workflows - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 30. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'ascending'. - - networkIds (array): Optional parameter to filter by network ID - - types (array): Optional parameter to filter workflows by types - - categories (array): Optional parameter to filter workflows by categories - - scopeTypes (array): Optional parameter to filter workflows by scope types - - networkTags (array): Optional parameter to filter workflows by network tags - - clientTags (array): Optional parameter to filter workflows by client tags - - nodeTags (array): Optional parameter to filter workflows by node tags - - state (string): Optional parameter to filter workflows by state - - tsStart (string): Start time to filter workflows - - tsEnd (string): End time to filter workflows - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["ascending", "descending"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "workflows"], - "operation": "getOrganizationAssuranceWorkflows", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/workflows" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "sortOrder", - "networkIds", - "types", - "categories", - "scopeTypes", - "networkTags", - "clientTags", - "nodeTags", - "state", - "tsStart", - "tsEnd", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "types", - "categories", - "scopeTypes", - "networkTags", - "clientTags", - "nodeTags", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationAssuranceWorkflows: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAuthRadiusServers(self, organizationId: str): - """ - **List the organization-wide RADIUS servers in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-auth-radius-servers - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "auth", "radius", "servers"], - "operation": "getOrganizationAuthRadiusServers", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/auth/radius/servers" - - return self._session.get(metadata, resource) - - def createOrganizationAuthRadiusServer(self, organizationId: str, address: str, secret: str, **kwargs): - """ - **Add an organization-wide RADIUS server** - https://developer.cisco.com/meraki/api-v1/#!create-organization-auth-radius-server - - - organizationId (string): Organization ID - - address (string): The IP address or FQDN of the RADIUS server - - secret (string): Shared secret of the RADIUS server - - name (string): The name of the RADIUS server - - modes (array): Available server modes - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "auth", "radius", "servers"], - "operation": "createOrganizationAuthRadiusServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/auth/radius/servers" - - body_params = [ - "name", - "address", - "modes", - "secret", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationAuthRadiusServer: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationAuthRadiusServersAssignments(self, organizationId: str): - """ - **Return list of network and policies that organization-wide RADIUS servers are bing used** - https://developer.cisco.com/meraki/api-v1/#!get-organization-auth-radius-servers-assignments - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "auth", "radius", "servers", "assignments"], - "operation": "getOrganizationAuthRadiusServersAssignments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/auth/radius/servers/assignments" - - return self._session.get(metadata, resource) - - def getOrganizationAuthRadiusServer(self, organizationId: str, serverId: str): - """ - **Return an organization-wide RADIUS server** - https://developer.cisco.com/meraki/api-v1/#!get-organization-auth-radius-server - - - organizationId (string): Organization ID - - serverId (string): Server ID - """ - - metadata = { - "tags": ["organizations", "configure", "auth", "radius", "servers"], - "operation": "getOrganizationAuthRadiusServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - serverId = urllib.parse.quote(str(serverId), safe="") - resource = f"/organizations/{organizationId}/auth/radius/servers/{serverId}" - - return self._session.get(metadata, resource) - - def updateOrganizationAuthRadiusServer(self, organizationId: str, serverId: str, **kwargs): - """ - **Update an organization-wide RADIUS server** - https://developer.cisco.com/meraki/api-v1/#!update-organization-auth-radius-server - - - organizationId (string): Organization ID - - serverId (string): Server ID - - name (string): The name of the RADIUS server - - address (string): The IP address or FQDN of the RADIUS server - - modes (array): Available server modes - - secret (string): Shared secret of the RADIUS server - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "auth", "radius", "servers"], - "operation": "updateOrganizationAuthRadiusServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - serverId = urllib.parse.quote(str(serverId), safe="") - resource = f"/organizations/{organizationId}/auth/radius/servers/{serverId}" - - body_params = [ - "name", - "address", - "modes", - "secret", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationAuthRadiusServer: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationAuthRadiusServer(self, organizationId: str, serverId: str): - """ - **Delete an organization-wide RADIUS server from a organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-auth-radius-server - - - organizationId (string): Organization ID - - serverId (string): Server ID - """ - - metadata = { - "tags": ["organizations", "configure", "auth", "radius", "servers"], - "operation": "deleteOrganizationAuthRadiusServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - serverId = urllib.parse.quote(str(serverId), safe="") - resource = f"/organizations/{organizationId}/auth/radius/servers/{serverId}" - - return self._session.delete(metadata, resource) - - def codeOrganizationAutomateIdentity(self, organizationId: str): - """ - **Generate a single use short lived code that can be used to retrieve the identity of the current user in the organization.** - https://developer.cisco.com/meraki/api-v1/#!code-organization-automate-identity - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "automate", "identity"], - "operation": "codeOrganizationAutomateIdentity", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/automate/identity/code" - - return self._session.post(metadata, resource) - - def getOrganizationBrandingPolicies(self, organizationId: str): - """ - **List the branding policies of an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-branding-policies - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "brandingPolicies"], - "operation": "getOrganizationBrandingPolicies", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/brandingPolicies" - - return self._session.get(metadata, resource) - - 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 - - - organizationId (string): Organization ID - - name (string): Name of the Dashboard branding policy. - - enabled (boolean): Boolean indicating whether this policy is enabled. - - adminSettings (object): Settings for describing which kinds of admins this policy applies to. - - helpSettings (object): Settings for describing the modifications to various Help page features. Each property in this object accepts one of - 'default or inherit' (do not modify functionality), 'hide' (remove the section from Dashboard), or 'show' (always show - the section on Dashboard). Some properties in this object also accept custom HTML used to replace the section on - Dashboard; see the documentation for each property to see the allowed values. - Each property defaults to 'default or inherit' when not provided. - - customLogo (object): Properties describing the custom logo attached to the branding policy. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "brandingPolicies"], - "operation": "createOrganizationBrandingPolicy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/brandingPolicies" - - body_params = [ - "name", - "enabled", - "adminSettings", - "helpSettings", - "customLogo", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationBrandingPolicy: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationBrandingPoliciesPriorities(self, organizationId: str): - """ - **Return the branding policy IDs of an organization in priority order** - https://developer.cisco.com/meraki/api-v1/#!get-organization-branding-policies-priorities - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "brandingPolicies", "priorities"], - "operation": "getOrganizationBrandingPoliciesPriorities", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/brandingPolicies/priorities" - - return self._session.get(metadata, resource) - - def updateOrganizationBrandingPoliciesPriorities(self, organizationId: str, **kwargs): - """ - **Update the priority ordering of an organization's branding policies.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-branding-policies-priorities - - - organizationId (string): Organization ID - - brandingPolicyIds (array): An ordered list of branding policy IDs that determines the priority order of how to apply the policies - - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "brandingPolicies", "priorities"], - "operation": "updateOrganizationBrandingPoliciesPriorities", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/brandingPolicies/priorities" - - body_params = [ - "brandingPolicyIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationBrandingPoliciesPriorities: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def getOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: str): - """ - **Return a branding policy** - https://developer.cisco.com/meraki/api-v1/#!get-organization-branding-policy - - - organizationId (string): Organization ID - - brandingPolicyId (string): Branding policy ID - """ - - metadata = { - "tags": ["organizations", "configure", "brandingPolicies"], - "operation": "getOrganizationBrandingPolicy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - brandingPolicyId = urllib.parse.quote(str(brandingPolicyId), safe="") - resource = f"/organizations/{organizationId}/brandingPolicies/{brandingPolicyId}" - - return self._session.get(metadata, resource) - - 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 - - - organizationId (string): Organization ID - - brandingPolicyId (string): Branding policy ID - - name (string): Name of the Dashboard branding policy. - - enabled (boolean): Boolean indicating whether this policy is enabled. - - adminSettings (object): Settings for describing which kinds of admins this policy applies to. - - helpSettings (object): Settings for describing the modifications to various Help page features. Each property in this object accepts one of - 'default or inherit' (do not modify functionality), 'hide' (remove the section from Dashboard), or 'show' (always show - the section on Dashboard). Some properties in this object also accept custom HTML used to replace the section on - Dashboard; see the documentation for each property to see the allowed values. - - - customLogo (object): Properties describing the custom logo attached to the branding policy. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "brandingPolicies"], - "operation": "updateOrganizationBrandingPolicy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - brandingPolicyId = urllib.parse.quote(str(brandingPolicyId), safe="") - resource = f"/organizations/{organizationId}/brandingPolicies/{brandingPolicyId}" - - body_params = [ - "name", - "enabled", - "adminSettings", - "helpSettings", - "customLogo", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationBrandingPolicy: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: str): - """ - **Delete a branding policy** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-branding-policy - - - organizationId (string): Organization ID - - brandingPolicyId (string): Branding policy ID - """ - - metadata = { - "tags": ["organizations", "configure", "brandingPolicies"], - "operation": "deleteOrganizationBrandingPolicy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - brandingPolicyId = urllib.parse.quote(str(brandingPolicyId), safe="") - resource = f"/organizations/{organizationId}/brandingPolicies/{brandingPolicyId}" - - return self._session.delete(metadata, resource) - - def getOrganizationCertificates(self, organizationId: str, **kwargs): - """ - **Gets all or specific certificates for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates - - - organizationId (string): Organization ID - - certificateIds (array): List of ids for specific certificate retrieval - - certManagedBy (array): List of cert managed by types - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "certificates"], - "operation": "getOrganizationCertificates", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates" - - query_params = [ - "certificateIds", - "certManagedBy", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "certificateIds", - "certManagedBy", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationCertificates: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def getOrganizationCertificatesAuthorities(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List certificate authorities for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates-authorities - - - 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 - - authorityIds (array): Feature certificate authority IDs to filter by (exact match on each id; duplicates are ignored) - - sortBy (string): Field to sort by (default: authorityId) - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["authorityId", "featureType", "status"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "certificates", "authorities"], - "operation": "getOrganizationCertificatesAuthorities", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities" - - query_params = [ - "authorityIds", - "sortBy", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "authorityIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationCertificatesAuthority(self, organizationId: str, featureType: str, **kwargs): - """ - **Create a certificate authority for an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-certificates-authority - - - organizationId (string): Organization ID - - featureType (string): Feature this CA serves (e.g., radsec, openroaming, zigbee) - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "certificates", "authorities"], - "operation": "createOrganizationCertificatesAuthority", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities" - - body_params = [ - "featureType", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationCertificatesAuthority: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, **kwargs): - """ - **Trust a newly created certificate authority (transition from untrusted to trusted).** - https://developer.cisco.com/meraki/api-v1/#!update-organization-certificates-authorities - - - organizationId (string): Organization ID - - authorityId (string): ID of the certificate authority to trust. The CA must currently be untrusted. - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "certificates", "authorities"], - "operation": "updateOrganizationCertificatesAuthorities", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities" - - body_params = [ - "authorityId", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, name: str): - """ - **Delete a certificate authority** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-certificates-authorities - - - organizationId (string): Organization ID - - authorityId (string): ID of the certificate authority to delete - - name (string): Certificate authority name - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "certificates", "authorities"], - "operation": "deleteOrganizationCertificatesAuthorities", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities" - - return self._session.delete(metadata, resource) - - def getOrganizationCertificatesAuthoritiesJob(self, organizationId: str, jobId: str): - """ - **Return the status and result of a certificate authority job.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates-authorities-job - - - organizationId (string): Organization ID - - jobId (string): Job ID - """ - - metadata = { - "tags": ["organizations", "configure", "certificates", "authorities", "jobs"], - "operation": "getOrganizationCertificatesAuthoritiesJob", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - jobId = urllib.parse.quote(str(jobId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities/jobs/{jobId}" - - return self._session.get(metadata, resource) - - def revokeOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, **kwargs): - """ - **Revoke a trusted feature certificate authority.** - https://developer.cisco.com/meraki/api-v1/#!revoke-organization-certificates-authorities - - - organizationId (string): Organization ID - - authorityId (string): ID of the feature certificate authority to revoke - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "certificates", "authorities"], - "operation": "revokeOrganizationCertificatesAuthorities", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/authorities/revoke" - - body_params = [ - "authorityId", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"revokeOrganizationCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def importOrganizationCertificates(self, organizationId: str, managedBy: str, contents: str, description: str, **kwargs): - """ - **Import certificate for this organization** - https://developer.cisco.com/meraki/api-v1/#!import-organization-certificates - - - organizationId (string): Organization ID - - managedBy (string): Certificate managed by type [system_manager, mr, encrypted_syslog, grpc_dial_out] - - contents (string): Certificate content in valid PEM format - - description (string): Certificate description - """ - - kwargs = locals() - - if "managedBy" in kwargs: - options = ["encrypted_syslog", "grpc_dial_out", "mr", "system_manager"] - assert kwargs["managedBy"] in options, ( - f'''"managedBy" cannot be "{kwargs["managedBy"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "certificates"], - "operation": "importOrganizationCertificates", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/import" - - body_params = [ - "managedBy", - "contents", - "description", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"importOrganizationCertificates: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationCertificatesMerakiAuthContents(self, organizationId: str): - """ - **Download the public RADIUS certificate.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates-meraki-auth-contents - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "monitor", "certificates", "merakiAuth", "contents"], - "operation": "getOrganizationCertificatesMerakiAuthContents", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/merakiAuth/contents" - - return self._session.get(metadata, resource) - - def getOrganizationCertificatesRevocationLists(self, organizationId: str, **kwargs): - """ - **Return full certificate revocation lists (CRLs) for the organization's certificate authorities** - https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates-revocation-lists - - - organizationId (string): Organization ID - - certificateAuthorityIds (array): Optional filter: feature certificate authority IDs (base-10 integers). Every value must exist for this organization; otherwise the request fails. Omit to return CRLs for all feature CAs in the organization. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "certificates", "revocationLists"], - "operation": "getOrganizationCertificatesRevocationLists", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/certificates/revocationLists" - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationCertificatesRevocationLists: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def deleteOrganizationCertificate(self, organizationId: str, certificateId: str): - """ - **Delete a certificate for an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-certificate - - - organizationId (string): Organization ID - - certificateId (string): Certificate ID - """ - - metadata = { - "tags": ["organizations", "configure", "certificates"], - "operation": "deleteOrganizationCertificate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - certificateId = urllib.parse.quote(str(certificateId), safe="") - resource = f"/organizations/{organizationId}/certificates/{certificateId}" - - return self._session.delete(metadata, resource) - - def updateOrganizationCertificate(self, organizationId: str, certificateId: str, **kwargs): - """ - **Update a certificate's description for an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-certificate - - - organizationId (string): Organization ID - - certificateId (string): Certificate ID - - description (string): Description of a certificate that already exist in your org - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "certificates"], - "operation": "updateOrganizationCertificate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - certificateId = urllib.parse.quote(str(certificateId), safe="") - resource = f"/organizations/{organizationId}/certificates/{certificateId}" - - body_params = [ - "description", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationCertificate: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getOrganizationCertificateContents(self, organizationId: str, certificateId: str, **kwargs): - """ - **Download the trusted certificate by certificate id.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-certificate-contents - - - organizationId (string): Organization ID - - certificateId (string): Certificate ID - - chainId (string): chainId that represent which certificate chain is being requested - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "certificates", "contents"], - "operation": "getOrganizationCertificateContents", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - certificateId = urllib.parse.quote(str(certificateId), safe="") - resource = f"/organizations/{organizationId}/certificates/{certificateId}/contents" - - query_params = [ - "chainId", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationCertificateContents: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def claimIntoOrganization(self, organizationId: str, **kwargs): - """ - **Claim a list of devices, licenses, and/or orders into an organization inventory** - https://developer.cisco.com/meraki/api-v1/#!claim-into-organization - - - organizationId (string): Organization ID - - orders (array): The numbers of the orders that should be claimed - - serials (array): The serials of the devices that should be claimed - - licenses (array): The licenses that should be claimed - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure"], - "operation": "claimIntoOrganization", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/claim" - - body_params = [ - "orders", - "serials", - "licenses", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"claimIntoOrganization: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationClientsBandwidthUsageHistory(self, organizationId: str, **kwargs): - """ - **Return data usage (in megabits per second) over time for all clients in the given organization within a given time range.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-bandwidth-usage-history - - - organizationId (string): Organization ID - - networkTag (string): Match result to an exact network tag - - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - - ssidName (string): Filter results by ssid name - - usageUplink (string): Filter results by usage uplink - - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 186 days. The default is 1 day. - """ - - kwargs.update(locals()) - metadata = { - "tags": ["organizations", "monitor", "clients", "bandwidthUsageHistory"], - "operation": "getOrganizationClientsBandwidthUsageHistory", + "tags": ["organizations", "configure", "brandingPolicies"], + "operation": "getOrganizationBrandingPolicy", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/clients/bandwidthUsageHistory" - - query_params = [ - "networkTag", - "deviceTag", - "networkId", - "ssidName", - "usageUplink", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationClientsBandwidthUsageHistory: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) + brandingPolicyId = urllib.parse.quote(str(brandingPolicyId), safe="") + resource = f"/organizations/{organizationId}/brandingPolicies/{brandingPolicyId}" - def getOrganizationClientsOverview(self, organizationId: str, **kwargs): - """ - **Return summary information around client data usage (in kb) across the given organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-overview + return self._session.get(metadata, resource) - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. + 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 - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "clients", "overview"], - "operation": "getOrganizationClientsOverview", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/clients/overview" - - query_params = [ - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationClientsOverview: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def getOrganizationClientsSearch(self, organizationId: str, mac: str, total_pages=1, direction="next", **kwargs): - """ - **Return the client details in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-search + - organizationId (string): Organization ID + - brandingPolicyId (string): Branding policy ID + - name (string): Name of the Dashboard branding policy. + - enabled (boolean): Boolean indicating whether this policy is enabled. + - adminSettings (object): Settings for describing which kinds of admins this policy applies to. + - helpSettings (object): Settings for describing the modifications to various Help page features. Each property in this object accepts one of + 'default or inherit' (do not modify functionality), 'hide' (remove the section from Dashboard), or 'show' (always show + the section on Dashboard). Some properties in this object also accept custom HTML used to replace the section on + Dashboard; see the documentation for each property to see the allowed values. - - organizationId (string): Organization ID - - mac (string): The MAC address of the client. Required. - - 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 - 5. Default is 5. - - 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. + - customLogo (object): Properties describing the custom logo attached to the branding policy. """ kwargs.update(locals()) metadata = { - "tags": ["organizations", "configure", "clients", "search"], - "operation": "getOrganizationClientsSearch", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/clients/search" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "mac", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationClientsSearch: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def cloneOrganization(self, organizationId: str, name: str, **kwargs): - """ - **Create a new organization by cloning the addressed organization** - https://developer.cisco.com/meraki/api-v1/#!clone-organization - - - organizationId (string): Organization ID - - name (string): The name of the new organization - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure"], - "operation": "cloneOrganization", + "tags": ["organizations", "configure", "brandingPolicies"], + "operation": "updateOrganizationBrandingPolicy", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/clone" + brandingPolicyId = urllib.parse.quote(str(brandingPolicyId), safe="") + resource = f"/organizations/{organizationId}/brandingPolicies/{brandingPolicyId}" body_params = [ "name", + "enabled", + "adminSettings", + "helpSettings", + "customLogo", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -4598,109 +2079,53 @@ def cloneOrganization(self, organizationId: str, name: str, **kwargs): all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning(f"cloneOrganization: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationCloudConnectivityRequirements(self, organizationId: str): - """ - **List of source/destination traffic rules** - https://developer.cisco.com/meraki/api-v1/#!get-organization-cloud-connectivity-requirements - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "monitor", "cloud", "connectivity", "requirements"], - "operation": "getOrganizationCloudConnectivityRequirements", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/cloud/connectivity/requirements" - - return self._session.get(metadata, resource) + self._session._logger.warning(f"updateOrganizationBrandingPolicy: ignoring unrecognized kwargs: {invalid}") - def getOrganizationComputeApplicationDeployments(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the Application Deployment agent configurations for all hosts under this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-compute-application-deployments + return self._session.put(metadata, resource, payload) - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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. - - developerNames (array): Filters deployments by application developer name - - applicationNames (array): Filters deployments by application name - - enabled (boolean): Filters deployments by their enabled status + def deleteOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: str): """ + **Delete a branding policy** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-branding-policy - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "compute", "application", "deployments"], - "operation": "getOrganizationComputeApplicationDeployments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/compute/application/deployments" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "developerNames", - "applicationNames", - "enabled", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "developerNames", - "applicationNames", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationComputeApplicationDeployments: ignoring unrecognized kwargs: {invalid}" - ) + - organizationId (string): Organization ID + - brandingPolicyId (string): Branding policy ID + """ - return self._session.get_pages(metadata, resource, params, total_pages, direction) + metadata = { + "tags": ["organizations", "configure", "brandingPolicies"], + "operation": "deleteOrganizationBrandingPolicy", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + brandingPolicyId = urllib.parse.quote(str(brandingPolicyId), safe="") + resource = f"/organizations/{organizationId}/brandingPolicies/{brandingPolicyId}" - def createOrganizationComputeApplicationDeploymentsBulkCreate( - self, organizationId: str, hosts: list, application: dict, enabled: bool, **kwargs - ): + return self._session.delete(metadata, resource) + + def claimIntoOrganization(self, organizationId: str, **kwargs): """ - **Add Application Deployment agents for a list of hosts** - https://developer.cisco.com/meraki/api-v1/#!create-organization-compute-application-deployments-bulk-create + **Claim a list of devices, licenses, and/or orders into an organization inventory** + https://developer.cisco.com/meraki/api-v1/#!claim-into-organization - organizationId (string): Organization ID - - hosts (array): List of hosts to deploy applications on - - application (object): Application information - - enabled (boolean): Whether the deployment should be enabled - - applicationConfiguration (object): Optional: Generic object for application-specific configuration + - orders (array): The numbers of the orders that should be claimed + - serials (array): The serials of the devices that should be claimed + - licenses (array): The licenses that should be claimed """ kwargs.update(locals()) metadata = { - "tags": ["organizations", "configure", "compute", "application", "deployments", "bulkCreate"], - "operation": "createOrganizationComputeApplicationDeploymentsBulkCreate", + "tags": ["organizations", "configure"], + "operation": "claimIntoOrganization", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/compute/application/deployments/bulkCreate" + resource = f"/organizations/{organizationId}/claim" body_params = [ - "hosts", - "application", - "enabled", - "applicationConfiguration", + "orders", + "serials", + "licenses", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -4708,118 +2133,159 @@ def createOrganizationComputeApplicationDeploymentsBulkCreate( all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationComputeApplicationDeploymentsBulkCreate: ignoring unrecognized kwargs: {invalid}" - ) + self._session._logger.warning(f"claimIntoOrganization: ignoring unrecognized kwargs: {invalid}") return self._session.post(metadata, resource, payload) - def updateOrganizationComputeApplicationDeployment(self, organizationId: str, deploymentId: str, enabled: bool, **kwargs): + def getOrganizationClientsBandwidthUsageHistory(self, organizationId: str, **kwargs): """ - **Update a Deployment agent configuration** - https://developer.cisco.com/meraki/api-v1/#!update-organization-compute-application-deployment + **Return data usage (in megabits per second) over time for all clients in the given organization within a given time range.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-bandwidth-usage-history - organizationId (string): Organization ID - - deploymentId (string): Deployment ID - - enabled (boolean): Whether or not the Application Deployment agent is enabled for the host. + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink + - t0 (string): The beginning of the timespan for the data. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 186 days. The default is 1 day. """ - kwargs = locals() + kwargs.update(locals()) metadata = { - "tags": ["organizations", "configure", "compute", "application", "deployments"], - "operation": "updateOrganizationComputeApplicationDeployment", + "tags": ["organizations", "monitor", "clients", "bandwidthUsageHistory"], + "operation": "getOrganizationClientsBandwidthUsageHistory", } organizationId = urllib.parse.quote(str(organizationId), safe="") - deploymentId = urllib.parse.quote(str(deploymentId), safe="") - resource = f"/organizations/{organizationId}/compute/application/deployments/{deploymentId}" + resource = f"/organizations/{organizationId}/clients/bandwidthUsageHistory" - body_params = [ - "enabled", + query_params = [ + "networkTag", + "deviceTag", + "ssidName", + "usageUplink", + "t0", + "t1", + "timespan", ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} if self._session._validate_kwargs: - all_params = [] + body_params + all_params = query_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"updateOrganizationComputeApplicationDeployment: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationClientsBandwidthUsageHistory: ignoring unrecognized kwargs: {invalid}" ) - return self._session.put(metadata, resource, payload) + return self._session.get(metadata, resource, params) - def deleteOrganizationComputeApplicationDeployment(self, organizationId: str, deploymentId: str): + def getOrganizationClientsOverview(self, organizationId: str, **kwargs): """ - **Delete a Application Deployment agent from the host** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-compute-application-deployment + **Return summary information around client data usage (in kb) across the given organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-overview - organizationId (string): Organization ID - - deploymentId (string): Deployment ID + - t0 (string): The beginning of the timespan for the data. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. """ + kwargs.update(locals()) + metadata = { - "tags": ["organizations", "configure", "compute", "application", "deployments"], - "operation": "deleteOrganizationComputeApplicationDeployment", + "tags": ["organizations", "monitor", "clients", "overview"], + "operation": "getOrganizationClientsOverview", } organizationId = urllib.parse.quote(str(organizationId), safe="") - deploymentId = urllib.parse.quote(str(deploymentId), safe="") - resource = f"/organizations/{organizationId}/compute/application/deployments/{deploymentId}" + resource = f"/organizations/{organizationId}/clients/overview" - return self._session.delete(metadata, resource) + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - def getOrganizationComputeHosts( - self, organizationId: str, developerName: str, applicationName: str, total_pages=1, direction="next", **kwargs - ): + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"getOrganizationClientsOverview: ignoring unrecognized kwargs: {invalid}") + + return self._session.get(metadata, resource, params) + + def getOrganizationClientsSearch(self, organizationId: str, mac: str, total_pages=1, direction="next", **kwargs): """ - **Retrieves a list of compute hosts eligible for application deployment within a given organization, filtered by the specified application developer and application name, with optional network ID filtering.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-compute-hosts + **Return the client details in an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-search - organizationId (string): Organization ID - - developerName (string): Filters hosts by application developer name - - applicationName (string): Filters hosts by application name + - mac (string): The MAC address of the client. Required. - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 5. Default is 5. - 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): Filters hosts by the network ID they belong to """ kwargs.update(locals()) metadata = { - "tags": ["organizations", "configure", "compute", "hosts"], - "operation": "getOrganizationComputeHosts", + "tags": ["organizations", "configure", "clients", "search"], + "operation": "getOrganizationClientsSearch", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/compute/hosts" + resource = f"/organizations/{organizationId}/clients/search" query_params = [ "perPage", "startingAfter", "endingBefore", - "developerName", - "applicationName", - "networkIds", + "mac", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - array_params = [ - "networkIds", + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"getOrganizationClientsSearch: ignoring unrecognized kwargs: {invalid}") + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def cloneOrganization(self, organizationId: str, name: str, **kwargs): + """ + **Create a new organization by cloning the addressed organization** + https://developer.cisco.com/meraki/api-v1/#!clone-organization + + - organizationId (string): Organization ID + - name (string): The name of the new organization + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure"], + "operation": "cloneOrganization", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/clone" + + body_params = [ + "name", ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationComputeHosts: ignoring unrecognized kwargs: {invalid}") + self._session._logger.warning(f"cloneOrganization: ignoring unrecognized kwargs: {invalid}") - return self._session.get_pages(metadata, resource, params, total_pages, direction) + return self._session.post(metadata, resource, payload) def getOrganizationConfigTemplates(self, organizationId: str): """ @@ -5166,26 +2632,10 @@ def getOrganizationDevicesAvailabilitiesChangeHistory( - productTypes (array): Optional parameter to filter device availabilities history by device product types - networkIds (array): Optional parameter to filter device availabilities history by network IDs - statuses (array): Optional parameter to filter device availabilities history by device statuses - - categories (array): Optional parameter to filter device availabilities history by categories of status, reboot, or upgrade - - networkTags (array): Optional parameter to filter device availabilities history by network tags. The filtering is case-sensitive. If tags are included, 'networkTagsFilterType' should also be included (see below). - - networkTagsFilterType (string): An 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. - - deviceTags (array): Optional parameter to filter device availabilities history by device tags. The filtering is case-sensitive. If tags are included, 'deviceTagsFilterType' should also be included (see below). - - deviceTagsFilterType (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. """ kwargs.update(locals()) - if "networkTagsFilterType" in kwargs: - options = ["withAllTags", "withAnyTags"] - assert kwargs["networkTagsFilterType"] in options, ( - f'''"networkTagsFilterType" cannot be "{kwargs["networkTagsFilterType"]}", & must be set to one of: {options}''' - ) - if "deviceTagsFilterType" in kwargs: - options = ["withAllTags", "withAnyTags"] - assert kwargs["deviceTagsFilterType"] in options, ( - f'''"deviceTagsFilterType" cannot be "{kwargs["deviceTagsFilterType"]}", & must be set to one of: {options}''' - ) - metadata = { "tags": ["organizations", "monitor", "devices", "availabilities", "changeHistory"], "operation": "getOrganizationDevicesAvailabilitiesChangeHistory", @@ -5202,140 +2652,16 @@ def getOrganizationDevicesAvailabilitiesChangeHistory( "timespan", "serials", "productTypes", - "networkIds", - "statuses", - "categories", - "networkTags", - "networkTagsFilterType", - "deviceTags", - "deviceTagsFilterType", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "serials", - "productTypes", - "networkIds", - "statuses", - "categories", - "networkTags", - "deviceTags", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesAvailabilitiesChangeHistory: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationDevicesBootsHistory(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Returns the history of device boots in reverse chronological order (most recent first)** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-boots-history - - - 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 - - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 730 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 730 days. - - serials (array): Optional parameter to filter device by device serial numbers. This filter uses multiple exact matches. - - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, campusGateway, and secureConnect. - - mostRecentPerDevice (boolean): If true, only the most recent boot for each device is returned. - - 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. - - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'descending'. - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["ascending", "descending"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "devices", "boots", "history"], - "operation": "getOrganizationDevicesBootsHistory", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/boots/history" - - query_params = [ - "t0", - "t1", - "timespan", - "serials", - "productTypes", - "mostRecentPerDevice", - "perPage", - "startingAfter", - "endingBefore", - "sortOrder", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "serials", - "productTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationDevicesBootsHistory: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationDevicesBootsOverviewByDevice(self, organizationId: str, **kwargs): - """ - **Summarizes device reboots across an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-boots-overview-by-device - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - 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. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "devices", "boots", "overview", "byDevice"], - "operation": "getOrganizationDevicesBootsOverviewByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/boots/overview/byDevice" - - query_params = [ - "networkIds", - "productTypes", - "t0", - "t1", - "timespan", + "networkIds", + "statuses", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "networkIds", + "serials", "productTypes", + "networkIds", + "statuses", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -5347,10 +2673,10 @@ def getOrganizationDevicesBootsOverviewByDevice(self, organizationId: str, **kwa invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationDevicesBootsOverviewByDevice: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationDevicesAvailabilitiesChangeHistory: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) def getOrganizationDevicesCellularDataDevices(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ @@ -5950,64 +3276,6 @@ def getOrganizationDevicesCellularUplinksTowersByDevice( return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationDevicesCertificates(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List device certificates for the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-certificates - - - 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): Device serial numbers to filter by (exact match; duplicates are ignored) - - featureTypes (array): Feature types these device certificates serve (exact match; e.g., radsec, openroaming, zigbee) - - sortBy (string): Field to sort by (default: authorityId) - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["authorityId", "featureType", "status"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "devices", "certificates"], - "operation": "getOrganizationDevicesCertificates", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/certificates" - - query_params = [ - "serials", - "featureTypes", - "sortBy", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "serials", - "featureTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationDevicesCertificates: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def createOrganizationDevicesControllerMigration(self, organizationId: str, serials: list, target: str, **kwargs): """ **Migrate devices to another controller or management mode** @@ -6142,56 +3410,6 @@ def bulkUpdateOrganizationDevicesDetails(self, organizationId: str, serials: lis return self._session.post(metadata, resource, payload) - def getOrganizationDevicesMemoryByDevice(self, organizationId: str, networkIds: list, productTypes: list, **kwargs): - """ - **Summarizes memory status across devices of a given network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-memory-by-device - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - productTypes (array): Parameter to filter device availabilities by device product types. This filter uses multiple exact matches. - - usageThreshold (number): Threshold of device memory utilization expressed as a percent. Filters out all devices below this value. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 1 hour and be less than or equal to 7 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "devices", "memory", "byDevice"], - "operation": "getOrganizationDevicesMemoryByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/memory/byDevice" - - query_params = [ - "networkIds", - "productTypes", - "usageThreshold", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "productTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationDevicesMemoryByDevice: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - def getOrganizationDevicesOverviewByModel(self, organizationId: str, **kwargs): """ **Lists the count for each device model** @@ -6526,65 +3744,6 @@ def stopOrganizationDevicesPacketCaptureCapture(self, organizationId: str, captu return self._session.post(metadata, resource, payload) - def getOrganizationDevicesPacketCaptureOpportunisticByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the Opportunistic Pcap settings of an organization by network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-packet-capture-opportunistic-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter results by network. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'descending'. - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["ascending", "descending"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "devices", "packetCapture", "opportunistic", "byNetwork"], - "operation": "getOrganizationDevicesPacketCaptureOpportunisticByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/packetCapture/opportunistic/byNetwork" - - query_params = [ - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - "sortOrder", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesPacketCaptureOpportunisticByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationDevicesPacketCaptureSchedules(self, organizationId: str, **kwargs): """ **List the Packet Capture Schedules** @@ -6677,39 +3836,6 @@ def createOrganizationDevicesPacketCaptureSchedule(self, organizationId: str, de return self._session.post(metadata, resource, payload) - def bulkOrganizationDevicesPacketCaptureSchedulesDelete(self, organizationId: str, scheduleIds: list, **kwargs): - """ - **Delete packet capture schedules** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-devices-packet-capture-schedules-delete - - - organizationId (string): Organization ID - - scheduleIds (array): Delete the packet capture schedules of the specified schedule ids - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "devices", "packetCapture", "schedules"], - "operation": "bulkOrganizationDevicesPacketCaptureSchedulesDelete", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/packetCapture/schedules/bulkDelete" - - body_params = [ - "scheduleIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"bulkOrganizationDevicesPacketCaptureSchedulesDelete: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - def reorderOrganizationDevicesPacketCaptureSchedules(self, organizationId: str, order: list, **kwargs): """ **Bulk update priorities of pcap schedules** @@ -6796,133 +3922,20 @@ def deleteOrganizationDevicesPacketCaptureSchedule(self, organizationId: str, sc https://developer.cisco.com/meraki/api-v1/#!delete-organization-devices-packet-capture-schedule - organizationId (string): Organization ID - - scheduleId (string): Delete the capture schedules of the specified capture schedule id - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "devices", "packetCapture", "schedules"], - "operation": "deleteOrganizationDevicesPacketCaptureSchedule", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - scheduleId = urllib.parse.quote(str(scheduleId), safe="") - resource = f"/organizations/{organizationId}/devices/packetCapture/schedules/{scheduleId}" - - return self._session.delete(metadata, resource) - - def tasksOrganizationDevicesPacketCapture(self, organizationId: str, packetId: str, task: str, **kwargs): - """ - **Enqueues a task for a specific packet capture** - https://developer.cisco.com/meraki/api-v1/#!tasks-organization-devices-packet-capture - - - organizationId (string): Organization ID - - packetId (string): Packet ID - - task (string): Type of task to enqueue. It can be one of: ["analysis", "reasoning", "summary", "highlights", "title", "flow"] - - networkId (string): Parameter to validate authorization by network access - """ - - kwargs.update(locals()) - - if "task" in kwargs: - options = ["analysis", "flow", "highlights", "reasoning", "summary", "title"] - assert kwargs["task"] in options, f'''"task" cannot be "{kwargs["task"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["organizations", "configure", "devices", "packetCaptures"], - "operation": "tasksOrganizationDevicesPacketCapture", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - packetId = urllib.parse.quote(str(packetId), safe="") - resource = f"/organizations/{organizationId}/devices/packetCaptures/{packetId}/tasks" - - body_params = [ - "networkId", - "task", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"tasksOrganizationDevicesPacketCapture: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationDevicesPacketCaptureTask(self, organizationId: str, packetId: str, id: str, **kwargs): - """ - **Retrieves packet capture analysis result for a specific packet capture task.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-packet-capture-task - - - organizationId (string): Organization ID - - packetId (string): Packet ID - - id (string): ID - - networkId (string): Optional parameter to validate authorization by network access - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "devices", "packetCaptures", "tasks"], - "operation": "getOrganizationDevicesPacketCaptureTask", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - packetId = urllib.parse.quote(str(packetId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/devices/packetCaptures/{packetId}/tasks/{id}" - - query_params = [ - "networkId", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesPacketCaptureTask: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def bulkOrganizationDevicesPlacementPositionsUpdate(self, organizationId: str, serials: list, **kwargs): - """ - **Bulk update the attributes related to positions for provided devices** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-devices-placement-positions-update - - - organizationId (string): Organization ID - - serials (array): List of device serials on a floor plan to update - - height (object): Height of the devices on the floor plan - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "devices", "placement", "positions"], - "operation": "bulkOrganizationDevicesPlacementPositionsUpdate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/placement/positions/bulkUpdate" - - body_params = [ - "serials", - "height", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"bulkOrganizationDevicesPlacementPositionsUpdate: ignoring unrecognized kwargs: {invalid}" - ) + - scheduleId (string): Delete the capture schedules of the specified capture schedule id + """ - return self._session.post(metadata, resource, payload) + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "devices", "packetCapture", "schedules"], + "operation": "deleteOrganizationDevicesPacketCaptureSchedule", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + scheduleId = urllib.parse.quote(str(scheduleId), safe="") + resource = f"/organizations/{organizationId}/devices/packetCapture/schedules/{scheduleId}" + + return self._session.delete(metadata, resource) def getOrganizationDevicesPowerModulesStatusesByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs @@ -7065,216 +4078,6 @@ def getOrganizationDevicesProvisioningStatuses(self, organizationId: str, total_ return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationDevicesSoftwareUpdatesOverviewsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns details about software updates for networks within an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-software-updates-overviews-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 30. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'ascending'. - - sortKey (string): Specify key to order the list of networks. - - configSource (string): Limit the list of networks to those that contain devices with the specified config source - - networkIds (array): Limit the list of networks to those that match the provided network IDs - - networkGroupIds (array): Limit the list of networks to those that belong to one of the provided network group IDs. - - productTypes (array): Limit the list of product types included for each network - - networkName (string): Limit the list of networks to those whose name contains the given search string. - - versionIds (array): Limit the list of networks to those that are currently on one of the provided version IDs. - - firmwareStatus (string): Limit the list of networks to those whose current firmware version has the specified end-of-support status. - - firmwareType (string): Limit the list of networks to those whose current firmware version has the specified release type. - - upgradeDependencyIds (array): Limit the list of networks to those that belong to one of the provided upgrade dependencies. - - upgradeAvailable (boolean): Limit the list of networks by upgrade availability. - - templateRole (string): Limit the list of networks by config template role: non-template only, templates only, or templates and bound networks. - """ - - kwargs.update(locals()) - - if "sortOrder" in kwargs: - options = ["ascending", "descending"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - if "sortKey" in kwargs: - options = [ - "availability", - "currentVersion", - "firmwareStatus", - "firmwareType", - "lastUpgrade", - "networkGroup", - "networkName", - "networkType", - "scheduledTime", - "scheduledUpgradeVersion", - "upgradeDependency", - ] - assert kwargs["sortKey"] in options, ( - f'''"sortKey" cannot be "{kwargs["sortKey"]}", & must be set to one of: {options}''' - ) - if "configSource" in kwargs: - options = ["cloud", "local"] - assert kwargs["configSource"] in options, ( - f'''"configSource" cannot be "{kwargs["configSource"]}", & must be set to one of: {options}''' - ) - if "firmwareStatus" in kwargs: - options = ["critical", "good", "warning"] - assert kwargs["firmwareStatus"] in options, ( - f'''"firmwareStatus" cannot be "{kwargs["firmwareStatus"]}", & must be set to one of: {options}''' - ) - if "firmwareType" in kwargs: - options = ["beta", "candidate", "stable"] - assert kwargs["firmwareType"] in options, ( - f'''"firmwareType" cannot be "{kwargs["firmwareType"]}", & must be set to one of: {options}''' - ) - if "templateRole" in kwargs: - options = ["bound-templates", "non-template", "templates"] - assert kwargs["templateRole"] in options, ( - f'''"templateRole" cannot be "{kwargs["templateRole"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "devices", "software", "updates", "overviews", "byNetwork"], - "operation": "getOrganizationDevicesSoftwareUpdatesOverviewsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/software/updates/overviews/byNetwork" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "sortOrder", - "sortKey", - "configSource", - "networkIds", - "networkGroupIds", - "productTypes", - "networkName", - "versionIds", - "firmwareStatus", - "firmwareType", - "upgradeDependencyIds", - "upgradeAvailable", - "templateRole", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "networkGroupIds", - "productTypes", - "versionIds", - "upgradeDependencyIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesSoftwareUpdatesOverviewsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationDevicesSoftwareVersions(self, organizationId: str, releaseType: str, **kwargs): - """ - **List the available software upgrade versions for an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-software-versions - - - organizationId (string): Organization ID - - releaseType (string): Filter by release type - """ - - kwargs = locals() - - if "releaseType" in kwargs: - options = ["beta", "generallyAvailable", "recommended"] - assert kwargs["releaseType"] in options, ( - f'''"releaseType" cannot be "{kwargs["releaseType"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "configure", "devices", "software", "versions"], - "operation": "getOrganizationDevicesSoftwareVersions", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/software/versions" - - query_params = [ - "releaseType", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesSoftwareVersions: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationDevicesSoftwareVersionsChangelogs(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Provide changelogs for specified versions or, if unspecified, for all versions in the organization, including reference to the last and next versions.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-software-versions-changelogs - - - 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 - - versionIds (array): Array of version IDs for filtering - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 30. - - 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": ["organizations", "configure", "devices", "software", "versions", "changelogs"], - "operation": "getOrganizationDevicesSoftwareVersionsChangelogs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/software/versions/changelogs" - - query_params = [ - "versionIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "versionIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesSoftwareVersionsChangelogs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationDevicesStatuses(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **List the status of every Meraki device in the organization** @@ -7293,7 +4096,6 @@ def getOrganizationDevicesStatuses(self, organizationId: str, total_pages=1, dir - 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. - - configurationUpdatedAfter (string): Optional parameter to filter results by whether or not the device's configuration has been updated after the given timestamp """ kwargs.update(locals()) @@ -7322,7 +4124,6 @@ def getOrganizationDevicesStatuses(self, organizationId: str, total_pages=1, dir "models", "tags", "tagsFilterType", - "configurationUpdatedAfter", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} @@ -7536,152 +4337,22 @@ def getOrganizationDevicesSystemMemoryUsageHistoryByInterval( ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - array_params = [ - "networkIds", - "serials", - "productTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesSystemMemoryUsageHistoryByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationDevicesTopologyInterfaces(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List topology interfaces in an organization, including layer 2 and layer 3 metadata when available.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-topology-interfaces - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter interfaces by network ID. This filter uses multiple exact matches. Query array syntax follows the standard bracket form, for example: networkIds[]=L_1234&networkIds[]=L_5678. - - serials (array): Optional parameter to filter interfaces by device serial. This filter uses multiple exact matches. Query array syntax follows the standard bracket form, for example: serials[]=Q234-ABCD-5678&serials[]=Q234-ABCD-9012. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "devices", "topology", "interfaces"], - "operation": "getOrganizationDevicesTopologyInterfaces", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/topology/interfaces" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesTopologyInterfaces: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationDevicesTopologyL2Links(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List layer 2 topology links originating from devices in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-topology-l-2-links - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 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": ["organizations", "monitor", "devices", "topology", "l2", "links"], - "operation": "getOrganizationDevicesTopologyL2Links", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/topology/l2/links" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationDevicesTopologyL2Links: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationDevicesTopologyNodesDiscovered(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List topology nodes discovered by LLDP/CDP from devices in an organization, including reported metadata when available.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-topology-nodes-discovered - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 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": ["organizations", "monitor", "devices", "topology", "nodes", "discovered"], - "operation": "getOrganizationDevicesTopologyNodesDiscovered", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/devices/topology/nodes/discovered" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - + array_params = [ + "networkIds", + "serials", + "productTypes", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + if self._session._validate_kwargs: - all_params = query_params + all_params = query_params + array_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationDevicesTopologyNodesDiscovered: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationDevicesSystemMemoryUsageHistoryByInterval: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) @@ -7941,248 +4612,6 @@ def deleteOrganizationEarlyAccessFeaturesOptIn(self, organizationId: str, optInI return self._session.delete(metadata, resource) - def updateOrganizationExtensionsSdwanmanagerInterconnect( - self, organizationId: str, interconnectId: str, name: str, status: str, **kwargs - ): - """ - **Update name and status of an Interconnect** - https://developer.cisco.com/meraki/api-v1/#!update-organization-extensions-sdwanmanager-interconnect - - - organizationId (string): Organization ID - - interconnectId (string): Interconnect ID - - name (string): Interconnect name - - status (string): Interconnect status - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "extensions", "sdwanmanager", "interconnects"], - "operation": "updateOrganizationExtensionsSdwanmanagerInterconnect", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - interconnectId = urllib.parse.quote(str(interconnectId), safe="") - resource = f"/organizations/{organizationId}/extensions/sdwanmanager/interconnects/{interconnectId}" - - body_params = [ - "name", - "status", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationExtensionsSdwanmanagerInterconnect: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def getOrganizationExtensionsThousandEyesNetworks(self, organizationId: str): - """ - **List the ThousandEyes agent configurations under this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-extensions-thousand-eyes-networks - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "extensions", "thousandEyes", "networks"], - "operation": "getOrganizationExtensionsThousandEyesNetworks", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/networks" - - return self._session.get(metadata, resource) - - def createOrganizationExtensionsThousandEyesNetwork(self, organizationId: str, enabled: bool, networkId: str, **kwargs): - """ - **Add a ThousandEyes agent for this network** - https://developer.cisco.com/meraki/api-v1/#!create-organization-extensions-thousand-eyes-network - - - organizationId (string): Organization ID - - enabled (boolean): Whether or not the ThousandEyes agent is enabled for the network. - - networkId (string): Network that will have the ThousandEyes agent installed on. - - tests (array): An array of tests to be created - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "extensions", "thousandEyes", "networks"], - "operation": "createOrganizationExtensionsThousandEyesNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/networks" - - body_params = [ - "enabled", - "networkId", - "tests", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationExtensionsThousandEyesNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationExtensionsThousandEyesNetworksSupported( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List all the networks eligible for ThousandEyes agent activation under this organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-extensions-thousand-eyes-networks-supported - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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. - - agentInstalled (boolean): Set to true to get only networks with installed ThousandEyes agent; set to false to get networks without agents. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "extensions", "thousandEyes", "networks", "supported"], - "operation": "getOrganizationExtensionsThousandEyesNetworksSupported", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/networks/supported" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "agentInstalled", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationExtensionsThousandEyesNetworksSupported: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationExtensionsThousandEyesNetwork(self, organizationId: str, networkId: str): - """ - **List the ThousandEyes agent configuration under this network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-extensions-thousand-eyes-network - - - organizationId (string): Organization ID - - networkId (string): Network ID - """ - - metadata = { - "tags": ["organizations", "configure", "extensions", "thousandEyes", "networks"], - "operation": "getOrganizationExtensionsThousandEyesNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/networks/{networkId}" - - return self._session.get(metadata, resource) - - def updateOrganizationExtensionsThousandEyesNetwork(self, organizationId: str, networkId: str, enabled: bool, **kwargs): - """ - **Update a ThousandEyes agent from this network** - https://developer.cisco.com/meraki/api-v1/#!update-organization-extensions-thousand-eyes-network - - - organizationId (string): Organization ID - - networkId (string): Network ID - - enabled (boolean): Whether or not the ThousandEyes agent is enabled for the network. - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "extensions", "thousandEyes", "networks"], - "operation": "updateOrganizationExtensionsThousandEyesNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/networks/{networkId}" - - body_params = [ - "enabled", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationExtensionsThousandEyesNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationExtensionsThousandEyesNetwork(self, organizationId: str, networkId: str): - """ - **Delete a ThousandEyes agent from this network** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-extensions-thousand-eyes-network - - - organizationId (string): Organization ID - - networkId (string): Network ID - """ - - metadata = { - "tags": ["organizations", "configure", "extensions", "thousandEyes", "networks"], - "operation": "deleteOrganizationExtensionsThousandEyesNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/networks/{networkId}" - - return self._session.delete(metadata, resource) - - def createOrganizationExtensionsThousandEyesTest(self, organizationId: str, **kwargs): - """ - **Create a ThousandEyes test based on a provided test template** - https://developer.cisco.com/meraki/api-v1/#!create-organization-extensions-thousand-eyes-test - - - organizationId (string): Organization ID - - tests (array): An array of tests to be created - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "extensions", "thousandEyes", "tests"], - "operation": "createOrganizationExtensionsThousandEyesTest", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/extensions/thousandEyes/tests" - - body_params = [ - "tests", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationExtensionsThousandEyesTest: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - def getOrganizationFirmwareUpgrades(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Get firmware upgrade information for an organization** @@ -8384,111 +4813,23 @@ def getOrganizationFloorPlansAutoLocateStatuses(self, organizationId: str, total params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "networkIds", - "floorPlanIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationFloorPlansAutoLocateStatuses: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAccessGroups(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List effective Catalyst Center access groups for the requested Catalyst Center administrators in the specified organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-access-groups - - - 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): Number of access groups to return per page. Range: 1-50. Defaults to 50 when omitted. - - startingAfter (string): Cursor token to retrieve access groups after the specified access group identifier. - - endingBefore (string): Cursor token to retrieve access groups before the specified access group identifier. - - assignedAdminEmails (array): Catalyst Center administrator email addresses used by federation to filter access groups for the requested administrators. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "iam", "admins", "accessGroups"], - "operation": "getOrganizationAccessGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/admins/accessGroups" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "assignedAdminEmails", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "assignedAdminEmails", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationAccessGroups: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def resolveOrganizationIamAdminsAdministratorsMePermissions( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the authenticated caller admin's permissions for an organization** - https://developer.cisco.com/meraki/api-v1/#!resolve-organization-iam-admins-administrators-me-permissions - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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": ["organizations", "configure", "iam", "admins", "administrators", "me", "permissions"], - "operation": "resolveOrganizationIamAdminsAdministratorsMePermissions", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/admins/administrators/me/permissions/resolve" - - body_params = [ - "perPage", - "startingAfter", - "endingBefore", + "networkIds", + "floorPlanIds", ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) if self._session._validate_kwargs: - all_params = [] + body_params + all_params = query_params + array_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"resolveOrganizationIamAdminsAdministratorsMePermissions: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationFloorPlansAutoLocateStatuses: ignoring unrecognized kwargs: {invalid}" ) - return self._session.post(metadata, resource, payload) + return self._session.get_pages(metadata, resource, params, total_pages, direction) def getOrganizationIntegrationsDeployable(self, organizationId: str): """ @@ -8759,61 +5100,6 @@ def getOrganizationInventoryDevices(self, organizationId: str, total_pages=1, di return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationInventoryDevicesDetails(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return inventory devices with additional site, geolocation, software, licensing, lifecycle, and Catalyst Center-specific fields** - https://developer.cisco.com/meraki/api-v1/#!get-organization-inventory-devices-details - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 100. - - 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 IDs. Matches devices in any of the provided network IDs. When multiple filter parameters are provided, a device must match each provided filter. Query array syntax follows the standard bracket form, for example: networkIds[]=L_1234&networkIds[]=L_5678. Maximum 100 network IDs. - - serials (array): Optional parameter to filter devices by serials. Matches devices with any of the provided serials. When multiple filter parameters are provided, a device must match each provided filter. Query array syntax follows the standard bracket form, for example: serials[]=Q234-ABCD-5678&serials[]=Q234-ABCD-9012. Maximum 100 serials. - - productTypes (array): Optional parameter to filter devices by product type. Matches devices with any of the provided product types. When multiple filter parameters are provided, a device must match each provided filter. Query array syntax follows the standard bracket form, for example: productTypes[]=switch&productTypes[]=wireless. Maximum 100 product types. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "inventory", "devices", "details"], - "operation": "getOrganizationInventoryDevicesDetails", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/inventory/devices/details" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - "productTypes", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "productTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationInventoryDevicesDetails: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationInventoryDevicesEoxOverview(self, organizationId: str): """ **Fetch the EOX summary for an organization, including counts of devices that are end-of-sale, end-of-support, and end-of-support-soon.** @@ -9401,7 +5687,6 @@ def createOrganizationNetwork(self, organizationId: str, name: str, productTypes - timeZone (string): The timezone of the network. For a list of allowed timezones, please see the 'TZ' column in the table in this article. - copyFromNetworkId (string): The ID of the network to copy configuration from. Other provided parameters will override the copied configuration, except type which must match this network's type exactly. - notes (string): Add any notes or additional information about this network here. - - details (array): An array of details """ kwargs.update(locals()) @@ -9416,256 +5701,10 @@ def createOrganizationNetwork(self, organizationId: str, name: str, productTypes body_params = [ "name", "productTypes", - "tags", - "timeZone", - "copyFromNetworkId", - "notes", - "details", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationNetwork: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def combineOrganizationNetworks(self, organizationId: str, name: str, networkIds: list, **kwargs): - """ - **Combine multiple networks into a single network** - https://developer.cisco.com/meraki/api-v1/#!combine-organization-networks - - - organizationId (string): Organization ID - - name (string): The name of the combined network - - networkIds (array): A list of the network IDs that will be combined. If an ID of a combined network is included in this list, the other networks in the list will be grouped into that network - - enrollmentString (string): A unique identifier which can be used for device enrollment or easy access through the Meraki SM Registration page or the Self Service Portal. Please note that changing this field may cause existing bookmarks to break. All networks that are part of this combined network will have their enrollment string appended by '-network_type'. If left empty, all exisitng enrollment strings will be deleted. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "networks"], - "operation": "combineOrganizationNetworks", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/networks/combine" - - body_params = [ - "name", - "networkIds", - "enrollmentString", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"combineOrganizationNetworks: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationNetworksGroups(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the network groups in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-networks-groups - - - 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 - - groupIds (array): Optional parameter to filter network groups by ID - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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": ["organizations", "configure", "networks", "groups"], - "operation": "getOrganizationNetworksGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/networks/groups" - - query_params = [ - "groupIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "groupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationNetworksGroups: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationNetworksGroup(self, organizationId: str, name: str, **kwargs): - """ - **Create a network group** - https://developer.cisco.com/meraki/api-v1/#!create-organization-networks-group - - - organizationId (string): Organization ID - - name (string): The name of the network group - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "networks", "groups"], - "operation": "createOrganizationNetworksGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/networks/groups" - - body_params = [ - "name", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationNetworksGroup: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationNetworksGroupsOverviewByGroup(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the client and status overview information for the network groups in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-networks-groups-overview-by-group - - - 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 - - sortBy (string): Field by which to sort the results - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 5000. - - 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()) - - if "sortBy" in kwargs: - options = ["status"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["organizations", "monitor", "networks", "groups", "overview", "byGroup"], - "operation": "getOrganizationNetworksGroupsOverviewByGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/networks/groups/overview/byGroup" - - query_params = [ - "sortBy", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationNetworksGroupsOverviewByGroup: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def updateOrganizationNetworksGroup(self, organizationId: str, groupId: str, name: str, **kwargs): - """ - **Update a network group** - https://developer.cisco.com/meraki/api-v1/#!update-organization-networks-group - - - organizationId (string): Organization ID - - groupId (string): Group ID - - name (string): The new name of the network group - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "networks", "groups"], - "operation": "updateOrganizationNetworksGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/networks/groups/{groupId}" - - body_params = [ - "name", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationNetworksGroup: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationNetworksGroup(self, organizationId: str, groupId: str): - """ - **Delete a network group** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-networks-group - - - organizationId (string): Organization ID - - groupId (string): Group ID - """ - - metadata = { - "tags": ["organizations", "configure", "networks", "groups"], - "operation": "deleteOrganizationNetworksGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/networks/groups/{groupId}" - - return self._session.delete(metadata, resource) - - def bulkOrganizationNetworksGroupAssign(self, organizationId: str, groupId: str, networkIds: list, **kwargs): - """ - **Add networks to a network group** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-networks-group-assign - - - organizationId (string): Organization ID - - groupId (string): Group ID - - networkIds (array): A list of network IDs to add to the network group - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "networks", "groups"], - "operation": "bulkOrganizationNetworksGroupAssign", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/networks/groups/{groupId}/bulkAssign" - - body_params = [ - "networkIds", + "tags", + "timeZone", + "copyFromNetworkId", + "notes", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -9673,32 +5712,34 @@ def bulkOrganizationNetworksGroupAssign(self, organizationId: str, groupId: str, all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning(f"bulkOrganizationNetworksGroupAssign: ignoring unrecognized kwargs: {invalid}") + self._session._logger.warning(f"createOrganizationNetwork: ignoring unrecognized kwargs: {invalid}") return self._session.post(metadata, resource, payload) - def bulkOrganizationNetworksGroupUnassign(self, organizationId: str, groupId: str, networkIds: list, **kwargs): + def combineOrganizationNetworks(self, organizationId: str, name: str, networkIds: list, **kwargs): """ - **Remove networks from a network group** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-networks-group-unassign + **Combine multiple networks into a single network** + https://developer.cisco.com/meraki/api-v1/#!combine-organization-networks - organizationId (string): Organization ID - - groupId (string): Group ID - - networkIds (array): A list of network IDs to remove from the network group + - name (string): The name of the combined network + - networkIds (array): A list of the network IDs that will be combined. If an ID of a combined network is included in this list, the other networks in the list will be grouped into that network + - enrollmentString (string): A unique identifier which can be used for device enrollment or easy access through the Meraki SM Registration page or the Self Service Portal. Please note that changing this field may cause existing bookmarks to break. All networks that are part of this combined network will have their enrollment string appended by '-network_type'. If left empty, all exisitng enrollment strings will be deleted. """ - kwargs = locals() + kwargs.update(locals()) metadata = { - "tags": ["organizations", "configure", "networks", "groups"], - "operation": "bulkOrganizationNetworksGroupUnassign", + "tags": ["organizations", "configure", "networks"], + "operation": "combineOrganizationNetworks", } organizationId = urllib.parse.quote(str(organizationId), safe="") - groupId = urllib.parse.quote(str(groupId), safe="") - resource = f"/organizations/{organizationId}/networks/groups/{groupId}/bulkUnassign" + resource = f"/organizations/{organizationId}/networks/combine" body_params = [ + "name", "networkIds", + "enrollmentString", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -9706,9 +5747,7 @@ def bulkOrganizationNetworksGroupUnassign(self, organizationId: str, groupId: st all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning( - f"bulkOrganizationNetworksGroupUnassign: ignoring unrecognized kwargs: {invalid}" - ) + self._session._logger.warning(f"combineOrganizationNetworks: ignoring unrecognized kwargs: {invalid}") return self._session.post(metadata, resource, payload) @@ -9794,25 +5833,6 @@ def getNetworkMoves(self, organizationId: str, total_pages=1, direction="next", return self._session.get_pages(metadata, resource, params, total_pages, direction) - def deleteOrganizationOpenRoamingCertificate(self, organizationId: str, id: str): - """ - **Delete an open roaming certificate.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-open-roaming-certificate - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["organizations", "configure", "openRoaming", "certificates"], - "operation": "deleteOrganizationOpenRoamingCertificate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/openRoaming/certificates/{id}" - - return self._session.delete(metadata, resource) - def getOrganizationOpenapiSpec(self, organizationId: str, **kwargs): """ **Return the OpenAPI Specification of the organization's API documentation in JSON** @@ -9934,7 +5954,6 @@ def getOrganizationPoliciesGlobalFirewallRulesets(self, organizationId: str, tot - direction (string): direction to paginate, either "next" (default) or "prev" page - rulesetIds (array): Filter rulesets by IDs - name (string): Filter rulesets by name (partial match, case-insensitive). If multiple instances are provided, only the last one is used. - - excludedPolicyIds (array): Filter out rulesets that are associated with the specified policy IDs - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 100. - 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. @@ -9952,7 +5971,6 @@ def getOrganizationPoliciesGlobalFirewallRulesets(self, organizationId: str, tot query_params = [ "rulesetIds", "name", - "excludedPolicyIds", "perPage", "startingAfter", "endingBefore", @@ -9961,7 +5979,6 @@ def getOrganizationPoliciesGlobalFirewallRulesets(self, organizationId: str, tot array_params = [ "rulesetIds", - "excludedPolicyIds", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10482,7 +6499,6 @@ def getOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments( - rulesetIds (array): Filter assignments by ruleset IDs - policyIds (array): Filter assignments by policy IDs - assignmentIds (array): Filter assignments by assignment IDs - - staged (boolean): Filter assignments by whether or not they are staged - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 100. - 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. @@ -10501,7 +6517,6 @@ def getOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments( "rulesetIds", "policyIds", "assignmentIds", - "staged", "perPage", "startingAfter", "endingBefore", @@ -10539,7 +6554,6 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( - rulesetId (string): ID of the ruleset to assign - policyId (string): ID of the policy to assign the ruleset to - priority (integer): Priority of the ruleset assignment (lower numbers = higher priority) - - staged (boolean): Stage an assignment without applying it immediately to the policy """ kwargs.update(locals()) @@ -10555,7 +6569,6 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( "rulesetId", "policyId", "priority", - "staged", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -10569,41 +6582,6 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( return self._session.post(metadata, resource, payload) - def commitOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments( - self, organizationId: str, policy: dict, **kwargs - ): - """ - **Commit staged Organization-Wide Policy Ruleset Assignments** - https://developer.cisco.com/meraki/api-v1/#!commit-organization-policies-global-group-policies-firewall-rulesets-assignments - - - organizationId (string): Organization ID - - policy (object): Policy in which all staged rulesets will be committed - """ - - kwargs = locals() - - metadata = { - "tags": ["organizations", "configure", "policies", "global", "group", "firewall", "rulesets", "assignments"], - "operation": "commitOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/policies/global/group/policies/firewall/rulesets/assignments/commit" - - body_params = [ - "policy", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"commitOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - def updateOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( self, organizationId: str, assignmentId: str, **kwargs ): @@ -11036,185 +7014,6 @@ def deleteOrganizationPolicyObject(self, organizationId: str, policyObjectId: st return self._session.delete(metadata, resource) - def getOrganizationRoutingVrfs(self, organizationId: str, **kwargs): - """ - **List existing organization-wide VRFs (Virtual Routing and Forwarding).** - https://developer.cisco.com/meraki/api-v1/#!get-organization-routing-vrfs - - - organizationId (string): Organization ID - - vrfIds (array): IDs of the desired VRFs. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "routing", "vrfs"], - "operation": "getOrganizationRoutingVrfs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/routing/vrfs" - - query_params = [ - "vrfIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "vrfIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationRoutingVrfs: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def createOrganizationRoutingVrf(self, organizationId: str, name: str, **kwargs): - """ - **Add an organization-wide VRF (Virtual Routing and Forwarding)** - https://developer.cisco.com/meraki/api-v1/#!create-organization-routing-vrf - - - organizationId (string): Organization ID - - name (string): The name of the VRF (Virtual Routing and Forwarding) - - description (string): Description of the VRF (Virtual Routing and Forwarding) - - routeDistinguisher (string): RD (Route Distinguisher) for the VRF (Virtual Routing and Forwarding) - - routeTarget (string): Route target are used to control the import and export of routes between VRFs - - appliance (object): This parameter is used to enable or disable the VRF on the WAN appliance - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "routing", "vrfs"], - "operation": "createOrganizationRoutingVrf", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/routing/vrfs" - - body_params = [ - "name", - "description", - "routeDistinguisher", - "routeTarget", - "appliance", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationRoutingVrf: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationRoutingVrfsOverviewByVrf(self, organizationId: str, **kwargs): - """ - **List existing organization-wide VRFs (Virtual Routing and Forwarding) overviews.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-routing-vrfs-overview-by-vrf - - - organizationId (string): Organization ID - - vrfIds (array): IDs of the desired VRFs. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "routing", "vrfs", "overview", "byVrf"], - "operation": "getOrganizationRoutingVrfsOverviewByVrf", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/routing/vrfs/overview/byVrf" - - query_params = [ - "vrfIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "vrfIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationRoutingVrfsOverviewByVrf: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def updateOrganizationRoutingVrf(self, organizationId: str, vrfId: str, **kwargs): - """ - **Update an organization-wide VRF (Virtual Routing and Forwarding)** - https://developer.cisco.com/meraki/api-v1/#!update-organization-routing-vrf - - - organizationId (string): Organization ID - - vrfId (string): Vrf ID - - name (string): The name of the VRF (Virtual Routing and Forwarding) - - description (string): Description of the VRF (Virtual Routing and Forwarding) - - routeDistinguisher (string): RD (Route Distinguisher) for the VRF (Virtual Routing and Forwarding) - - routeTarget (string): Route target are used to control the import and export of routes between VRFs - - appliance (object): This parameter is used to enable or disable the VRF on the WAN appliance - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "routing", "vrfs"], - "operation": "updateOrganizationRoutingVrf", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - vrfId = urllib.parse.quote(str(vrfId), safe="") - resource = f"/organizations/{organizationId}/routing/vrfs/{vrfId}" - - body_params = [ - "name", - "description", - "routeDistinguisher", - "routeTarget", - "appliance", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationRoutingVrf: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationRoutingVrf(self, organizationId: str, vrfId: str): - """ - **Delete a VRF (Virtual Routing and Forwarding) from a organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-routing-vrf - - - organizationId (string): Organization ID - - vrfId (string): Vrf ID - """ - - metadata = { - "tags": ["organizations", "configure", "routing", "vrfs"], - "operation": "deleteOrganizationRoutingVrf", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - vrfId = urllib.parse.quote(str(vrfId), safe="") - resource = f"/organizations/{organizationId}/routing/vrfs/{vrfId}" - - return self._session.delete(metadata, resource) - def getOrganizationSaml(self, organizationId: str): """ **Returns the SAML SSO enabled settings for an organization.** @@ -11888,114 +7687,9 @@ def updateOrganizationSaseSite(self, organizationId: str, siteId: str, **kwargs) all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationSaseSite: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getOrganizationSites(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Lists unified site resources for an organization across Meraki networks and Catalyst Center sites** - https://developer.cisco.com/meraki/api-v1/#!get-organization-sites - - - 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 - 500. Default is 500. - - 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. - - ids (array): Optional parameter to filter resources by unified resource ID. This filter uses multiple exact matches. - - resourceTypes (array): Optional parameter to filter resources by returned resource type. - - resourceTags (array): Optional parameter to filter resources by tag. By default all provided tags must match. - - resourceName (string): Optional parameter to filter resources by case-insensitive partial name match. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "monitor", "sites"], - "operation": "getOrganizationSites", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sites" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "ids", - "resourceTypes", - "resourceTags", - "resourceName", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "ids", - "resourceTypes", - "resourceTags", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSites: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSitesBuildings(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the buildings belonging to the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-sites-buildings - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter buildings by one or more network IDs - - buildingIds (array): Optional parameter to filter buildings by one or more building IDs - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "sites", "buildings"], - "operation": "getOrganizationSitesBuildings", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sites/buildings" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "buildingIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "buildingIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSitesBuildings: ignoring unrecognized kwargs: {invalid}") + self._session._logger.warning(f"updateOrganizationSaseSite: ignoring unrecognized kwargs: {invalid}") - return self._session.get_pages(metadata, resource, params, total_pages, direction) + return self._session.put(metadata, resource, payload) def getOrganizationSnmp(self, organizationId: str): """ @@ -12068,45 +7762,6 @@ def updateOrganizationSnmp(self, organizationId: str, **kwargs): return self._session.put(metadata, resource, payload) - def getOrganizationSnmpTrapsByNetwork(self, organizationId: str, **kwargs): - """ - **Retrieve the SNMP trap configuration for the networks in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-snmp-traps-by-network - - - organizationId (string): Organization ID - - networkIds (array): An optional parameter to filter SNMP trap configs by network IDs - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "snmp", "traps", "byNetwork"], - "operation": "getOrganizationSnmpTrapsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/snmp/traps/byNetwork" - - query_params = [ - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSnmpTrapsByNetwork: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - def getOrganizationSplashAsset(self, organizationId: str, id: str): """ **Get a Splash Theme Asset** @@ -12257,7 +7912,6 @@ def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, - organizationId (string): Organization ID - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12278,7 +7932,6 @@ def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12404,7 +8057,6 @@ def getOrganizationSummaryTopClientsByUsage(self, organizationId: str, **kwargs) - organizationId (string): Organization ID - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12425,7 +8077,6 @@ def getOrganizationSummaryTopClientsByUsage(self, organizationId: str, **kwargs) query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12453,7 +8104,6 @@ def getOrganizationSummaryTopClientsManufacturersByUsage(self, organizationId: s - organizationId (string): Organization ID - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12474,7 +8124,6 @@ def getOrganizationSummaryTopClientsManufacturersByUsage(self, organizationId: s query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12502,7 +8151,6 @@ def getOrganizationSummaryTopDevicesByUsage(self, organizationId: str, **kwargs) - organizationId (string): Organization ID - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12523,7 +8171,6 @@ def getOrganizationSummaryTopDevicesByUsage(self, organizationId: str, **kwargs) query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12551,7 +8198,6 @@ def getOrganizationSummaryTopDevicesModelsByUsage(self, organizationId: str, **k - organizationId (string): Organization ID - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12572,7 +8218,6 @@ def getOrganizationSummaryTopDevicesModelsByUsage(self, organizationId: str, **k query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12602,7 +8247,6 @@ def getOrganizationSummaryTopNetworksByStatus(self, organizationId: str, total_p - direction (string): direction to paginate, either "next" (default) or "prev" page - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12623,7 +8267,6 @@ def getOrganizationSummaryTopNetworksByStatus(self, organizationId: str, total_p query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12651,7 +8294,6 @@ def getOrganizationSummaryTopSsidsByUsage(self, organizationId: str, **kwargs): - organizationId (string): Organization ID - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12672,7 +8314,6 @@ def getOrganizationSummaryTopSsidsByUsage(self, organizationId: str, **kwargs): query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12700,7 +8341,6 @@ def getOrganizationSummaryTopSwitchesByEnergyUsage(self, organizationId: str, ** - organizationId (string): Organization ID - networkTag (string): Match result to an exact network tag - deviceTag (string): Match result to an exact device tag - - networkId (string): Match result to an exact network id - quantity (integer): Set number of desired results to return. Default is 10. Maximum is 50 - ssidName (string): Filter results by ssid name - usageUplink (string): Filter results by usage uplink @@ -12721,7 +8361,6 @@ def getOrganizationSummaryTopSwitchesByEnergyUsage(self, organizationId: str, ** query_params = [ "networkTag", "deviceTag", - "networkId", "quantity", "ssidName", "usageUplink", @@ -12850,137 +8489,6 @@ def getOrganizationWebhooksCallbacksStatus(self, organizationId: str, callbackId return self._session.get(metadata, resource) - def getOrganizationWebhooksHttpServers(self, organizationId: str): - """ - **List the HTTP servers for this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-webhooks-http-servers - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "webhooks", "httpServers"], - "operation": "getOrganizationWebhooksHttpServers", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/webhooks/httpServers" - - return self._session.get(metadata, resource) - - def createOrganizationWebhooksHttpServer(self, organizationId: str, name: str, url: str, **kwargs): - """ - **Add an HTTP server to an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-webhooks-http-server - - - organizationId (string): Organization ID - - name (string): A name for easy reference to the HTTP server - - url (string): The URL of the HTTP server - - sharedSecret (string): A shared secret that will be included in POSTs sent to the HTTP server. This secret can be used to verify that the request was sent by Meraki. - - payloadTemplate (object): The payload template to use when posting data to the HTTP server. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "webhooks", "httpServers"], - "operation": "createOrganizationWebhooksHttpServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/webhooks/httpServers" - - body_params = [ - "name", - "url", - "sharedSecret", - "payloadTemplate", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationWebhooksHttpServer: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationWebhooksHttpServer(self, organizationId: str, id: str): - """ - **Return an HTTP server for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-webhooks-http-server - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["organizations", "configure", "webhooks", "httpServers"], - "operation": "getOrganizationWebhooksHttpServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/webhooks/httpServers/{id}" - - return self._session.get(metadata, resource) - - def updateOrganizationWebhooksHttpServer(self, organizationId: str, id: str, **kwargs): - """ - **Update an HTTP server for an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-webhooks-http-server - - - organizationId (string): Organization ID - - id (string): ID - - name (string): A name for easy reference to the HTTP server - - url (string): The URL of the HTTP server - - sharedSecret (string): A shared secret that will be included in POSTs sent to the HTTP server. This secret can be used to verify that the request was sent by Meraki. - - payloadTemplate (object): The payload template to use when posting data to the HTTP server. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "webhooks", "httpServers"], - "operation": "updateOrganizationWebhooksHttpServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/webhooks/httpServers/{id}" - - body_params = [ - "name", - "url", - "sharedSecret", - "payloadTemplate", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationWebhooksHttpServer: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationWebhooksHttpServer(self, organizationId: str, id: str): - """ - **Delete an HTTP server from an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-webhooks-http-server - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["organizations", "configure", "webhooks", "httpServers"], - "operation": "deleteOrganizationWebhooksHttpServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/webhooks/httpServers/{id}" - - return self._session.delete(metadata, resource) - def getOrganizationWebhooksLogs(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Return the log of webhook POSTs sent** @@ -13025,206 +8533,3 @@ def getOrganizationWebhooksLogs(self, organizationId: str, total_pages=1, direct self._session._logger.warning(f"getOrganizationWebhooksLogs: ignoring unrecognized kwargs: {invalid}") return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWebhooksPayloadTemplates(self, organizationId: str): - """ - **List the webhook payload templates for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-webhooks-payload-templates - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["organizations", "configure", "webhooks", "payloadTemplates"], - "operation": "getOrganizationWebhooksPayloadTemplates", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/webhooks/payloadTemplates" - - return self._session.get(metadata, resource) - - def createOrganizationWebhooksPayloadTemplate(self, organizationId: str, name: str, **kwargs): - """ - **Create a webhook payload template for an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-webhooks-payload-template - - - organizationId (string): Organization ID - - name (string): The name of the new template - - body (string): The liquid template used for the body of the webhook message. Either `body` or `bodyFile` must be specified. - - headers (array): The liquid template used with the webhook headers. - - bodyFile (string): A file containing liquid template used for the body of the webhook message. Either `body` or `bodyFile` must be specified. - - headersFile (string): A file containing the liquid template used with the webhook headers. - - sharing (object): Information on which entities have access to the template - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "webhooks", "payloadTemplates"], - "operation": "createOrganizationWebhooksPayloadTemplate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/webhooks/payloadTemplates" - - body_params = [ - "name", - "body", - "headers", - "bodyFile", - "headersFile", - "sharing", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationWebhooksPayloadTemplate: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationWebhooksPayloadTemplate(self, organizationId: str, payloadTemplateId: str): - """ - **Get the webhook payload template for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-webhooks-payload-template - - - organizationId (string): Organization ID - - payloadTemplateId (string): Payload template ID - """ - - metadata = { - "tags": ["organizations", "configure", "webhooks", "payloadTemplates"], - "operation": "getOrganizationWebhooksPayloadTemplate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - payloadTemplateId = urllib.parse.quote(str(payloadTemplateId), safe="") - resource = f"/organizations/{organizationId}/webhooks/payloadTemplates/{payloadTemplateId}" - - return self._session.get(metadata, resource) - - def deleteOrganizationWebhooksPayloadTemplate(self, organizationId: str, payloadTemplateId: str): - """ - **Destroy a webhook payload template for an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-webhooks-payload-template - - - organizationId (string): Organization ID - - payloadTemplateId (string): Payload template ID - """ - - metadata = { - "tags": ["organizations", "configure", "webhooks", "payloadTemplates"], - "operation": "deleteOrganizationWebhooksPayloadTemplate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - payloadTemplateId = urllib.parse.quote(str(payloadTemplateId), safe="") - resource = f"/organizations/{organizationId}/webhooks/payloadTemplates/{payloadTemplateId}" - - return self._session.delete(metadata, resource) - - def updateOrganizationWebhooksPayloadTemplate(self, organizationId: str, payloadTemplateId: str, **kwargs): - """ - **Update a webhook payload template for an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-webhooks-payload-template - - - organizationId (string): Organization ID - - payloadTemplateId (string): Payload template ID - - name (string): The name of the template - - body (string): The liquid template used for the body of the webhook message. - - headers (array): The liquid template used with the webhook headers. - - bodyFile (string): A file containing liquid template used for the body of the webhook message. - - headersFile (string): A file containing the liquid template used with the webhook headers. - - sharing (object): Information on which entities have access to the template - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "webhooks", "payloadTemplates"], - "operation": "updateOrganizationWebhooksPayloadTemplate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - payloadTemplateId = urllib.parse.quote(str(payloadTemplateId), safe="") - resource = f"/organizations/{organizationId}/webhooks/payloadTemplates/{payloadTemplateId}" - - body_params = [ - "name", - "body", - "headers", - "bodyFile", - "headersFile", - "sharing", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationWebhooksPayloadTemplate: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def createOrganizationWebhooksWebhookTest(self, organizationId: str, url: str, **kwargs): - """ - **Send a test webhook for an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-webhooks-webhook-test - - - organizationId (string): Organization ID - - url (string): The URL where the test webhook will be sent - - sharedSecret (string): The shared secret the test webhook will send. Optional. Defaults to HTTP server's shared secret. Otherwise, defaults to an empty string. - - payloadTemplateId (string): The ID of the payload template of the test webhook. Defaults to the HTTP server's template ID if one exists for the given URL, or Generic template ID otherwise - - payloadTemplateName (string): The name of the payload template. - - alertTypeId (string): The type of alert which the test webhook will send. Optional. Defaults to insight_app_outage_start. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "webhooks", "webhookTests"], - "operation": "createOrganizationWebhooksWebhookTest", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/webhooks/webhookTests" - - body_params = [ - "url", - "sharedSecret", - "payloadTemplateId", - "payloadTemplateName", - "alertTypeId", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationWebhooksWebhookTest: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationWebhooksWebhookTest(self, organizationId: str, webhookTestId: str): - """ - **Return the status of a webhook test for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-webhooks-webhook-test - - - organizationId (string): Organization ID - - webhookTestId (string): Webhook test ID - """ - - metadata = { - "tags": ["organizations", "configure", "webhooks", "webhookTests"], - "operation": "getOrganizationWebhooksWebhookTest", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - webhookTestId = urllib.parse.quote(str(webhookTestId), safe="") - resource = f"/organizations/{organizationId}/webhooks/webhookTests/{webhookTestId}" - - return self._session.get(metadata, resource) diff --git a/meraki/api/secureConnect.py b/meraki/api/secureConnect.py deleted file mode 100644 index 75a773a..0000000 --- a/meraki/api/secureConnect.py +++ /dev/null @@ -1,1084 +0,0 @@ -import urllib - - -class SecureConnect(object): - def __init__(self, session): - super(SecureConnect, self).__init__() - self._session = session - - def getOrganizationSecureConnectPrivateApplicationGroups( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Provides a list of private application groups for an Organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-private-application-groups - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - nameIncludes (string): Optional parameter to search the application group list by group name, case is ignored - - applicationGroupIds (array): List of application group ids attached to fetch - - sortBy (string): Optional parameter to specify the field used to sort objects. - - sortOrder (string): Optional parameter to specify the sort order. Default value is asc. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["applicationGroupId", "modifiedAt", "name"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplicationGroups"], - "operation": "getOrganizationSecureConnectPrivateApplicationGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplicationGroups" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "nameIncludes", - "applicationGroupIds", - "sortBy", - "sortOrder", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "applicationGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSecureConnectPrivateApplicationGroups: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSecureConnectPrivateApplicationGroup(self, organizationId: str, name: str, **kwargs): - """ - **Creates a group of private applications to apply to policy** - https://developer.cisco.com/meraki/api-v1/#!create-organization-secure-connect-private-application-group - - - organizationId (string): Organization ID - - name (string): Application Group Name. This is required and cannot have any special characters other than spaces and hyphens - - description (string): Optional short description for application group - - applicationIds (array): List of application ids attached to this Private Application Group - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplicationGroups"], - "operation": "createOrganizationSecureConnectPrivateApplicationGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplicationGroups" - - body_params = [ - "name", - "description", - "applicationIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSecureConnectPrivateApplicationGroup: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationSecureConnectPrivateApplicationGroup(self, organizationId: str, id: str, name: str, **kwargs): - """ - **Update an application group in an Organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-secure-connect-private-application-group - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Application Group Name. This is required and cannot have any special characters other than spaces and hyphens - - description (string): Optional short description for application group - - applicationIds (array): List of application ids attached to this Private Application Group - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplicationGroups"], - "operation": "updateOrganizationSecureConnectPrivateApplicationGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplicationGroups/{id}" - - body_params = [ - "name", - "description", - "applicationIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSecureConnectPrivateApplicationGroup: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSecureConnectPrivateApplicationGroup(self, organizationId: str, id: str, **kwargs): - """ - **Deletes private application group from an Organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-secure-connect-private-application-group - - - organizationId (string): Organization ID - - id (string): ID - - force (boolean): Boolean flag to force delete application group, even if application group is in use by one or more rules. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplicationGroups"], - "operation": "deleteOrganizationSecureConnectPrivateApplicationGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplicationGroups/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationSecureConnectPrivateApplicationGroup(self, organizationId: str, id: str): - """ - **Return the details of a specific private application group** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-private-application-group - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["secureConnect", "configure", "privateApplicationGroups"], - "operation": "getOrganizationSecureConnectPrivateApplicationGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplicationGroups/{id}" - - return self._session.get(metadata, resource) - - def getOrganizationSecureConnectPrivateApplications(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Provides a list of private applications for an Organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-private-applications - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - nameIncludes (string): Optional parameter to filter the private applications list by application and associated application group names, case is ignored - - applicationGroupIds (array): Optional parameter for filtering the list of private applications belonging to the application group identified by the given IDs. - - appTypes (array): Optional parameter for filtering the list of private applications by applications that contain at least one destination with the specified accessType value. - - sortBy (string): Optional parameter to specify the field used to sort objects. - - sortOrder (string): Optional parameter to specify the sort order. Default value is asc. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["modifiedAt", "name"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplications"], - "operation": "getOrganizationSecureConnectPrivateApplications", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplications" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "nameIncludes", - "applicationGroupIds", - "appTypes", - "sortBy", - "sortOrder", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "applicationGroupIds", - "appTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSecureConnectPrivateApplications: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSecureConnectPrivateApplication(self, organizationId: str, name: str, destinations: list, **kwargs): - """ - **Adds a new private application to the Organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-secure-connect-private-application - - - organizationId (string): Organization ID - - name (string): Name of Application. This is required and should be unique across all applications for a given organization. Name cannot have any special characters other than spaces and hyphens. - - destinations (array): List of IP address destinations. - - description (string): Optional Text description for Application - - appProtocol (string): Protocol for communication between proxy to private application. Applicable for Browser Based Access only. - - sni (string): Optional SNI. Applicable for Browser Based Access only. SNI should be a valid domain. - - externalFQDN (string): Cisco or Customer Managed URL for Application. Applicable for Browser Based Access only. This field is system generated based on the application name and organization ID and overrides user input in payload. This value must be unique across all applications for a given organization. - - sslVerificationEnabled (boolean): Enable Upstream SSL verification for the internally hosted URL by the customer. Applicable for Browser Based Access only. Default is true. - - applicationGroupIds (array): List of application group ids attached to this Private Application - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplications"], - "operation": "createOrganizationSecureConnectPrivateApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplications" - - body_params = [ - "name", - "description", - "destinations", - "appProtocol", - "sni", - "externalFQDN", - "sslVerificationEnabled", - "applicationGroupIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSecureConnectPrivateApplication: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationSecureConnectPrivateApplication( - self, organizationId: str, id: str, name: str, destinations: list, **kwargs - ): - """ - **Updates a specific private application** - https://developer.cisco.com/meraki/api-v1/#!update-organization-secure-connect-private-application - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of Application. This is required and should be unique across all applications for a given organization. Name cannot have any special characters other than spaces and hyphens. - - destinations (array): List of IP address destinations. - - description (string): Optional Text description for Application - - appProtocol (string): Protocol for communication between proxy to private application. Applicable for Browser Based Access only. - - sni (string): Optional SNI. Applicable for Browser Based Access only. SNI should be a valid domain. - - externalFQDN (string): Cisco or Customer Managed URL for Application. Applicable for Browser Based Access only. This field is system generated based on the application name and organization ID and overrides user input in payload. This value must be unique across all applications for a given organization. - - sslVerificationEnabled (boolean): Enable Upstream SSL verification for the internally hosted URL by the customer. Applicable for Browser Based Access only. Default is true. - - applicationGroupIds (array): List of application group ids attached to this Private Application - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplications"], - "operation": "updateOrganizationSecureConnectPrivateApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplications/{id}" - - body_params = [ - "name", - "description", - "destinations", - "appProtocol", - "sni", - "externalFQDN", - "sslVerificationEnabled", - "applicationGroupIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSecureConnectPrivateApplication: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSecureConnectPrivateApplication(self, organizationId: str, id: str, **kwargs): - """ - **Deletes a specific private application** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-secure-connect-private-application - - - organizationId (string): Organization ID - - id (string): ID - - force (boolean): Boolean flag to force delete application, even if application is in use by one or more rules. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateApplications"], - "operation": "deleteOrganizationSecureConnectPrivateApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplications/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationSecureConnectPrivateApplication(self, organizationId: str, id: str): - """ - **Return the details of a specific private application** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-private-application - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["secureConnect", "configure", "privateApplications"], - "operation": "getOrganizationSecureConnectPrivateApplication", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateApplications/{id}" - - return self._session.get(metadata, resource) - - def getOrganizationSecureConnectPrivateResourceGroups(self, organizationId: str): - """ - **Provides a list of the private resource groups in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-private-resource-groups - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["secureConnect", "configure", "privateResourceGroups"], - "operation": "getOrganizationSecureConnectPrivateResourceGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResourceGroups" - - return self._session.get(metadata, resource) - - def createOrganizationSecureConnectPrivateResourceGroup(self, organizationId: str, name: str, **kwargs): - """ - **Adds a new private resource group to an organization.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-secure-connect-private-resource-group - - - organizationId (string): Organization ID - - name (string): Name of group. This is required and should be unique across all groups for a given organization. Name cannot have any special characters other than spaces and hyphens. - - description (string): Optional text description for a group. - - resourceIds (array): List of resource ids assigned to this group. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateResourceGroups"], - "operation": "createOrganizationSecureConnectPrivateResourceGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResourceGroups" - - body_params = [ - "name", - "description", - "resourceIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSecureConnectPrivateResourceGroup: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationSecureConnectPrivateResourceGroup(self, organizationId: str, id: str, name: str, **kwargs): - """ - **Updates a specific private resource group.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-secure-connect-private-resource-group - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of group. This is required and should be unique across all groups for a given organization. Name cannot have any special characters other than spaces and hyphens. - - description (string): Optional text description for a group. - - resourceIds (array): List of resource ids assigned to this group. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateResourceGroups"], - "operation": "updateOrganizationSecureConnectPrivateResourceGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResourceGroups/{id}" - - body_params = [ - "name", - "description", - "resourceIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSecureConnectPrivateResourceGroup: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSecureConnectPrivateResourceGroup(self, organizationId: str, id: str): - """ - **Deletes a specific private resource group.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-secure-connect-private-resource-group - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["secureConnect", "configure", "privateResourceGroups"], - "operation": "deleteOrganizationSecureConnectPrivateResourceGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResourceGroups/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationSecureConnectPrivateResources(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Provides a list of private resources for an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-private-resources - - - 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 (string): Number of resources to return for a paginated response. - - startingAfter (string): The name of the resource to start after for a paginated response. Use '' for the first page. - - endingBefore (string): The name of the resource to end before for a paginated response. Use '' for the final page. - - sortBy (string): Parameter to specify the field used to sort objects, by default, resources are returned by name asc. - - sortOrder (string): Parameter to specify the direction used to sort objects, by default, resources are returned by name asc. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateResources"], - "operation": "getOrganizationSecureConnectPrivateResources", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResources" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "sortBy", - "sortOrder", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSecureConnectPrivateResources: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSecureConnectPrivateResource( - self, organizationId: str, name: str, accessTypes: list, resourceAddresses: list, **kwargs - ): - """ - **Adds a new private resource to the organization.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-secure-connect-private-resource - - - organizationId (string): Organization ID - - name (string): Name of resource. This is required and should be unique across all resources for a given organization. Name cannot have any special characters other than spaces and hyphens. - - accessTypes (array): List of access types. - - resourceAddresses (array): List of resource addresses Protocols must be unique in this list. - - description (string): Optional text description for a resource. - - resourceGroupIds (array): List of resource group ids attached to this resource. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateResources"], - "operation": "createOrganizationSecureConnectPrivateResource", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResources" - - body_params = [ - "name", - "description", - "accessTypes", - "resourceAddresses", - "resourceGroupIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSecureConnectPrivateResource: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationSecureConnectPrivateResource( - self, organizationId: str, id: str, name: str, accessTypes: list, resourceAddresses: list, **kwargs - ): - """ - **Updates a specific private resource.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-secure-connect-private-resource - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of resource. This is required and should be unique across all resources for a given organization.Name cannot have any special characters other than spaces and hyphens. - - accessTypes (array): List of access types. - - resourceAddresses (array): List of resource addresses Protocols must be unique in this list. - - description (string): Optional text description for resource. - - resourceGroupIds (array): List of resource group ids attached to this resource. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "privateResources"], - "operation": "updateOrganizationSecureConnectPrivateResource", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResources/{id}" - - body_params = [ - "name", - "description", - "accessTypes", - "resourceAddresses", - "resourceGroupIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSecureConnectPrivateResource: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSecureConnectPrivateResource(self, organizationId: str, id: str): - """ - **Deletes a specific private resource** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-secure-connect-private-resource - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["secureConnect", "configure", "privateResources"], - "operation": "deleteOrganizationSecureConnectPrivateResource", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/privateResources/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationSecureConnectPublicApplications(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Provides a list of public applications for an Organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-public-applications - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - nameIncludes (string): Optional parameter to filter the public applications list by application name, case is ignored - - risks (array): List of risk levels to filter by - - categories (array): List of categories to filter by - - appTypes (array): List of app types to filter by - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - - sortBy (string): Optional parameter to specify the field used to sort objects, by default, applications are returned by lastDetected desc - - sortOrder (string): Optional parameter to specify the sort order. Default value is desc. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["appType", "category", "lastDetected", "name", "risk"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["secureConnect", "configure", "publicApplications"], - "operation": "getOrganizationSecureConnectPublicApplications", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/publicApplications" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "nameIncludes", - "risks", - "categories", - "appTypes", - "t0", - "t1", - "timespan", - "sortBy", - "sortOrder", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "risks", - "categories", - "appTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSecureConnectPublicApplications: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSecureConnectRegions(self, organizationId: str, **kwargs): - """ - **List deployed cloud hubs and regions in this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-regions - - - organizationId (string): Organization ID - - regionType (string): Filter results by region type - """ - - kwargs.update(locals()) - - if "regionType" in kwargs: - options = ["CNHE", "CloudHub", "Region", "ThirdParty"] - assert kwargs["regionType"] in options, ( - f'''"regionType" cannot be "{kwargs["regionType"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["secureConnect", "configure", "regions"], - "operation": "getOrganizationSecureConnectRegions", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/regions" - - query_params = [ - "regionType", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSecureConnectRegions: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def getOrganizationSecureConnectRemoteAccessLog(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the latest 5000 events logged by remote access.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-remote-access-log - - - 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 - 5000. 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. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - - identityids (string): An identity ID or comma-delimited list of identity ID. - - identitytypes (string): An identity type or comma-delimited list of identity type. - - connectionevent (string): Specify the type of connection event. - - anyconnectversions (string): Specify a comma-separated list of AnyConnect Roaming Security module - versions to filter the data. - - osversions (string): Specify a comma-separated list of OS versions to filter the data. - """ - - kwargs.update(locals()) - - if "connectionevent" in kwargs: - options = ["connected", "disconnected", "failed"] - assert kwargs["connectionevent"] in options, ( - f'''"connectionevent" cannot be "{kwargs["connectionevent"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["secureConnect", "monitor", "remoteAccessLog"], - "operation": "getOrganizationSecureConnectRemoteAccessLog", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/remoteAccessLog" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "identityids", - "identitytypes", - "connectionevent", - "anyconnectversions", - "osversions", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSecureConnectRemoteAccessLog: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSecureConnectRemoteAccessLogsExports( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Provides a list of remote access logs exports for an Organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-remote-access-logs-exports - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - status (string): Filter exports by status. - """ - - kwargs.update(locals()) - - if "status" in kwargs: - options = ["complete", "continue", "error", "in_progress", "new", "zip"] - assert kwargs["status"] in options, ( - f'''"status" cannot be "{kwargs["status"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["secureConnect", "configure", "remoteAccessLogsExports"], - "operation": "getOrganizationSecureConnectRemoteAccessLogsExports", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/remoteAccessLogsExports" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "status", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSecureConnectRemoteAccessLogsExports: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSecureConnectRemoteAccessLogsExport(self, organizationId: str, **kwargs): - """ - **Creates an export for a provided timestamp interval.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-secure-connect-remote-access-logs-export - - - organizationId (string): Organization ID - - t0 (string): The start of the interval, must be within the past 30 days. Must be provided with t1. - - t1 (string): The end of the interval, must not exceed the current date. Must be provided with t0. - - from (integer): Legacy start of the interval in epoch seconds, must be within the past 30 days. Must be provided with to. - - to (integer): Legacy end of the interval in epoch seconds, must not exceed the current date. Must be provided with from. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "remoteAccessLogsExports"], - "operation": "createOrganizationSecureConnectRemoteAccessLogsExport", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/remoteAccessLogsExports" - - body_params = [ - "t0", - "t1", - "from", - "to", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSecureConnectRemoteAccessLogsExport: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSecureConnectRemoteAccessLogsExportsDownload( - self, organizationId: str, id: str, fileType: str, **kwargs - ): - """ - **Redirects to the download link of the completed export.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-remote-access-logs-exports-download - - - organizationId (string): Organization ID - - id (string): Export ID. - - fileType (string): Export download file type. - """ - - kwargs = locals() - - metadata = { - "tags": ["secureConnect", "configure", "remoteAccessLogsExports", "download"], - "operation": "getOrganizationSecureConnectRemoteAccessLogsExportsDownload", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/remoteAccessLogsExports/download" - - query_params = [ - "id", - "fileType", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSecureConnectRemoteAccessLogsExportsDownload: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationSecureConnectRemoteAccessLogsExport(self, organizationId: str, id: str): - """ - **Return the details of a specific remote access logs export** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-remote-access-logs-export - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["secureConnect", "configure", "remoteAccessLogsExports"], - "operation": "getOrganizationSecureConnectRemoteAccessLogsExport", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/secureConnect/remoteAccessLogsExports/{id}" - - return self._session.get(metadata, resource) - - def getOrganizationSecureConnectSites(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List sites in this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-secure-connect-sites - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - search (string): If provided, filters results by search string - - enrolledState (string): Filter results by sites that have already been enrolled or can be enrolled. Acceptable values are 'enrolled' or 'enrollable - """ - - kwargs.update(locals()) - - if "enrolledState" in kwargs: - options = ["enrollable", "enrolled"] - assert kwargs["enrolledState"] in options, ( - f'''"enrolledState" cannot be "{kwargs["enrolledState"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["secureConnect", "configure", "sites"], - "operation": "getOrganizationSecureConnectSites", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/sites" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "search", - "enrolledState", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSecureConnectSites: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSecureConnectSite(self, organizationId: str, **kwargs): - """ - **Enroll sites in this organization to Secure Connect** - https://developer.cisco.com/meraki/api-v1/#!create-organization-secure-connect-site - - - organizationId (string): Organization ID - - enrollments (array): List of Meraki SD-WAN sites with the associated regions to be enrolled. - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "sites"], - "operation": "createOrganizationSecureConnectSite", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/sites" - - body_params = [ - "enrollments", - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationSecureConnectSite: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def deleteOrganizationSecureConnectSites(self, organizationId: str, **kwargs): - """ - **Detach given sites from Secure Connect** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-secure-connect-sites - - - organizationId (string): Organization ID - - sites (array): List of site IDs to detach - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["secureConnect", "configure", "sites"], - "operation": "deleteOrganizationSecureConnectSites", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/secureConnect/sites" - - return self._session.delete(metadata, resource) diff --git a/meraki/api/sensor.py b/meraki/api/sensor.py index 9c901de..2807976 100644 --- a/meraki/api/sensor.py +++ b/meraki/api/sensor.py @@ -74,10 +74,9 @@ def createDeviceSensorCommand(self, serial: str, operation: str, **kwargs): - serial (string): Serial - operation (string): Operation to run on the sensor. 'enableDownstreamPower', 'disableDownstreamPower', and 'cycleDownstreamPower' turn power on/off to the device that is connected downstream of an MT40 power monitor. 'refreshData' causes an MT15 or MT40 device to upload its latest readings so that they are immediately available in the Dashboard API. - - arguments (array): Additional options to provide to commands run on the sensor, each with a corresponding 'name' and 'value'. """ - kwargs.update(locals()) + kwargs = locals() if "operation" in kwargs: options = ["cycleDownstreamPower", "disableDownstreamPower", "enableDownstreamPower", "refreshData"] @@ -93,7 +92,6 @@ def createDeviceSensorCommand(self, serial: str, operation: str, **kwargs): resource = f"/devices/{serial}/sensor/commands" body_params = [ - "arguments", "operation", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -458,103 +456,6 @@ def getNetworkSensorRelationships(self, networkId: str): return self._session.get(metadata, resource) - def getNetworkSensorSchedules(self, networkId: str): - """ - **Returns a list of all sensor schedules.** - https://developer.cisco.com/meraki/api-v1/#!get-network-sensor-schedules - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["sensor", "configure", "schedules"], - "operation": "getNetworkSensorSchedules", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sensor/schedules" - - return self._session.get(metadata, resource) - - def getOrganizationSensorAlerts(self, organizationId: str, networkIds: list, total_pages=1, direction="next", **kwargs): - """ - **Return a list of sensor alert events** - https://developer.cisco.com/meraki/api-v1/#!get-organization-sensor-alerts - - - organizationId (string): Organization ID - - networkIds (array): Filters alerts by network. For now, this must be a single network ID. - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 365 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 365 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 365 days. The default is 365 days. - - sensorSerial (string): Filters alerts to those triggered by this sensor. - - triggerMetric (string): Filters alerts to those triggered by this metric. - """ - - kwargs.update(locals()) - - if "triggerMetric" in kwargs: - options = [ - "apparentPower", - "co2", - "current", - "door", - "frequency", - "humidity", - "indoorAirQuality", - "noise", - "pm25", - "powerFactor", - "realPower", - "temperature", - "tvoc", - "upstreamPower", - "voltage", - "water", - ] - assert kwargs["triggerMetric"] in options, ( - f'''"triggerMetric" cannot be "{kwargs["triggerMetric"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["sensor", "monitor", "alerts"], - "operation": "getOrganizationSensorAlerts", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sensor/alerts" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "sensorSerial", - "networkIds", - "triggerMetric", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSensorAlerts: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationSensorGatewaysConnectionsLatest(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Returns latest sensor-gateway connectivity data.** @@ -663,72 +564,6 @@ def getOrganizationSensorReadingsHistory(self, organizationId: str, total_pages= return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationSensorReadingsHistoryByInterval(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return all reported readings from sensors in a given timespan, summarized as a series of intervals, sorted by interval start time in descending order** - https://developer.cisco.com/meraki/api-v1/#!get-organization-sensor-readings-history-by-interval - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days, 11 hours, 38 minutes, and 24 seconds from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 730 days, 11 hours, 38 minutes, and 24 seconds after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 730 days, 11 hours, 38 minutes, and 24 seconds. The default is 7 days. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 15, 120, 300, 900, 3600, 14400, 86400, 604800. The default is 86400. Interval is calculated if time params are provided. - - networkIds (array): Optional parameter to filter readings by network. - - serials (array): Optional parameter to filter readings by sensor. - - metrics (array): Types of sensor readings to retrieve. If no metrics are supplied, all available types of readings will be retrieved. - - models (array): Optional parameter to filter readings by one or more models. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["sensor", "monitor", "readings", "history", "byInterval"], - "operation": "getOrganizationSensorReadingsHistoryByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sensor/readings/history/byInterval" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - "networkIds", - "serials", - "metrics", - "models", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "metrics", - "models", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSensorReadingsHistoryByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationSensorReadingsLatest(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Return the latest available reading for each metric from each sensor, sorted by sensor serial** diff --git a/meraki/api/sm.py b/meraki/api/sm.py index e4f811c..c79ab08 100644 --- a/meraki/api/sm.py +++ b/meraki/api/sm.py @@ -894,379 +894,6 @@ def getNetworkSmProfiles(self, networkId: str, **kwargs): return self._session.get(metadata, resource, params) - def getNetworkSmScripts(self, networkId: str): - """ - **List the scripts for this network** - https://developer.cisco.com/meraki/api-v1/#!get-network-sm-scripts - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["sm", "configure", "scripts"], - "operation": "getNetworkSmScripts", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sm/scripts" - - return self._session.get(metadata, resource) - - def createNetworkSmScript(self, networkId: str, name: str, platform: str, **kwargs): - """ - **Create a new script** - https://developer.cisco.com/meraki/api-v1/#!create-network-sm-script - - - networkId (string): Network ID - - name (string): Unique name to identify this script. - - platform (string): Platform that this script will run on. - - scope (string): The target scope of the script. (Either scope or targetGroupId must be present.) - - tags (array): The target tags of the script as an array of strings. Required if scope is one of withAny, withoutAny, withAll, withoutAll. - - targetGroupId (string): The tag target group ID that should be used to scope devices. Either scope or targetGroupId must be present. - - description (string): Description of this script. - - runAsUsername (string): Username that script should run as. - - externalSource (object): Properties for a script provided by a url instead of an upload - - upload (object): Properties for a script provided as an upload instead of a url - - schedule (object): When the script is intended to run - """ - - kwargs.update(locals()) - - if "platform" in kwargs and kwargs["platform"] is not None: - options = ["Windows", "macOS"] - assert kwargs["platform"] in options, ( - f'''"platform" cannot be "{kwargs["platform"]}", & must be set to one of: {options}''' - ) - if "scope" in kwargs: - options = ["all", "none", "withAll", "withAny", "withoutAll", "withoutAny"] - assert kwargs["scope"] in options, f'''"scope" cannot be "{kwargs["scope"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["sm", "configure", "scripts"], - "operation": "createNetworkSmScript", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sm/scripts" - - body_params = [ - "name", - "platform", - "scope", - "tags", - "targetGroupId", - "description", - "runAsUsername", - "externalSource", - "upload", - "schedule", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createNetworkSmScript: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def createNetworkSmScriptsJob(self, networkId: str, scriptId: str, **kwargs): - """ - **Create a job that will run a script on a set of devices** - https://developer.cisco.com/meraki/api-v1/#!create-network-sm-scripts-job - - - networkId (string): Network ID - - scriptId (string): ID of script that should be run on the matching devices - - deviceIds (array): List of device IDs to run that should run this script - - deviceFilter (string): Create job on all devices in-scope or devices that have failed to run this script - """ - - kwargs.update(locals()) - - if "deviceFilter" in kwargs: - options = ["All", "Failed"] - assert kwargs["deviceFilter"] in options, ( - f'''"deviceFilter" cannot be "{kwargs["deviceFilter"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["sm", "configure", "scripts", "jobs"], - "operation": "createNetworkSmScriptsJob", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sm/scripts/jobs" - - body_params = [ - "scriptId", - "deviceIds", - "deviceFilter", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createNetworkSmScriptsJob: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getNetworkSmScriptsJobsStatusesLatestByScriptByInterval(self, networkId: str, **kwargs): - """ - **List the latest script job statuses by script and by interval** - https://developer.cisco.com/meraki/api-v1/#!get-network-sm-scripts-jobs-statuses-latest-by-script-by-interval - - - networkId (string): Network ID - - scriptIds (array): List of script IDs to fetch statuses - - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 180 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 180 days. The default is 1 day. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["sm", "configure", "scripts", "jobs", "statuses", "latest", "byScript", "byInterval"], - "operation": "getNetworkSmScriptsJobsStatusesLatestByScriptByInterval", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sm/scripts/jobs/statuses/latest/byScript/byInterval" - - query_params = [ - "scriptIds", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "scriptIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getNetworkSmScriptsJobsStatusesLatestByScriptByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getNetworkSmScriptsJobsStatusesLatestByScriptAndDevice( - self, networkId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List jobs for a given script and/or device** - https://developer.cisco.com/meraki/api-v1/#!get-network-sm-scripts-jobs-statuses-latest-by-script-and-device - - - networkId (string): Network ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - deviceId (string): Query parameter for filtering the list of script job statuses to those belonging to the specified deviceId. - - scriptId (string): Query parameter for filtering the list of script job statuses to those belonging to the specified script. - - inScopeOnly (boolean): If true, show only job statuses for scripts or devices that are in scope. This only applies when either deviceId or scriptId are given. - - status (string): Query parameter for filtering the list of job statuses to those having the specified status. - - sortOrder (string): Query parameter for specifying the direction of sorting to use for the given sortKey. This param is overridden if startingAfter or endingBefore is provided. - - sortKey (string): Query parameter to sort the script tasks by the value of the specified key. This param is overridden if startingAfter or endingBefore is provided. - - perPage (integer): Number of results to show per page. - - startingAfter (string): A statusId. Start the search cursor after the specified Status record. - - endingBefore (string): A statusId. Search backward with the cursor starting before the specified Status record. - """ - - kwargs.update(locals()) - - if "status" in kwargs: - options = [ - "cancelled", - "command failed", - "completed", - "created", - "enqueued", - "error", - "failed", - "pending", - "running", - "success", - "unknown", - ] - assert kwargs["status"] in options, ( - f'''"status" cannot be "{kwargs["status"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["ascending", "descending"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - if "sortKey" in kwargs: - options = ["completedAt", "createdAt", "enqueuedAt", "status", "updatedAt"] - assert kwargs["sortKey"] in options, ( - f'''"sortKey" cannot be "{kwargs["sortKey"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["sm", "configure", "scripts", "jobs", "statuses", "latest", "byScriptAndDevice"], - "operation": "getNetworkSmScriptsJobsStatusesLatestByScriptAndDevice", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sm/scripts/jobs/statuses/latest/byScriptAndDevice" - - query_params = [ - "deviceId", - "scriptId", - "inScopeOnly", - "status", - "sortOrder", - "sortKey", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getNetworkSmScriptsJobsStatusesLatestByScriptAndDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createNetworkSmScriptsUpload(self, networkId: str, size: str, **kwargs): - """ - **Creates an upload URL that can be used to upload a script** - https://developer.cisco.com/meraki/api-v1/#!create-network-sm-scripts-upload - - - networkId (string): Network ID - - size (string): Size of the file in bytes that will be uploaded. - """ - - kwargs = locals() - - metadata = { - "tags": ["sm", "configure", "scripts", "uploads"], - "operation": "createNetworkSmScriptsUpload", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/sm/scripts/uploads" - - body_params = [ - "size", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createNetworkSmScriptsUpload: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getNetworkSmScript(self, networkId: str, scriptId: str): - """ - **Return a script** - https://developer.cisco.com/meraki/api-v1/#!get-network-sm-script - - - networkId (string): Network ID - - scriptId (string): Script ID - """ - - metadata = { - "tags": ["sm", "configure", "scripts"], - "operation": "getNetworkSmScript", - } - networkId = urllib.parse.quote(str(networkId), safe="") - scriptId = urllib.parse.quote(str(scriptId), safe="") - resource = f"/networks/{networkId}/sm/scripts/{scriptId}" - - return self._session.get(metadata, resource) - - def updateNetworkSmScript(self, networkId: str, scriptId: str, **kwargs): - """ - **Update an existing script** - https://developer.cisco.com/meraki/api-v1/#!update-network-sm-script - - - networkId (string): Network ID - - scriptId (string): Script ID - - name (string): Unique name to identify this script. - - platform (string): Platform that this script will run on. - - scope (string): The target scope of the script. (Either scope or targetGroupId must be present.) - - tags (array): The target tags of the script as an array of strings. Required if scope is one of withAny, withoutAny, withAll, withoutAll. - - targetGroupId (string): The tag target group ID that should be used to scope devices. Either scope or targetGroupId must be present. - - description (string): Description of this script. - - runAsUsername (string): Username that script should run as. - - externalSource (object): Properties for a script provided by a url instead of an upload - - upload (object): Properties for a script provided as an upload instead of a url - - schedule (object): When the script is intended to run - """ - - kwargs.update(locals()) - - if "platform" in kwargs and kwargs["platform"] is not None: - options = ["Windows", "macOS"] - assert kwargs["platform"] in options, ( - f'''"platform" cannot be "{kwargs["platform"]}", & must be set to one of: {options}''' - ) - if "scope" in kwargs: - options = ["all", "none", "withAll", "withAny", "withoutAll", "withoutAny"] - assert kwargs["scope"] in options, f'''"scope" cannot be "{kwargs["scope"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["sm", "configure", "scripts"], - "operation": "updateNetworkSmScript", - } - networkId = urllib.parse.quote(str(networkId), safe="") - scriptId = urllib.parse.quote(str(scriptId), safe="") - resource = f"/networks/{networkId}/sm/scripts/{scriptId}" - - body_params = [ - "name", - "platform", - "scope", - "tags", - "targetGroupId", - "description", - "runAsUsername", - "externalSource", - "upload", - "schedule", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkSmScript: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteNetworkSmScript(self, networkId: str, scriptId: str): - """ - **Delete a script** - https://developer.cisco.com/meraki/api-v1/#!delete-network-sm-script - - - networkId (string): Network ID - - scriptId (string): Script ID - """ - - metadata = { - "tags": ["sm", "configure", "scripts"], - "operation": "deleteNetworkSmScript", - } - networkId = urllib.parse.quote(str(networkId), safe="") - scriptId = urllib.parse.quote(str(scriptId), safe="") - resource = f"/networks/{networkId}/sm/scripts/{scriptId}" - - return self._session.delete(metadata, resource) - def getNetworkSmTargetGroups(self, networkId: str, **kwargs): """ **List the target groups in this network** @@ -1769,187 +1396,6 @@ def getOrganizationSmApnsCert(self, organizationId: str): return self._session.get(metadata, resource) - def createOrganizationSmAppleCloudEnrollmentSyncJob(self, organizationId: str, **kwargs): - """ - **Enqueue a sync job for an ADE account** - https://developer.cisco.com/meraki/api-v1/#!create-organization-sm-apple-cloud-enrollment-sync-job - - - organizationId (string): Organization ID - - adeAccountId (string): ADE Account ID - - fullSync (boolean): Whether or not job is full sync (defaults to full sync) - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["sm", "configure", "apple", "cloudEnrollment", "syncJobs"], - "operation": "createOrganizationSmAppleCloudEnrollmentSyncJob", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sm/apple/cloudEnrollment/syncJobs" - - body_params = [ - "adeAccountId", - "fullSync", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSmAppleCloudEnrollmentSyncJob: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSmAppleCloudEnrollmentSyncJob(self, organizationId: str, syncJobId: str): - """ - **Retrieve the status of an ADE sync job** - https://developer.cisco.com/meraki/api-v1/#!get-organization-sm-apple-cloud-enrollment-sync-job - - - organizationId (string): Organization ID - - syncJobId (string): Sync job ID - """ - - metadata = { - "tags": ["sm", "configure", "apple", "cloudEnrollment", "syncJobs"], - "operation": "getOrganizationSmAppleCloudEnrollmentSyncJob", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - syncJobId = urllib.parse.quote(str(syncJobId), safe="") - resource = f"/organizations/{organizationId}/sm/apple/cloudEnrollment/syncJobs/{syncJobId}" - - return self._session.get(metadata, resource) - - def createOrganizationSmBulkEnrollmentToken(self, organizationId: str, networkId: str, expiresAt: str, **kwargs): - """ - **Create a PccBulkEnrollmentToken** - https://developer.cisco.com/meraki/api-v1/#!create-organization-sm-bulk-enrollment-token - - - organizationId (string): Organization ID - - networkId (string): The id of the associated node_group. - - expiresAt (string): The expiration date. - """ - - kwargs = locals() - - metadata = { - "tags": ["sm", "configure", "bulkEnrollment", "token"], - "operation": "createOrganizationSmBulkEnrollmentToken", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sm/bulkEnrollment/token" - - body_params = [ - "networkId", - "expiresAt", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSmBulkEnrollmentToken: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSmBulkEnrollmentToken(self, organizationId: str, tokenId: str): - """ - **Return a BulkEnrollmentToken** - https://developer.cisco.com/meraki/api-v1/#!get-organization-sm-bulk-enrollment-token - - - organizationId (string): Organization ID - - tokenId (string): Token ID - """ - - metadata = { - "tags": ["sm", "configure", "bulkEnrollment", "token"], - "operation": "getOrganizationSmBulkEnrollmentToken", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - tokenId = urllib.parse.quote(str(tokenId), safe="") - resource = f"/organizations/{organizationId}/sm/bulkEnrollment/token/{tokenId}" - - return self._session.get(metadata, resource) - - def updateOrganizationSmBulkEnrollmentToken(self, organizationId: str, tokenId: str, **kwargs): - """ - **Update a PccBulkEnrollmentToken** - https://developer.cisco.com/meraki/api-v1/#!update-organization-sm-bulk-enrollment-token - - - organizationId (string): Organization ID - - tokenId (string): Token ID - - networkId (string): The id of the associated node_group. - - expiresAt (string): The expiration date. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["sm", "configure", "bulkEnrollment", "token"], - "operation": "updateOrganizationSmBulkEnrollmentToken", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - tokenId = urllib.parse.quote(str(tokenId), safe="") - resource = f"/organizations/{organizationId}/sm/bulkEnrollment/token/{tokenId}" - - body_params = [ - "networkId", - "expiresAt", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSmBulkEnrollmentToken: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSmBulkEnrollmentToken(self, organizationId: str, tokenId: str): - """ - **Delete a PccBulkEnrollmentToken** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-sm-bulk-enrollment-token - - - organizationId (string): Organization ID - - tokenId (string): Token ID - """ - - metadata = { - "tags": ["sm", "configure", "bulkEnrollment", "token"], - "operation": "deleteOrganizationSmBulkEnrollmentToken", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - tokenId = urllib.parse.quote(str(tokenId), safe="") - resource = f"/organizations/{organizationId}/sm/bulkEnrollment/token/{tokenId}" - - return self._session.delete(metadata, resource) - - def getOrganizationSmBulkEnrollmentTokens(self, organizationId: str): - """ - **List all BulkEnrollmentTokens for an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-sm-bulk-enrollment-tokens - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["sm", "configure", "bulkEnrollment", "tokens"], - "operation": "getOrganizationSmBulkEnrollmentTokens", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sm/bulkEnrollment/tokens" - - return self._session.get(metadata, resource) - def updateOrganizationSmSentryPoliciesAssignments(self, organizationId: str, items: list, **kwargs): """ **Update an Organizations Sentry Policies using the provided list** diff --git a/meraki/api/support.py b/meraki/api/support.py deleted file mode 100644 index 9fe7ab7..0000000 --- a/meraki/api/support.py +++ /dev/null @@ -1,24 +0,0 @@ -import urllib - - -class Support(object): - def __init__(self, session): - super(Support, self).__init__() - self._session = session - - def getOrganizationSupportSalesRepresentatives(self, organizationId: str): - """ - **Returns the organization's sales representatives** - https://developer.cisco.com/meraki/api-v1/#!get-organization-support-sales-representatives - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["support", "monitor", "salesRepresentatives"], - "operation": "getOrganizationSupportSalesRepresentatives", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/support/salesRepresentatives" - - return self._session.get(metadata, resource) diff --git a/meraki/api/switch.py b/meraki/api/switch.py index 327f942..86ac6cc 100644 --- a/meraki/api/switch.py +++ b/meraki/api/switch.py @@ -6,17 +6,14 @@ def __init__(self, session): super(Switch, self).__init__() self._session = session - def getDeviceSwitchPorts(self, serial: str, **kwargs): + def getDeviceSwitchPorts(self, serial: str): """ **List the switch ports for a switch** https://developer.cisco.com/meraki/api-v1/#!get-device-switch-ports - serial (string): Serial - - hideDefaultPorts (boolean): Optional flag that, when true, will hide modular switchports that may not be connected to the device at the moment """ - kwargs.update(locals()) - metadata = { "tags": ["switch", "configure", "ports"], "operation": "getDeviceSwitchPorts", @@ -24,18 +21,7 @@ def getDeviceSwitchPorts(self, serial: str, **kwargs): serial = urllib.parse.quote(str(serial), safe="") resource = f"/devices/{serial}/switch/ports" - query_params = [ - "hideDefaultPorts", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getDeviceSwitchPorts: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) + return self._session.get(metadata, resource) def cycleDeviceSwitchPorts(self, serial: str, ports: list, **kwargs): """ @@ -68,46 +54,6 @@ def cycleDeviceSwitchPorts(self, serial: str, ports: list, **kwargs): return self._session.post(metadata, resource, payload) - def updateDeviceSwitchPortsMirror(self, serial: str, source: dict, destination: dict, **kwargs): - """ - **Update a port mirror** - https://developer.cisco.com/meraki/api-v1/#!update-device-switch-ports-mirror - - - serial (string): The switch identifier - - source (object): Source ports mirror configuration - - destination (object): Destination port mirror configuration - - tags (array): Port mirror tags - - role (string): Switch role can be source or destination - - comment (string): My pretty comment - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "mirror"], - "operation": "updateDeviceSwitchPortsMirror", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/switch/ports/mirror" - - body_params = [ - "serial", - "source", - "destination", - "tags", - "role", - "comment", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateDeviceSwitchPortsMirror: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def getDeviceSwitchPortsStatuses(self, serial: str, **kwargs): """ **Return the status for all the ports of a switch** @@ -208,7 +154,6 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - vlan (integer): The VLAN of the switch port. For a trunk port, this is the native VLAN. A null value will clear the value set for trunk ports. - voiceVlan (integer): The voice VLAN of the switch port. Only applicable to access ports. - allowedVlans (string): The VLANs allowed on the switch port. Only applicable to trunk ports. - - activeVlans (string): The VLANs that are active on the switch port. Only applicable to trunk ports. - isolationEnabled (boolean): The isolation status of the switch port. - rstpEnabled (boolean): The rapid spanning tree protocol status. - stpGuard (string): The state of the STP guard ('disabled', 'root guard', 'bpdu guard' or 'loop guard'). @@ -269,7 +214,6 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): "vlan", "voiceVlan", "allowedVlans", - "activeVlans", "isolationEnabled", "rstpEnabled", "stpGuard", @@ -359,12 +303,6 @@ def createDeviceSwitchRoutingInterface(self, serial: str, name: str, **kwargs): - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. - vlanId (integer): The VLAN this L3 interface is on. VLAN must be between 1 and 4094. - defaultGateway (string): The next hop for any traffic that isn't going to a directly connected subnet or over a static route. This IP address must exist in a subnet with a L3 interface. Required if this is the first IPv4 interface. - - isSwitchDefaultGateway (boolean): When true, the switch uses the IPv4 uplink gateway as its IPv4 default gateway. This can only be set if the interface is designated as the IPv4 uplink and the switch is running IOS XE version >= 17.18.3. - - uplinkV4 (boolean): When true, this interface is used as static IPv4 uplink. - - candidateUplinkV4 (boolean): When true, this interface is a UAC candidate for IPv4 Uplink. - - uplinkV6 (boolean): When true, this interface is used as static IPv6 uplink. - - staticV4Dns1 (string): Primary IPv4 DNS server address - - staticV4Dns2 (string): Secondary IPv4 DNS server address - ospfSettings (object): The OSPF routing settings of the interface. - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher @@ -399,12 +337,6 @@ def createDeviceSwitchRoutingInterface(self, serial: str, name: str, **kwargs): "multicastRouting", "vlanId", "defaultGateway", - "isSwitchDefaultGateway", - "uplinkV4", - "candidateUplinkV4", - "uplinkV6", - "staticV4Dns1", - "staticV4Dns2", "ospfSettings", "ipv6", "vrf", @@ -454,12 +386,6 @@ def updateDeviceSwitchRoutingInterface(self, serial: str, interfaceId: str, **kw - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. - vlanId (integer): The VLAN this L3 interface is on. VLAN must be between 1 and 4094. - defaultGateway (string): The next hop for any traffic that isn't going to a directly connected subnet or over a static route. This IP address must exist in a subnet with a L3 interface. Required if this is the first IPv4 interface. - - isSwitchDefaultGateway (boolean): When true, the switch uses the IPv4 uplink gateway as its IPv4 default gateway. This can only be set if the interface is designated as the IPv4 uplink and the switch is running IOS XE version >= 17.18.3. - - uplinkV4 (boolean): When true, this interface is used as static IPv4 uplink. - - candidateUplinkV4 (boolean): When true, this interface is a UAC candidate for IPv4 Uplink. - - uplinkV6 (boolean): When true, this interface is used as static IPv6 uplink. - - staticV4Dns1 (string): Primary IPv4 DNS server address - - staticV4Dns2 (string): Secondary IPv4 DNS server address - ospfSettings (object): The OSPF routing settings of the interface. - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher @@ -491,12 +417,6 @@ def updateDeviceSwitchRoutingInterface(self, serial: str, interfaceId: str, **kw "multicastRouting", "vlanId", "defaultGateway", - "isSwitchDefaultGateway", - "uplinkV4", - "candidateUplinkV4", - "uplinkV6", - "staticV4Dns1", - "staticV4Dns2", "ospfSettings", "ipv6", "vrf", @@ -1468,17 +1388,14 @@ def updateNetworkSwitchDscpToCosMappings(self, networkId: str, mappings: list, * return self._session.put(metadata, resource, payload) - def getNetworkSwitchLinkAggregations(self, networkId: str, **kwargs): + def getNetworkSwitchLinkAggregations(self, networkId: str): """ **List link aggregation groups** https://developer.cisco.com/meraki/api-v1/#!get-network-switch-link-aggregations - networkId (string): Network ID - - serials (array): Optional parameter to filter by device serial numbers. Matches multiple exact serials. """ - kwargs.update(locals()) - metadata = { "tags": ["switch", "configure", "linkAggregations"], "operation": "getNetworkSwitchLinkAggregations", @@ -1486,26 +1403,7 @@ def getNetworkSwitchLinkAggregations(self, networkId: str, **kwargs): networkId = urllib.parse.quote(str(networkId), safe="") resource = f"/networks/{networkId}/switch/linkAggregations" - query_params = [ - "serials", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getNetworkSwitchLinkAggregations: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) + return self._session.get(metadata, resource) def createNetworkSwitchLinkAggregation(self, networkId: str, **kwargs): """ @@ -1515,7 +1413,6 @@ def createNetworkSwitchLinkAggregation(self, networkId: str, **kwargs): - networkId (string): Network ID - switchPorts (array): Array of switch or stack ports for creating aggregation group. Minimum 2 and maximum 8 ports are supported. - switchProfilePorts (array): Array of switch profile ports for creating aggregation group. Minimum 2 and maximum 8 ports are supported. - - esiMhPairId (string): ESI-MH pair ID. Required when creating a downstream aggregation across ESI-MH pair member switches. """ kwargs.update(locals()) @@ -1530,7 +1427,6 @@ def createNetworkSwitchLinkAggregation(self, networkId: str, **kwargs): body_params = [ "switchPorts", "switchProfilePorts", - "esiMhPairId", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1756,126 +1652,6 @@ def updateNetworkSwitchPortSchedule(self, networkId: str, portScheduleId: str, * return self._session.put(metadata, resource, payload) - def getNetworkSwitchPortsProfiles(self, networkId: str): - """ - **List the port profiles in a network** - https://developer.cisco.com/meraki/api-v1/#!get-network-switch-ports-profiles - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "getNetworkSwitchPortsProfiles", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/switch/ports/profiles" - - return self._session.get(metadata, resource) - - def createNetworkSwitchPortsProfile(self, networkId: str, **kwargs): - """ - **Create a port profile in a network** - https://developer.cisco.com/meraki/api-v1/#!create-network-switch-ports-profile - - - networkId (string): Network ID - - name (string): The name of the profile. - - description (string): Text describing the profile. - - tags (array): Space-seperated list of tags - - defaultRadiusProfileName (string): When present, the default RADIUS attribute value for RADIUS-based port profile application - - authentication (object): Authentication settings for RADIUS-based port profile application. - - port (object): Configuration settings for port profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "createNetworkSwitchPortsProfile", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/switch/ports/profiles" - - body_params = [ - "name", - "description", - "tags", - "defaultRadiusProfileName", - "authentication", - "port", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createNetworkSwitchPortsProfile: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def updateNetworkSwitchPortsProfile(self, networkId: str, id: str, **kwargs): - """ - **Update a port profile in a network** - https://developer.cisco.com/meraki/api-v1/#!update-network-switch-ports-profile - - - networkId (string): Network ID - - id (string): ID - - name (string): The name of the profile. - - description (string): Text describing the profile. - - tags (array): Space-seperated list of tags - - defaultRadiusProfileName (string): When present, the default RADIUS attribute value for RADIUS-based port profile application - - authentication (object): Authentication settings for RADIUS-based port profile application. - - port (object): Configuration settings for port profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "updateNetworkSwitchPortsProfile", - } - networkId = urllib.parse.quote(str(networkId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/networks/{networkId}/switch/ports/profiles/{id}" - - body_params = [ - "name", - "description", - "tags", - "defaultRadiusProfileName", - "authentication", - "port", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkSwitchPortsProfile: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteNetworkSwitchPortsProfile(self, networkId: str, id: str): - """ - **Delete a port profile from a network** - https://developer.cisco.com/meraki/api-v1/#!delete-network-switch-ports-profile - - - networkId (string): Network ID - - id (string): ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "deleteNetworkSwitchPortsProfile", - } - networkId = urllib.parse.quote(str(networkId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/networks/{networkId}/switch/ports/profiles/{id}" - - return self._session.delete(metadata, resource) - def getNetworkSwitchQosRules(self, networkId: str): """ **List quality of service rules** @@ -2079,64 +1855,6 @@ def updateNetworkSwitchQosRule(self, networkId: str, qosRuleId: str, **kwargs): return self._session.put(metadata, resource, payload) - def getNetworkSwitchRaGuardPolicy(self, networkId: str): - """ - **Return RA Guard settings** - https://developer.cisco.com/meraki/api-v1/#!get-network-switch-ra-guard-policy - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["switch", "configure", "raGuardPolicy"], - "operation": "getNetworkSwitchRaGuardPolicy", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/switch/raGuardPolicy" - - return self._session.get(metadata, resource) - - def updateNetworkSwitchRaGuardPolicy(self, networkId: str, **kwargs): - """ - **Update RA Guard settings** - https://developer.cisco.com/meraki/api-v1/#!update-network-switch-ra-guard-policy - - - networkId (string): Network ID - - defaultPolicy (string): New Router Advertisers are 'allowed' or 'blocked'. Default value is 'allowed'. - - allowedServers (array): List the MAC addresses of Router Advertisers to permit on the network when defaultPolicy is set to blocked. - - blockedServers (array): List the MAC addresses of Router Advertisers to block on the network when defaultPolicy is set to allowed. - """ - - kwargs.update(locals()) - - if "defaultPolicy" in kwargs: - options = ["allowed", "blocked"] - assert kwargs["defaultPolicy"] in options, ( - f'''"defaultPolicy" cannot be "{kwargs["defaultPolicy"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["switch", "configure", "raGuardPolicy"], - "operation": "updateNetworkSwitchRaGuardPolicy", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/switch/raGuardPolicy" - - body_params = [ - "defaultPolicy", - "allowedServers", - "blockedServers", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkSwitchRaGuardPolicy: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def getNetworkSwitchRoutingMulticast(self, networkId: str): """ **Return multicast settings for a network** @@ -2457,45 +2175,6 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): return self._session.put(metadata, resource, payload) - def updateNetworkSwitchSpanningTree(self, networkId: str, **kwargs): - """ - **Updates Spanning Tree configuration** - https://developer.cisco.com/meraki/api-v1/#!update-network-switch-spanning-tree - - - networkId (string): Network ID - - enabled (boolean): Network-level spanning Tree enable - - mode (string): Catalyst Spanning Tree Protocol mode (mst, rpvst+) - - priorities (array): Spanning tree priority for switches/stacks or switch templates. An empty array will clear the priority settings. - """ - - kwargs.update(locals()) - - if "mode" in kwargs: - options = ["mst", "rpvst+"] - assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["switch", "configure", "spanningTree"], - "operation": "updateNetworkSwitchSpanningTree", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/switch/spanningTree" - - body_params = [ - "enabled", - "mode", - "priorities", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkSwitchSpanningTree: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def getNetworkSwitchStacks(self, networkId: str): """ **List the switch stacks in a network** @@ -2652,49 +2331,6 @@ def addNetworkSwitchStack(self, networkId: str, switchStackId: str, serial: str, return self._session.post(metadata, resource, payload) - def updateNetworkSwitchStackPortsMirror( - self, networkId: str, switchStackId: str, source: dict, destination: dict, **kwargs - ): - """ - **Update switch port mirrors for switch stacks** - https://developer.cisco.com/meraki/api-v1/#!update-network-switch-stack-ports-mirror - - - networkId (string): Network ID - - switchStackId (string): Switch stack ID - - source (object): Source port details - - destination (object): Destination port Details - - tags (array): Port mirror tags - - role (string): Switch role can be source or destination - - comment (string): My pretty comment - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "stacks", "ports", "mirror"], - "operation": "updateNetworkSwitchStackPortsMirror", - } - networkId = urllib.parse.quote(str(networkId), safe="") - switchStackId = urllib.parse.quote(str(switchStackId), safe="") - resource = f"/networks/{networkId}/switch/stacks/{switchStackId}/ports/mirror" - - body_params = [ - "source", - "destination", - "tags", - "role", - "comment", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkSwitchStackPortsMirror: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def removeNetworkSwitchStack(self, networkId: str, switchStackId: str, serial: str, **kwargs): """ **Remove a switch from a stack** @@ -2790,12 +2426,6 @@ def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. - vlanId (integer): The VLAN this L3 interface is on. VLAN must be between 1 and 4094. - defaultGateway (string): The next hop for any traffic that isn't going to a directly connected subnet or over a static route. This IP address must exist in a subnet with a L3 interface. Required if this is the first IPv4 interface. - - isSwitchDefaultGateway (boolean): When true, the switch uses the IPv4 uplink gateway as its IPv4 default gateway. This can only be set if the interface is designated as the IPv4 uplink and the switch is running IOS XE version >= 17.18.3. - - uplinkV4 (boolean): When true, this interface is used as static IPv4 uplink. - - candidateUplinkV4 (boolean): When true, this interface is a UAC candidate for IPv4 Uplink. - - uplinkV6 (boolean): When true, this interface is used as static IPv6 uplink. - - staticV4Dns1 (string): Primary IPv4 DNS server address - - staticV4Dns2 (string): Secondary IPv4 DNS server address - ospfSettings (object): The OSPF routing settings of the interface. - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher @@ -2831,12 +2461,6 @@ def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId "multicastRouting", "vlanId", "defaultGateway", - "isSwitchDefaultGateway", - "uplinkV4", - "candidateUplinkV4", - "uplinkV6", - "staticV4Dns1", - "staticV4Dns2", "ospfSettings", "ipv6", "vrf", @@ -2891,12 +2515,6 @@ def updateNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. - vlanId (integer): The VLAN this L3 interface is on. VLAN must be between 1 and 4094. - defaultGateway (string): The next hop for any traffic that isn't going to a directly connected subnet or over a static route. This IP address must exist in a subnet with a L3 interface. Required if this is the first IPv4 interface. - - isSwitchDefaultGateway (boolean): When true, the switch uses the IPv4 uplink gateway as its IPv4 default gateway. This can only be set if the interface is designated as the IPv4 uplink and the switch is running IOS XE version >= 17.18.3. - - uplinkV4 (boolean): When true, this interface is used as static IPv4 uplink. - - candidateUplinkV4 (boolean): When true, this interface is a UAC candidate for IPv4 Uplink. - - uplinkV6 (boolean): When true, this interface is used as static IPv6 uplink. - - staticV4Dns1 (string): Primary IPv4 DNS server address - - staticV4Dns2 (string): Secondary IPv4 DNS server address - ospfSettings (object): The OSPF routing settings of the interface. - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher @@ -2929,12 +2547,6 @@ def updateNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId "multicastRouting", "vlanId", "defaultGateway", - "isSwitchDefaultGateway", - "uplinkV4", - "candidateUplinkV4", - "uplinkV6", - "staticV4Dns1", - "staticV4Dns2", "ospfSettings", "ipv6", "vrf", @@ -3334,83 +2946,29 @@ def updateNetworkSwitchStp(self, networkId: str, **kwargs): return self._session.put(metadata, resource, payload) - def getOrganizationConfigTemplatesSwitchProfilesPortsMirrorsBySwitchProfile( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationConfigTemplateSwitchProfiles(self, organizationId: str, configTemplateId: str): """ - **list the port mirror configurations in an organization by switch profile** - https://developer.cisco.com/meraki/api-v1/#!get-organization-config-templates-switch-profiles-ports-mirrors-by-switch-profile + **List the switch templates for your switch template configuration** + https://developer.cisco.com/meraki/api-v1/#!get-organization-config-template-switch-profiles - 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 - - configTemplateIds (array): Optional parameter to filter the result set by the included set of config template IDs - - ids (array): A list of switch profile ids. The returned profiles will be filtered to only include these ids. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. - - 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. + - configTemplateId (string): Config template ID """ - kwargs.update(locals()) - metadata = { - "tags": ["switch", "configure", "configTemplates", "profiles", "ports", "mirrors", "bySwitchProfile"], - "operation": "getOrganizationConfigTemplatesSwitchProfilesPortsMirrorsBySwitchProfile", + "tags": ["switch", "configure", "configTemplates", "profiles"], + "operation": "getOrganizationConfigTemplateSwitchProfiles", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/configTemplates/switch/profiles/ports/mirrors/bySwitchProfile" + configTemplateId = urllib.parse.quote(str(configTemplateId), safe="") + resource = f"/organizations/{organizationId}/configTemplates/{configTemplateId}/switch/profiles" - query_params = [ - "configTemplateIds", - "ids", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + return self._session.get(metadata, resource) - array_params = [ - "configTemplateIds", - "ids", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationConfigTemplatesSwitchProfilesPortsMirrorsBySwitchProfile: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationConfigTemplateSwitchProfiles(self, organizationId: str, configTemplateId: str): - """ - **List the switch templates for your switch template configuration** - https://developer.cisco.com/meraki/api-v1/#!get-organization-config-template-switch-profiles - - - organizationId (string): Organization ID - - configTemplateId (string): Config template ID - """ - - metadata = { - "tags": ["switch", "configure", "configTemplates", "profiles"], - "operation": "getOrganizationConfigTemplateSwitchProfiles", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - configTemplateId = urllib.parse.quote(str(configTemplateId), safe="") - resource = f"/organizations/{organizationId}/configTemplates/{configTemplateId}/switch/profiles" - - return self._session.get(metadata, resource) - - def getOrganizationConfigTemplateSwitchProfilePorts(self, organizationId: str, configTemplateId: str, profileId: str): - """ - **Return all the ports of a switch template** - https://developer.cisco.com/meraki/api-v1/#!get-organization-config-template-switch-profile-ports + def getOrganizationConfigTemplateSwitchProfilePorts(self, organizationId: str, configTemplateId: str, profileId: str): + """ + **Return all the ports of a switch template** + https://developer.cisco.com/meraki/api-v1/#!get-organization-config-template-switch-profile-ports - organizationId (string): Organization ID - configTemplateId (string): Config template ID @@ -3428,55 +2986,6 @@ def getOrganizationConfigTemplateSwitchProfilePorts(self, organizationId: str, c return self._session.get(metadata, resource) - def updateOrganizationConfigTemplateSwitchProfilePortsMirror( - self, organizationId: str, configTemplateId: str, profileId: str, source: dict, destination: dict, **kwargs - ): - """ - **Update a port mirror** - https://developer.cisco.com/meraki/api-v1/#!update-organization-config-template-switch-profile-ports-mirror - - - organizationId (string): Organization ID - - configTemplateId (string): Config template ID - - profileId (string): Profile ID - - source (object): Source ports mirror configuration - - destination (object): Destination port mirror configuration - - tags (array): Port mirror tags - - role (string): Switch role can be source or destination - - comment (string): My pretty comment - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "configTemplates", "profiles", "ports", "mirror"], - "operation": "updateOrganizationConfigTemplateSwitchProfilePortsMirror", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - configTemplateId = urllib.parse.quote(str(configTemplateId), safe="") - profileId = urllib.parse.quote(str(profileId), safe="") - resource = ( - f"/organizations/{organizationId}/configTemplates/{configTemplateId}/switch/profiles/{profileId}/ports/mirror" - ) - - body_params = [ - "source", - "destination", - "tags", - "role", - "comment", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationConfigTemplateSwitchProfilePortsMirror: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - def getOrganizationConfigTemplateSwitchProfilePort( self, organizationId: str, configTemplateId: str, profileId: str, portId: str ): @@ -3523,7 +3032,6 @@ def updateOrganizationConfigTemplateSwitchProfilePort( - vlan (integer): The VLAN of the switch template port. For a trunk port, this is the native VLAN. A null value will clear the value set for trunk ports. - voiceVlan (integer): The voice VLAN of the switch template port. Only applicable to access ports. - allowedVlans (string): The VLANs allowed on the switch template port. Only applicable to trunk ports. - - activeVlans (string): The VLANs that are active on the switch template port. Only applicable to trunk ports. - isolationEnabled (boolean): The isolation status of the switch template port. - rstpEnabled (boolean): The rapid spanning tree protocol status. - stpGuard (string): The state of the STP guard ('disabled', 'root guard', 'bpdu guard' or 'loop guard'). @@ -3586,7 +3094,6 @@ def updateOrganizationConfigTemplateSwitchProfilePort( "vlan", "voiceVlan", "allowedVlans", - "activeVlans", "isolationEnabled", "rstpEnabled", "stpGuard", @@ -3656,37 +3163,89 @@ def getOrganizationSummarySwitchPowerHistory(self, organizationId: str, **kwargs return self._session.get(metadata, resource, params) - def getOrganizationSwitchAlertsPoeByDevice(self, organizationId: str, networkIds: list, **kwargs): + def cloneOrganizationSwitchDevices(self, organizationId: str, sourceSerial: str, targetSerials: list, **kwargs): + """ + **Clone port-level and some switch-level configuration settings from a source switch to one or more target switches** + https://developer.cisco.com/meraki/api-v1/#!clone-organization-switch-devices + + - organizationId (string): Organization ID + - sourceSerial (string): Serial number of the source switch (must be on a network not bound to a template) + - targetSerials (array): Array of serial numbers of one or more target switches (must be on a network not bound to a template) + """ + + kwargs = locals() + + metadata = { + "tags": ["switch", "configure", "devices"], + "operation": "cloneOrganizationSwitchDevices", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/switch/devices/clone" + + body_params = [ + "sourceSerial", + "targetSerials", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"cloneOrganizationSwitchDevices: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) + + def getOrganizationSwitchPortsBySwitch(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Gets all poe related alerts over a given network and returns information by device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-alerts-poe-by-device + **List the switchports in an organization by switch** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-by-switch - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. + - 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 - 50. 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. + - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. + - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. + - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. + - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. + - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. + - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. + - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. + - serials (array): Optional parameter to filter items to switches that have one of the provided serials. """ kwargs.update(locals()) metadata = { - "tags": ["switch", "monitor", "alerts", "poe", "byDevice"], - "operation": "getOrganizationSwitchAlertsPoeByDevice", + "tags": ["switch", "configure", "ports", "bySwitch"], + "operation": "getOrganizationSwitchPortsBySwitch", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/alerts/poe/byDevice" + resource = f"/organizations/{organizationId}/switch/ports/bySwitch" query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "configurationUpdatedAfter", + "mac", + "macs", + "name", "networkIds", - "t0", - "t1", - "timespan", + "portProfileIds", + "serial", + "serials", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ + "macs", "networkIds", + "portProfileIds", + "serials", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -3697,60 +3256,66 @@ def getOrganizationSwitchAlertsPoeByDevice(self, organizationId: str, networkIds all_params = query_params + array_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchAlertsPoeByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def aurora2OrganizationSwitchSwitchTemplates(self, organizationId: str): - """ - **List switch templates running IOS XE Catalyst firmware.** - https://developer.cisco.com/meraki/api-v1/#!aurora-2-organization-switch-switch-templates - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["switch", "configure"], - "operation": "aurora2OrganizationSwitchSwitchTemplates", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/aurora2SwitchTemplates" + self._session._logger.warning(f"getOrganizationSwitchPortsBySwitch: ignoring unrecognized kwargs: {invalid}") - return self._session.get(metadata, resource) + return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationSwitchClientsConnectionsAuthenticationByClient(self, organizationId: str, **kwargs): + def getOrganizationSwitchPortsClientsOverviewByDevice( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): """ - **Summarizes authentication outcomes per switch client across an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-clients-connections-authentication-by-client + **List the number of clients for all switchports with at least one online client in an organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-clients-overview-by-device - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. + - 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 + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 20. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. + - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. + - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. + - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. + - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. + - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. + - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. + - serials (array): Optional parameter to filter items to switches that have one of the provided serials. """ kwargs.update(locals()) metadata = { - "tags": ["switch", "monitor", "clients", "connections", "authentication", "byClient"], - "operation": "getOrganizationSwitchClientsConnectionsAuthenticationByClient", + "tags": ["switch", "monitor", "ports", "clients", "overview", "byDevice"], + "operation": "getOrganizationSwitchPortsClientsOverviewByDevice", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/clients/connections/authentication/byClient" + resource = f"/organizations/{organizationId}/switch/ports/clients/overview/byDevice" query_params = [ - "networkIds", "t0", - "t1", "timespan", + "perPage", + "startingAfter", + "endingBefore", + "configurationUpdatedAfter", + "mac", + "macs", + "name", + "networkIds", + "portProfileIds", + "serial", + "serials", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ + "macs", "networkIds", + "portProfileIds", + "serials", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -3762,89 +3327,96 @@ def getOrganizationSwitchClientsConnectionsAuthenticationByClient(self, organiza invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationSwitchClientsConnectionsAuthenticationByClient: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationSwitchPortsClientsOverviewByDevice: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationSwitchClientsConnectionsDhcpByClient(self, organizationId: str, **kwargs): + def getOrganizationSwitchPortsOverview(self, organizationId: str, **kwargs): """ - **Get IP assignment for all clients in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-clients-connections-dhcp-by-client + **Returns the counts of all active ports for the requested timespan, grouped by speed** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-overview - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 2 hours. + - t0 (string): The beginning of the timespan for the data. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 12 hours and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) metadata = { - "tags": ["switch", "monitor", "clients", "connections", "dhcp", "byClient"], - "operation": "getOrganizationSwitchClientsConnectionsDhcpByClient", + "tags": ["switch", "monitor", "ports", "overview"], + "operation": "getOrganizationSwitchPortsOverview", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/clients/connections/dhcp/byClient" + resource = f"/organizations/{organizationId}/switch/ports/overview" query_params = [ - "networkIds", "t0", "t1", "timespan", ] 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()) - if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = query_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchClientsConnectionsDhcpByClient: ignoring unrecognized kwargs: {invalid}" - ) + self._session._logger.warning(f"getOrganizationSwitchPortsOverview: ignoring unrecognized kwargs: {invalid}") return self._session.get(metadata, resource, params) - def getOrganizationSwitchClientsConnectionsSwitchPortStatusByClient(self, organizationId: str, **kwargs): + def getOrganizationSwitchPortsStatusesBySwitch(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Switch port status by client.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-clients-connections-switch-port-status-by-client + **List the switchports in an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-statuses-by-switch - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. + - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. + - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. + - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. + - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. + - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. + - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. + - serials (array): Optional parameter to filter items to switches that have one of the provided serials. """ kwargs.update(locals()) metadata = { - "tags": ["switch", "monitor", "clients", "connections", "switchPortStatus", "byClient"], - "operation": "getOrganizationSwitchClientsConnectionsSwitchPortStatusByClient", + "tags": ["switch", "monitor", "ports", "statuses", "bySwitch"], + "operation": "getOrganizationSwitchPortsStatusesBySwitch", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/clients/connections/switchPortStatus/byClient" + resource = f"/organizations/{organizationId}/switch/ports/statuses/bySwitch" query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "configurationUpdatedAfter", + "mac", + "macs", + "name", "networkIds", - "t0", - "t1", - "timespan", + "portProfileIds", + "serial", + "serials", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ + "macs", "networkIds", + "portProfileIds", + "serials", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -3856,296 +3428,26 @@ def getOrganizationSwitchClientsConnectionsSwitchPortStatusByClient(self, organi invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationSwitchClientsConnectionsSwitchPortStatusByClient: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationSwitchPortsStatusesBySwitch: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) - def cloneOrganizationSwitchProfilesToTemplateNetwork(self, organizationId: str, **kwargs): + def getOrganizationSwitchPortsTopologyDiscoveryByDevice( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): """ - **Clone existing switch templates into a destination template network.** - https://developer.cisco.com/meraki/api-v1/#!clone-organization-switch-profiles-to-template-network - - - organizationId (string): Organization ID - - profileIds (array): Switch profile IDs to clone - - templateNodeGroupId (string): Destination template network ID - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure"], - "operation": "cloneOrganizationSwitchProfilesToTemplateNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/cloneProfilesToTemplateNetwork" - - body_params = [ - "profileIds", - "templateNodeGroupId", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"cloneOrganizationSwitchProfilesToTemplateNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchConnectivityLanLinkErrorsByDeviceByPort(self, organizationId: str, networkIds: list, **kwargs): - """ - **Lan link errors by device and port.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-connectivity-lan-link-errors-by-device-by-port - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "connectivity", "lanLink", "errors", "byDevice", "byPort"], - "operation": "getOrganizationSwitchConnectivityLanLinkErrorsByDeviceByPort", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/connectivity/lanLink/errors/byDevice/byPort" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchConnectivityLanLinkErrorsByDeviceByPort: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationSwitchConnectivityLanStpErrorsByDeviceByPort(self, organizationId: str, networkIds: list, **kwargs): - """ - **Lan STP errors by device and port.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-connectivity-lan-stp-errors-by-device-by-port - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "connectivity", "lanStp", "errors", "byDevice", "byPort"], - "operation": "getOrganizationSwitchConnectivityLanStpErrorsByDeviceByPort", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/connectivity/lanStp/errors/byDevice/byPort" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchConnectivityLanStpErrorsByDeviceByPort: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationSwitchConnectivityVrrpFailuresByDevice(self, organizationId: str, networkIds: list, **kwargs): - """ - **Gets all vrrp related alerts over a given network and returns information by device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-connectivity-vrrp-failures-by-device - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "connectivity", "vrrp", "failures", "byDevice"], - "operation": "getOrganizationSwitchConnectivityVrrpFailuresByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/connectivity/vrrp/failures/byDevice" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchConnectivityVrrpFailuresByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def cloneOrganizationSwitchDevices(self, organizationId: str, sourceSerial: str, targetSerials: list, **kwargs): - """ - **Clone port-level and some switch-level configuration settings from a source switch to one or more target switches** - https://developer.cisco.com/meraki/api-v1/#!clone-organization-switch-devices - - - organizationId (string): Organization ID - - sourceSerial (string): Serial number of the source switch (must be on a network not bound to a template) - - targetSerials (array): Array of serial numbers of one or more target switches (must be on a network not bound to a template) - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "devices"], - "operation": "cloneOrganizationSwitchDevices", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/devices/clone" - - body_params = [ - "sourceSerial", - "targetSerials", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"cloneOrganizationSwitchDevices: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchDevicesSystemQueuesHistoryBySwitchByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Return a historical record of packet transmission and loss, broken down by protocol, for insight into switch device health.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-devices-system-queues-history-by-switch-by-interval + **List most recently seen LLDP/CDP discovery and topology information per switch port in an organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-topology-discovery-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 - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 1200, 14400, 86400. The default is 1200. Interval is calculated if time params are provided. - - networkIds (array): Optional parameter to filter connectivity history by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter connectivity history by switch. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "devices", "system", "queues", "history", "bySwitch", "byInterval"], - "operation": "getOrganizationSwitchDevicesSystemQueuesHistoryBySwitchByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/devices/system/queues/history/bySwitch/byInterval" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - "networkIds", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchDevicesSystemQueuesHistoryBySwitchByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsBySwitch(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the switchports in an organization by switch** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-by-switch - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 50. Default is 50. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - extendedParams (boolean): Optional flag to return all of the switchport data vs smaller dataset - - hideDefaultPorts (boolean): Optional flag that, when true, will hide modular switchports that may not be connected to the device at the moment - - type (array): Optional parameter to filter switchports by type ('access', 'trunk', 'stack', 'routed', 'svl' or 'dad'). All types are selected if not supplied. - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. @@ -4159,19 +3461,18 @@ def getOrganizationSwitchPortsBySwitch(self, organizationId: str, total_pages=1, kwargs.update(locals()) metadata = { - "tags": ["switch", "configure", "ports", "bySwitch"], - "operation": "getOrganizationSwitchPortsBySwitch", + "tags": ["switch", "monitor", "ports", "topology", "discovery", "byDevice"], + "operation": "getOrganizationSwitchPortsTopologyDiscoveryByDevice", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/bySwitch" + resource = f"/organizations/{organizationId}/switch/ports/topology/discovery/byDevice" query_params = [ + "t0", + "timespan", "perPage", "startingAfter", "endingBefore", - "extendedParams", - "hideDefaultPorts", - "type", "configurationUpdatedAfter", "mac", "macs", @@ -4184,7 +3485,6 @@ def getOrganizationSwitchPortsBySwitch(self, organizationId: str, total_pages=1, params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "type", "macs", "networkIds", "portProfileIds", @@ -4199,23 +3499,27 @@ def getOrganizationSwitchPortsBySwitch(self, organizationId: str, total_pages=1, all_params = query_params + array_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSwitchPortsBySwitch: ignoring unrecognized kwargs: {invalid}") + self._session._logger.warning( + f"getOrganizationSwitchPortsTopologyDiscoveryByDevice: ignoring unrecognized kwargs: {invalid}" + ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationSwitchPortsClientsOverviewByDevice( + def getOrganizationSwitchPortsUsageHistoryByDeviceByInterval( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **List the number of clients for all switchports with at least one online client in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-clients-overview-by-device + **List the historical usage and traffic data of switchports in an organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-usage-history-by-device-by-interval - 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 - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 20. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. If interval is provided, the timespan will be autocalculated. + - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 1200, 14400, 86400. The default is 1200. Interval is calculated if time params are provided. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 50. Default is 10. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. @@ -4231,15 +3535,17 @@ def getOrganizationSwitchPortsClientsOverviewByDevice( kwargs.update(locals()) metadata = { - "tags": ["switch", "monitor", "ports", "clients", "overview", "byDevice"], - "operation": "getOrganizationSwitchPortsClientsOverviewByDevice", + "tags": ["switch", "monitor", "ports", "usage", "history", "byDevice", "byInterval"], + "operation": "getOrganizationSwitchPortsUsageHistoryByDeviceByInterval", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/clients/overview/byDevice" + resource = f"/organizations/{organizationId}/switch/ports/usage/history/byDevice/byInterval" query_params = [ "t0", + "t1", "timespan", + "interval", "perPage", "startingAfter", "endingBefore", @@ -4270,2962 +3576,7 @@ def getOrganizationSwitchPortsClientsOverviewByDevice( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationSwitchPortsClientsOverviewByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsMirrorsBySwitch(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **list the port mirror configurations in an organization by switch** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-mirrors-by-switch - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter the result set by the included set of network IDs - - 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 - 100. - - 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": ["switch", "configure", "ports", "mirrors", "bySwitch"], - "operation": "getOrganizationSwitchPortsMirrorsBySwitch", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/mirrors/bySwitch" - - query_params = [ - "networkIds", - "serials", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsMirrorsBySwitch: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsOverview(self, organizationId: str, **kwargs): - """ - **Returns the counts of all active ports for the requested timespan, grouped by speed** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-overview - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 12 hours and be less than or equal to 186 days. The default is 1 day. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "ports", "overview"], - "operation": "getOrganizationSwitchPortsOverview", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/overview" - - query_params = [ - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSwitchPortsOverview: ignoring unrecognized kwargs: {invalid}") - - return self._session.get(metadata, resource, params) - - def getOrganizationSwitchPortsProfiles(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the port profiles in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Return the port profiles for the specified network(s) - - formattedStaticAssignments (boolean): Returns the list of static switchports that are assigned to the switchport profile - - searchQuery (string): Optional parameter to filter the result set by the search query - - radiusProfileEnabled (boolean): Optional parameter. If true, only return port profiles with a radius profile enabled - - 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": ["switch", "configure", "ports", "profiles"], - "operation": "getOrganizationSwitchPortsProfiles", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles" - - query_params = [ - "networkIds", - "formattedStaticAssignments", - "searchQuery", - "radiusProfileEnabled", - "perPage", - "startingAfter", - "endingBefore", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSwitchPortsProfiles: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchPortsProfile(self, organizationId: str, **kwargs): - """ - **Create a port profile in an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-ports-profile - - - organizationId (string): Organization ID - - name (string): The name of the profile. - - description (string): Text describing the profile. - - isOrganizationWide (boolean): The scope of the profile whether it is organization level or network level - - networks (object): The networks which are included/excluded in the profile - - networkId (string): The network identifier - - tags (array): Space-seperated list of tags - - defaultRadiusProfileName (string): When present, the default RADIUS attribute value for RADIUS-based port profile application - - authentication (object): Authentication settings for RADIUS-based port profile application. - - port (object): Configuration settings for port profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "createOrganizationSwitchPortsProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles" - - body_params = [ - "name", - "description", - "isOrganizationWide", - "networks", - "networkId", - "tags", - "defaultRadiusProfileName", - "authentication", - "port", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationSwitchPortsProfile: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def batchOrganizationSwitchPortsProfilesAssignmentsAssign(self, organizationId: str, items: list, **kwargs): - """ - **Batch assign or unassign port profiles to switch ports** - https://developer.cisco.com/meraki/api-v1/#!batch-organization-switch-ports-profiles-assignments-assign - - - organizationId (string): Organization ID - - items (array): Array of assignment operations (max 100) - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "assignments"], - "operation": "batchOrganizationSwitchPortsProfilesAssignmentsAssign", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/assignments/batchAssign" - - body_params = [ - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"batchOrganizationSwitchPortsProfilesAssignmentsAssign: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchPortsProfilesAssignmentsByPort( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the port profile assignments in an organization, grouped by port** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles-assignments-by-port - - - 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 - - profileIds (array): Filter by specific profile IDs - - serials (array): Filter by switch serials - - networkIds (array): Filter by network IDs - - templateIds (array): Filter by template (node_profile) IDs - - types (array): Filter by port type: switch, template - - assignmentTypes (array): Filter by assignment type: direct, template, exception - - isActive (boolean): Filter by assignment status. true: only ports with active assignments, showing only active assignments per port. false: only ports with inactive assignments, showing only inactive assignments per port. Omit: all ports with all assignment layers. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "assignments", "byPort"], - "operation": "getOrganizationSwitchPortsProfilesAssignmentsByPort", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/assignments/byPort" - - query_params = [ - "profileIds", - "serials", - "networkIds", - "templateIds", - "types", - "assignmentTypes", - "isActive", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "profileIds", - "serials", - "networkIds", - "templateIds", - "types", - "assignmentTypes", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsProfilesAssignmentsByPort: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsProfilesAssignmentsBySwitch( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the port profile assignments in an organization, grouped by switch** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles-assignments-by-switch - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - profileIds (array): Filter by specific profile IDs - - serials (array): Filter by switch serials - - networkIds (array): Filter by network IDs - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 50. 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. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "assignments", "bySwitch"], - "operation": "getOrganizationSwitchPortsProfilesAssignmentsBySwitch", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/assignments/bySwitch" - - query_params = [ - "profileIds", - "serials", - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "profileIds", - "serials", - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsProfilesAssignmentsBySwitch: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsProfilesAutomations(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **list the automation port profiles in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles-automations - - - 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 - - ids (array): Optional parameter to filter the result set by the included set of automation IDs - - networkIds (array): Optional parameter to filter the result set by the associated networks. - - isOrganizationWide (string): Optional parameter to filter the result set by automations org-wide flag. - - searchQuery (string): Optional parameter to filter the result set by the search query - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "automations"], - "operation": "getOrganizationSwitchPortsProfilesAutomations", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/automations" - - query_params = [ - "ids", - "networkIds", - "isOrganizationWide", - "searchQuery", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "ids", - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsProfilesAutomations: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchPortsProfilesAutomation(self, organizationId: str, **kwargs): - """ - **Create a port profile automation for an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-ports-profiles-automation - - - organizationId (string): Organization ID - - name (string): Name of the port profile automation. - - description (string): Text describing the port profile automation. - - fallbackProfile (object): Configuration settings for port profile - - rules (array): Configuration settings for port profile automation rules - - assignedSwitchPorts (array): assigned switch ports - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "automations"], - "operation": "createOrganizationSwitchPortsProfilesAutomation", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/automations" - - body_params = [ - "name", - "description", - "fallbackProfile", - "rules", - "assignedSwitchPorts", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchPortsProfilesAutomation: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationSwitchPortsProfilesAutomation(self, organizationId: str, id: str, **kwargs): - """ - **Update a port profile automation in an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-switch-ports-profiles-automation - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of the port profile automation. - - description (string): Text describing the port profile automation. - - fallbackProfile (object): Configuration settings for port profile - - rules (array): Configuration settings for port profile automation rules - - assignedSwitchPorts (array): assigned switch ports - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "automations"], - "operation": "updateOrganizationSwitchPortsProfilesAutomation", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/automations/{id}" - - body_params = [ - "name", - "description", - "fallbackProfile", - "rules", - "assignedSwitchPorts", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSwitchPortsProfilesAutomation: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSwitchPortsProfilesAutomation(self, organizationId: str, id: str): - """ - **Delete an automation port profile from an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-ports-profiles-automation - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "automations"], - "operation": "deleteOrganizationSwitchPortsProfilesAutomation", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/automations/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchPortsProfilesNetworksAssignments( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Fetch all Network - Smart Port Profile associations for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles-networks-assignments - - - 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): Number of records per page - - page (integer): Page number - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "networks", "assignments"], - "operation": "getOrganizationSwitchPortsProfilesNetworksAssignments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/networks/assignments" - - query_params = [ - "perPage", - "page", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsProfilesNetworksAssignments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchPortsProfilesNetworksAssignment( - self, organizationId: str, type: str, profile: dict, network: dict, **kwargs - ): - """ - **Create Network and Smart Ports Profile association for a specific profile** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-ports-profiles-networks-assignment - - - organizationId (string): Organization ID - - type (string): Type of association - - profile (object): Smart Port Profile object - - network (object): Network object - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "networks", "assignments"], - "operation": "createOrganizationSwitchPortsProfilesNetworksAssignment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/networks/assignments" - - body_params = [ - "type", - "profile", - "network", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchPortsProfilesNetworksAssignment: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def batchOrganizationSwitchPortsProfilesNetworksAssignmentsCreate(self, organizationId: str, items: list, **kwargs): - """ - **Batch Create Network and Smart Ports Profile associations for a specific profile** - https://developer.cisco.com/meraki/api-v1/#!batch-organization-switch-ports-profiles-networks-assignments-create - - - organizationId (string): Organization ID - - items (array): Array of network and profile associations - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "networks", "assignments"], - "operation": "batchOrganizationSwitchPortsProfilesNetworksAssignmentsCreate", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/networks/assignments/batchCreate" - - body_params = [ - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"batchOrganizationSwitchPortsProfilesNetworksAssignmentsCreate: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def bulkOrganizationSwitchPortsProfilesNetworksAssignmentsDelete(self, organizationId: str, items: list, **kwargs): - """ - **Bulk delete Network and Smart Port Profile associations** - https://developer.cisco.com/meraki/api-v1/#!bulk-organization-switch-ports-profiles-networks-assignments-delete - - - organizationId (string): Organization ID - - items (array): Array of assignments to delete - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "networks", "assignments"], - "operation": "bulkOrganizationSwitchPortsProfilesNetworksAssignmentsDelete", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/networks/assignments/bulkDelete" - - body_params = [ - "items", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"bulkOrganizationSwitchPortsProfilesNetworksAssignmentsDelete: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def deleteOrganizationSwitchPortsProfilesNetworksAssignment(self, organizationId: str, assignmentId: str): - """ - **Delete Network and Smart Port profile association for a specific profile** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-ports-profiles-networks-assignment - - - organizationId (string): Organization ID - - assignmentId (string): Assignment ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "networks", "assignments"], - "operation": "deleteOrganizationSwitchPortsProfilesNetworksAssignment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - assignmentId = urllib.parse.quote(str(assignmentId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/networks/assignments/{assignmentId}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchPortsProfilesOverviewByProfile( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the port profiles in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles-overview-by-profile - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Return the port profiles for the specified network(s) - - formattedStaticAssignments (boolean): Returns the list of static switchports that are assgined to the switchport profile - - searchQuery (string): Optional parameter to filter the result set by the search query - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "overview", "byProfile"], - "operation": "getOrganizationSwitchPortsProfilesOverviewByProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/overview/byProfile" - - query_params = [ - "networkIds", - "formattedStaticAssignments", - "searchQuery", - "perPage", - "startingAfter", - "endingBefore", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsProfilesOverviewByProfile: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsProfilesRadiusAssignments( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the port profile RADIUS assignments** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles-radius-assignments - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): If present, the networks to limit the assignments to - - portProfileIds (array): If present, the port profiles to limit the assignments to - - 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": ["switch", "configure", "ports", "profiles", "radius", "assignments"], - "operation": "getOrganizationSwitchPortsProfilesRadiusAssignments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/radius/assignments" - - query_params = [ - "networkIds", - "portProfileIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "portProfileIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsProfilesRadiusAssignments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchPortsProfilesRadiusAssignment(self, organizationId: str, network: dict, **kwargs): - """ - **Create a port profile RADIUS assignment** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-ports-profiles-radius-assignment - - - organizationId (string): Organization ID - - network (object): The network where the RADIUS name is assigned - - portProfile (object): The assigned port profile - - radius (object): The RADIUS options for this assignment - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "radius", "assignments"], - "operation": "createOrganizationSwitchPortsProfilesRadiusAssignment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/radius/assignments" - - body_params = [ - "network", - "portProfile", - "radius", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchPortsProfilesRadiusAssignment: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchPortsProfilesRadiusAssignment(self, organizationId: str, id: str): - """ - **Return a port profile RADIUS assignment** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profiles-radius-assignment - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "radius", "assignments"], - "operation": "getOrganizationSwitchPortsProfilesRadiusAssignment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/radius/assignments/{id}" - - return self._session.get(metadata, resource) - - def updateOrganizationSwitchPortsProfilesRadiusAssignment(self, organizationId: str, id: str, **kwargs): - """ - **Update a port profile RADIUS assignment** - https://developer.cisco.com/meraki/api-v1/#!update-organization-switch-ports-profiles-radius-assignment - - - organizationId (string): Organization ID - - id (string): ID - - network (object): The network where the RADIUS name is assigned - - portProfile (object): The assigned port profile - - radius (object): The RADIUS options for this assignment - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "radius", "assignments"], - "operation": "updateOrganizationSwitchPortsProfilesRadiusAssignment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/radius/assignments/{id}" - - body_params = [ - "network", - "portProfile", - "radius", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSwitchPortsProfilesRadiusAssignment: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSwitchPortsProfilesRadiusAssignment(self, organizationId: str, id: str): - """ - **Deletes a port profile RADIUS assignment** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-ports-profiles-radius-assignment - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles", "radius", "assignments"], - "operation": "deleteOrganizationSwitchPortsProfilesRadiusAssignment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/radius/assignments/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchPortsProfile(self, organizationId: str, id: str): - """ - **Get detailed information about a port profile** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-profile - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "getOrganizationSwitchPortsProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/{id}" - - return self._session.get(metadata, resource) - - def updateOrganizationSwitchPortsProfile(self, organizationId: str, id: str, **kwargs): - """ - **Update a port profile in an organization** - https://developer.cisco.com/meraki/api-v1/#!update-organization-switch-ports-profile - - - organizationId (string): Organization ID - - id (string): ID - - name (string): The name of the profile. - - description (string): Text describing the profile. - - isOrganizationWide (boolean): The scope of the profile whether it is organization level or network level - - networks (object): The networks which are included/excluded in the profile - - networkId (string): The network identifier - - tags (array): Space-seperated list of tags - - defaultRadiusProfileName (string): When present, the default RADIUS attribute value for RADIUS-based port profile application - - authentication (object): Authentication settings for RADIUS-based port profile application. - - port (object): Configuration settings for port profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "updateOrganizationSwitchPortsProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/{id}" - - body_params = [ - "name", - "description", - "isOrganizationWide", - "networks", - "networkId", - "tags", - "defaultRadiusProfileName", - "authentication", - "port", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationSwitchPortsProfile: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSwitchPortsProfile(self, organizationId: str, id: str): - """ - **Delete a port profile from an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-ports-profile - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["switch", "configure", "ports", "profiles"], - "operation": "deleteOrganizationSwitchPortsProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/switch/ports/profiles/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchPortsStatusesBySwitch(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the switchports in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-statuses-by-switch - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. - - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. - - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. - - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. - - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. - - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. - - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. - - serials (array): Optional parameter to filter items to switches that have one of the provided serials. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "ports", "statuses", "bySwitch"], - "operation": "getOrganizationSwitchPortsStatusesBySwitch", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/statuses/bySwitch" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "configurationUpdatedAfter", - "mac", - "macs", - "name", - "networkIds", - "portProfileIds", - "serial", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "macs", - "networkIds", - "portProfileIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsStatusesBySwitch: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsStatusesPacketsByDeviceByPort(self, organizationId: str, networkIds: list, **kwargs): - """ - **Switch port packets by device and port.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-statuses-packets-by-device-by-port - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 1 day. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 1200, 14400, 86400. The default is 14400. Interval is calculated if time params are provided. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "ports", "statuses", "packets", "byDevice", "byPort"], - "operation": "getOrganizationSwitchPortsStatusesPacketsByDeviceByPort", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/statuses/packets/byDevice/byPort" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - "interval", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsStatusesPacketsByDeviceByPort: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationSwitchPortsTopologyDiscoveryByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List most recently seen LLDP/CDP discovery and topology information per switch port in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-topology-discovery-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 - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. - - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. - - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. - - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. - - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. - - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. - - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. - - serials (array): Optional parameter to filter items to switches that have one of the provided serials. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "ports", "topology", "discovery", "byDevice"], - "operation": "getOrganizationSwitchPortsTopologyDiscoveryByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/topology/discovery/byDevice" - - query_params = [ - "t0", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - "configurationUpdatedAfter", - "mac", - "macs", - "name", - "networkIds", - "portProfileIds", - "serial", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "macs", - "networkIds", - "portProfileIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsTopologyDiscoveryByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsTransceiversReadingsHistoryBySwitch( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Return time-series digital optical monitoring (DOM) readings for ports on each DOM-enabled switch in an organization, in addition to thresholds for each relevant Small Form Factor Pluggable (SFP) module.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-transceivers-readings-history-by-switch - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. 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. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 1 day. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 1200, 14400, 86400. The default is 1200. Interval is calculated if time params are provided. - - networkIds (array): Networks for which information should be gathered. - - serials (array): Optional parameter to filter usage by switch. - - portIds (array): Optional parameter to filter usage by port ID. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "ports", "transceivers", "readings", "history", "bySwitch"], - "operation": "getOrganizationSwitchPortsTransceiversReadingsHistoryBySwitch", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/transceivers/readings/history/bySwitch" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - "networkIds", - "serials", - "portIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "portIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsTransceiversReadingsHistoryBySwitch: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchPortsUsageHistoryByDeviceByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the historical usage and traffic data of switchports in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-usage-history-by-device-by-interval - - - 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 - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 1200, 14400, 86400. The default is 1200. Interval is calculated if time params are provided. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 50. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. - - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. - - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. - - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. - - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. - - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. - - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. - - serials (array): Optional parameter to filter items to switches that have one of the provided serials. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "ports", "usage", "history", "byDevice", "byInterval"], - "operation": "getOrganizationSwitchPortsUsageHistoryByDeviceByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/ports/usage/history/byDevice/byInterval" - - query_params = [ - "t0", - "t1", - "timespan", - "interval", - "perPage", - "startingAfter", - "endingBefore", - "configurationUpdatedAfter", - "mac", - "macs", - "name", - "networkIds", - "portProfileIds", - "serial", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "macs", - "networkIds", - "portProfileIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchPortsUsageHistoryByDeviceByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpAutonomousSystems(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the autonomous systems configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-autonomous-systems - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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. - - numbers (array): Optional parameter to filter autonomous systems by number. This filter uses multiple exact matches. - - autonomousSystemIds (array): Optional parameter to filter autonomous systems by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "autonomousSystems"], - "operation": "getOrganizationSwitchRoutingBgpAutonomousSystems", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/autonomousSystems" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "numbers", - "autonomousSystemIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "numbers", - "autonomousSystemIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpAutonomousSystems: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchRoutingBgpAutonomousSystem(self, organizationId: str, number: int, **kwargs): - """ - **Create an autonomous system** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-autonomous-system - - - organizationId (string): Organization ID - - number (integer): The autonomous system number (CLI: 'router bgp ') - - description (string): A description for the autonomous system - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "autonomousSystems"], - "operation": "createOrganizationSwitchRoutingBgpAutonomousSystem", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/autonomousSystems" - - body_params = [ - "number", - "description", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchRoutingBgpAutonomousSystem: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchRoutingBgpAutonomousSystemsOverviewByAutonomousSystem( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the overview of the autonomous systems configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-autonomous-systems-overview-by-autonomous-system - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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. - - numbers (array): Optional parameter to filter autonomous systems by number. This filter uses multiple exact matches. - - autonomousSystemIds (array): Optional parameter to filter autonomous systems by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "autonomousSystems", "overview", "byAutonomousSystem"], - "operation": "getOrganizationSwitchRoutingBgpAutonomousSystemsOverviewByAutonomousSystem", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/autonomousSystems/overview/byAutonomousSystem" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "numbers", - "autonomousSystemIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "numbers", - "autonomousSystemIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpAutonomousSystemsOverviewByAutonomousSystem: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def updateOrganizationSwitchRoutingBgpAutonomousSystem(self, organizationId: str, autonomousSystemId: str, **kwargs): - """ - **Update an autonomous system** - https://developer.cisco.com/meraki/api-v1/#!update-organization-switch-routing-bgp-autonomous-system - - - organizationId (string): Organization ID - - autonomousSystemId (string): Autonomous system ID - - number (integer): The autonomous system number (CLI: 'router bgp ') - - description (string): A description for the autonomous system - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "autonomousSystems"], - "operation": "updateOrganizationSwitchRoutingBgpAutonomousSystem", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - autonomousSystemId = urllib.parse.quote(str(autonomousSystemId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/autonomousSystems/{autonomousSystemId}" - - body_params = [ - "number", - "description", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationSwitchRoutingBgpAutonomousSystem: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationSwitchRoutingBgpAutonomousSystem(self, organizationId: str, autonomousSystemId: str): - """ - **Delete an autonomous system from an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-routing-bgp-autonomous-system - - - organizationId (string): Organization ID - - autonomousSystemId (string): Autonomous system ID - """ - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "autonomousSystems"], - "operation": "deleteOrganizationSwitchRoutingBgpAutonomousSystem", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - autonomousSystemId = urllib.parse.quote(str(autonomousSystemId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/autonomousSystems/{autonomousSystemId}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchRoutingBgpFiltersFilterLists( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the filter lists configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-filters-filter-lists - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 'filter lists' by network ID. This filter uses multiple exact matches. - - listIds (array): Optional parameter to filter 'filter lists' by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "filterLists"], - "operation": "getOrganizationSwitchRoutingBgpFiltersFilterLists", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/filterLists" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "listIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "listIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpFiltersFilterLists: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchRoutingBgpFiltersFilterListsDeploy( - self, organizationId: str, filterList: dict, network: dict, rules: list, **kwargs - ): - """ - **Create or update a filter list, in addition to its associated rules** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-filters-filter-lists-deploy - - - organizationId (string): Organization ID - - filterList (object): Information regarding the filter list - - network (object): Information regarding the network the filter list belongs to - - rules (array): Information regarding the filter list rules - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "filterLists", "deploy"], - "operation": "createOrganizationSwitchRoutingBgpFiltersFilterListsDeploy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/filterLists/deploy" - - body_params = [ - "filterList", - "network", - "rules", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchRoutingBgpFiltersFilterListsDeploy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchRoutingBgpFiltersFilterListsOverviewByFilterList( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the overview of the filter lists configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-filters-filter-lists-overview-by-filter-list - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 'filter list' overviews by network ID. This filter uses multiple exact matches. - - listIds (array): Optional parameter to filter 'filter list' overviews by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "routing", "bgp", "filters", "filterLists", "overview", "byFilterList"], - "operation": "getOrganizationSwitchRoutingBgpFiltersFilterListsOverviewByFilterList", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/filterLists/overview/byFilterList" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "listIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "listIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpFiltersFilterListsOverviewByFilterList: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpFiltersFilterListsRules( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the filter list rules configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-filters-filter-lists-rules - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 'filter list' rules by network ID. This filter uses multiple exact matches. - - ruleIds (array): Optional parameter to filter 'filter list' rules by ID. This filter uses multiple exact matches. - - filterListIds (array): Optional parameter to filter 'filter lists' by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "filterLists", "rules"], - "operation": "getOrganizationSwitchRoutingBgpFiltersFilterListsRules", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/filterLists/rules" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "ruleIds", - "filterListIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "ruleIds", - "filterListIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpFiltersFilterListsRules: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def deleteOrganizationSwitchRoutingBgpFiltersFilterList(self, organizationId: str, listId: str): - """ - **Delete a filter list** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-routing-bgp-filters-filter-list - - - organizationId (string): Organization ID - - listId (string): List ID - """ - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "filterLists"], - "operation": "deleteOrganizationSwitchRoutingBgpFiltersFilterList", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - listId = urllib.parse.quote(str(listId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/filterLists/{listId}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchRoutingBgpFiltersPrefixLists( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the prefix lists configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-filters-prefix-lists - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 prefix lists by network ID. This filter uses multiple exact matches. - - listIds (array): Optional parameter to filter prefix lists by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "prefixLists"], - "operation": "getOrganizationSwitchRoutingBgpFiltersPrefixLists", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/prefixLists" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "listIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "listIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpFiltersPrefixLists: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchRoutingBgpFiltersPrefixListsDeploy( - self, organizationId: str, network: dict, prefixList: dict, rules: list, **kwargs - ): - """ - **Create or update a prefix list, in addition to its associated rules** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-filters-prefix-lists-deploy - - - organizationId (string): Organization ID - - network (object): Information regarding the network the prefix list belongs to - - prefixList (object): Information regarding the prefix list - - rules (array): Information regarding the prefix list rules - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "prefixLists", "deploy"], - "operation": "createOrganizationSwitchRoutingBgpFiltersPrefixListsDeploy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/prefixLists/deploy" - - body_params = [ - "network", - "prefixList", - "rules", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchRoutingBgpFiltersPrefixListsDeploy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchRoutingBgpFiltersPrefixListsOverviewByPrefixList( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the overview of the prefix lists configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-filters-prefix-lists-overview-by-prefix-list - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 prefix list overviews by network ID. This filter uses multiple exact matches. - - listIds (array): Optional parameter to filter prefix list overviews by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "routing", "bgp", "filters", "prefixLists", "overview", "byPrefixList"], - "operation": "getOrganizationSwitchRoutingBgpFiltersPrefixListsOverviewByPrefixList", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/prefixLists/overview/byPrefixList" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "listIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "listIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpFiltersPrefixListsOverviewByPrefixList: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpFiltersPrefixListsRules( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the prefix list rules configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-filters-prefix-lists-rules - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 prefix list rules by network ID. This filter uses multiple exact matches. - - prefixListIds (array): Optional parameter to filter prefix list rules by prefix list ID. This filter uses multiple exact matches. - - ruleIds (array): Optional parameter to filter prefix list rules by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "prefixLists", "rules"], - "operation": "getOrganizationSwitchRoutingBgpFiltersPrefixListsRules", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/prefixLists/rules" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "prefixListIds", - "ruleIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "prefixListIds", - "ruleIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpFiltersPrefixListsRules: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def deleteOrganizationSwitchRoutingBgpFiltersPrefixList(self, organizationId: str, listId: str): - """ - **Delete a prefix list** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-routing-bgp-filters-prefix-list - - - organizationId (string): Organization ID - - listId (string): List ID - """ - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "filters", "prefixLists"], - "operation": "deleteOrganizationSwitchRoutingBgpFiltersPrefixList", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - listId = urllib.parse.quote(str(listId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/filters/prefixLists/{listId}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchRoutingBgpPeersGroups(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the BGP peer groups configured in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-peers-groups - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 peer groups by network ID. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter peer groups by router ID. This filter uses multiple exact matches. - - profileIds (array): Optional parameter to filter peer groups by profile ID. This filter uses multiple exact matches. - - peerGroupIds (array): Optional parameter to filter peer groups by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "groups"], - "operation": "getOrganizationSwitchRoutingBgpPeersGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/groups" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "routerIds", - "profileIds", - "peerGroupIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "routerIds", - "profileIds", - "peerGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpPeersGroups: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpPeersGroupsAddressFamiliesDeployments( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List all BGP deployment information for multiple peer groups or address families configured in the given organization, including profile information, peer group address family information, neighbors, and listen ranges** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-peers-groups-address-families-deployments - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 peer group address family deployments by network ID. This filter uses multiple exact matches. - - peerGroupIds (array): Optional parameter to filter peer group address family deployments by peer group - - addressFamilyIds (array): Optional parameter to filter peer group address family deployments by address family - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "groups", "addressFamilies", "deployments"], - "operation": "getOrganizationSwitchRoutingBgpPeersGroupsAddressFamiliesDeployments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/groups/addressFamilies/deployments" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "peerGroupIds", - "addressFamilyIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "peerGroupIds", - "addressFamilyIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpPeersGroupsAddressFamiliesDeployments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchRoutingBgpPeersGroupsDeploy( - self, - organizationId: str, - addressFamily: dict, - network: dict, - peerGroup: dict, - peerGroupAddressFamilyBindingProfile: dict, - peerGroupProfile: dict, - policies: list, - router: dict, - **kwargs, - ): - """ - **Create or update a peer group, in addition to an associated peer group profile, peer group address family binding, peer group address family binding profile and routing policies associated with the peer group** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-peers-groups-deploy - - - organizationId (string): Organization ID - - addressFamily (object): Information regarding the address family the peer group address family binding belongs to - - network (object): Information regarding the network the peer group profile belongs to - - peerGroup (object): Information regarding the peer group - - peerGroupAddressFamilyBindingProfile (object): Information regarding the peer group address family binding profile - - peerGroupProfile (object): Information regarding the peer group profile - - policies (array): Information regarding the routing policies - - router (object): Information regarding the router this peer group belongs to - - peerGroupAddressFamilyBinding (object): Information regarding the peer group address family binding. Only required when updating. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "groups", "deploy"], - "operation": "createOrganizationSwitchRoutingBgpPeersGroupsDeploy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/groups/deploy" - - body_params = [ - "addressFamily", - "network", - "peerGroup", - "peerGroupAddressFamilyBinding", - "peerGroupAddressFamilyBindingProfile", - "peerGroupProfile", - "policies", - "router", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchRoutingBgpPeersGroupsDeploy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchRoutingBgpPeersGroupsDeployments( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List all BGP deployment information for peer groups configured in the given organization, including peer group address family information, as well as routing policies** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-peers-groups-deployments - - - 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 - 50. Default is 20. - - 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 peer group deployments by network ID. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter peer group deployments by router ID. This filter uses multiple exact matches. - - profileIds (array): Optional parameter to filter peer group deployments by profile ID. This filter uses multiple exact matches. - - peerGroupIds (array): Optional parameter to filter peer group deployments by peer group ID. This filter uses multiple exact matches. - - afi (string): Optional parameter to filter deployments on each peer group by address family identifier (AFI). - - safi (string): Optional parameter to filter deployments on each peer group by subsequent address family identifier (SAFI). - """ - - kwargs.update(locals()) - - if "afi" in kwargs: - options = ["ipv4"] - assert kwargs["afi"] in options, f'''"afi" cannot be "{kwargs["afi"]}", & must be set to one of: {options}''' - if "safi" in kwargs: - options = ["unicast"] - assert kwargs["safi"] in options, f'''"safi" cannot be "{kwargs["safi"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "groups", "deployments"], - "operation": "getOrganizationSwitchRoutingBgpPeersGroupsDeployments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/groups/deployments" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "routerIds", - "profileIds", - "peerGroupIds", - "afi", - "safi", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "routerIds", - "profileIds", - "peerGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpPeersGroupsDeployments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpPeersGroupsOverviewByPeerGroup( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the overview of the BGP peer groups configured in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-peers-groups-overview-by-peer-group - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 peer group overviews by network ID. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter peer group overviews by router ID. This filter uses multiple exact matches. - - profileIds (array): Optional parameter to filter peer group overviews by profile ID. This filter uses multiple exact matches. - - peerGroupIds (array): Optional parameter to filter peer group overviews by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "routing", "bgp", "peers", "groups", "overview", "byPeerGroup"], - "operation": "getOrganizationSwitchRoutingBgpPeersGroupsOverviewByPeerGroup", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/groups/overview/byPeerGroup" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "routerIds", - "profileIds", - "peerGroupIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "routerIds", - "profileIds", - "peerGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpPeersGroupsOverviewByPeerGroup: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpPeersListenRanges(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the listen ranges configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-peers-listen-ranges - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 listen ranges by network ID. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter listen ranges by router ID. This filter uses multiple exact matches. - - peerGroupIds (array): Optional parameter to filter listen ranges by peer group ID. This filter uses multiple exact matches. - - listenRangeIds (array): Optional parameter to filter listen ranges by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "listenRanges"], - "operation": "getOrganizationSwitchRoutingBgpPeersListenRanges", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/listenRanges" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "routerIds", - "peerGroupIds", - "listenRangeIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "routerIds", - "peerGroupIds", - "listenRangeIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpPeersListenRanges: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpPeersNeighbors(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the neighbors configured for BGP in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-peers-neighbors - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 neighbors by network ID. This filter uses multiple exact matches. - - peerGroupIds (array): Optional parameter to filter neighbors by peer group ID. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter neighbors by router ID. This filter uses multiple exact matches. - - neighborIds (array): Optional parameter to filter neighbors by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "neighbors"], - "operation": "getOrganizationSwitchRoutingBgpPeersNeighbors", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/neighbors" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "peerGroupIds", - "routerIds", - "neighborIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "peerGroupIds", - "routerIds", - "neighborIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpPeersNeighbors: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchRoutingBgpPeersNeighborsDeploy( - self, - organizationId: str, - addressFamily: dict, - neighbor: dict, - neighborAddressFamilyBinding: dict, - peerGroup: dict, - policies: list, - router: dict, - **kwargs, - ): - """ - **Create or update a neighor, in addition to an associated neighbor address family binding and routing policies associated with the neighbor** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-peers-neighbors-deploy - - - organizationId (string): Organization ID - - addressFamily (object): Information regarding the address family this binding is bound to - - neighbor (object): Information regarding the BPG neighbor - - neighborAddressFamilyBinding (object): Information regarding the neighbor address family binding - - peerGroup (object): Information regarding the peer group this neighbor belongs to - - policies (array): Information regarding the routing policies related to the neighbor - - router (object): Information regarding the router this neighbor peers with - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "neighbors", "deploy"], - "operation": "createOrganizationSwitchRoutingBgpPeersNeighborsDeploy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/neighbors/deploy" - - body_params = [ - "addressFamily", - "neighbor", - "neighborAddressFamilyBinding", - "peerGroup", - "policies", - "router", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchRoutingBgpPeersNeighborsDeploy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchRoutingBgpPeersNeighborsDeployments( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List all BGP deployment information for neighbors configured in the given organization, including address family information, as well as routing policies** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-peers-neighbors-deployments - - - 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 - 50. Default is 20. - - 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 neighbor deployments by network ID. This filter uses multiple exact matches. - - peerGroupIds (array): Optional parameter to filter neighbor deployments by peer group ID. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter neighbor deployments by router ID. This filter uses multiple exact matches. - - neighborIds (array): Optional parameter to filter neighbor deployments by neighbor ID. This filter uses multiple exact matches. - - afi (string): Optional parameter to filter deployments on each neighbor by address family identifier (AFI). - - safi (string): Optional parameter to filter deployments on each neighbor by subsequent address family identifier (SAFI). - """ - - kwargs.update(locals()) - - if "afi" in kwargs: - options = ["ipv4"] - assert kwargs["afi"] in options, f'''"afi" cannot be "{kwargs["afi"]}", & must be set to one of: {options}''' - if "safi" in kwargs: - options = ["unicast"] - assert kwargs["safi"] in options, f'''"safi" cannot be "{kwargs["safi"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "peers", "neighbors", "deployments"], - "operation": "getOrganizationSwitchRoutingBgpPeersNeighborsDeployments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/neighbors/deployments" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "peerGroupIds", - "routerIds", - "neighborIds", - "afi", - "safi", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "peerGroupIds", - "routerIds", - "neighborIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpPeersNeighborsDeployments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpRouters(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the routers configured in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-routers - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 50. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter routers by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter routers by serial. This filter uses multiple exact matches. - - switchNames (array): Optional parameter to filter routers by switch name. The filter uses multiple exact matches. - - asNumbers (array): Optional parameter to filter routers by autonomous system number. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter routers by ID. This filter uses multiple exact matches. - - switchStackIds (array): Optional parameter to filter routers by switch stack id. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "routers"], - "operation": "getOrganizationSwitchRoutingBgpRouters", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/routers" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - "switchNames", - "asNumbers", - "routerIds", - "switchStackIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "switchNames", - "asNumbers", - "routerIds", - "switchStackIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpRouters: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchRoutingBgpRoutersDeploy( - self, - organizationId: str, - addressFamily: dict, - addressFamilyPrefixes: list, - addressFamilyProfile: dict, - autonomousSystem: dict, - router: dict, - switch: dict, - **kwargs, - ): - """ - **Create a BGP router, in addition to an associated address family, address family prefixes, and address family profile** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-routers-deploy - - - organizationId (string): Organization ID - - addressFamily (object): Information regarding the address family - - addressFamilyPrefixes (array): The list of network prefixes to which the address family applies - - addressFamilyProfile (object): Information regarding the profile applied to the address family - - autonomousSystem (object): Information regarding the router's autonomous system - - router (object): Information regarding the BPG router - - switch (object): The router's switch node. When the router is part of a switch stack, this is the switch stack's active node - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "routers", "deploy"], - "operation": "createOrganizationSwitchRoutingBgpRoutersDeploy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/routers/deploy" - - body_params = [ - "addressFamily", - "addressFamilyPrefixes", - "addressFamilyProfile", - "autonomousSystem", - "router", - "switch", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchRoutingBgpRoutersDeploy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationSwitchRoutingBgpRoutersDeployments( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List all BGP deployment information for routers configured in a given organization, including all address families** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-routers-deployments - - - 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 - 50. Default is 20. - - 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 router deployments by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter router deployments by serial. This filter uses multiple exact matches. - - switchNames (array): Optional parameter to filter router deployments by switch name. The filter uses multiple exact matches. - - asNumbers (array): Optional parameter to filter router deployments by autonomous system number. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter router deployments by router ID. This filter uses multiple exact matches. - - switchStackIds (array): Optional parameter to filter router deployments by switch stack id. This filter uses multiple exact matches. - - afi (string): Optional parameter to filter deployments on each router by address family identifier (AFI). - - safi (string): Optional parameter to filter deployments on each router by subsequent address family identifier (SAFI). - """ - - kwargs.update(locals()) - - if "afi" in kwargs: - options = ["ipv4"] - assert kwargs["afi"] in options, f'''"afi" cannot be "{kwargs["afi"]}", & must be set to one of: {options}''' - if "safi" in kwargs: - options = ["unicast"] - assert kwargs["safi"] in options, f'''"safi" cannot be "{kwargs["safi"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "routers", "deployments"], - "operation": "getOrganizationSwitchRoutingBgpRoutersDeployments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/routers/deployments" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - "switchNames", - "asNumbers", - "routerIds", - "switchStackIds", - "afi", - "safi", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "switchNames", - "asNumbers", - "routerIds", - "switchStackIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpRoutersDeployments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchRoutingBgpRoutersOverviewByRouter( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the overview of the routers configured in the given organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-bgp-routers-overview-by-router - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 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 router overviews by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter router overviews by serial. This filter uses multiple exact matches. - - switchNames (array): Optional parameter to filter router overviews by switch name. This filter uses multiple exact matches. - - asNumbers (array): Optional parameter to filter router overviews by autonomous system number. This filter uses multiple exact matches. - - routerIds (array): Optional parameter to filter router overviews by ID. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "monitor", "routing", "bgp", "routers", "overview", "byRouter"], - "operation": "getOrganizationSwitchRoutingBgpRoutersOverviewByRouter", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/routers/overview/byRouter" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - "switchNames", - "asNumbers", - "routerIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "switchNames", - "asNumbers", - "routerIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingBgpRoutersOverviewByRouter: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationSwitchRoutingBgpRoutersPeersDeploy( - self, organizationId: str, addressFamily: dict, peerGroups: list, router: dict, **kwargs - ): - """ - **Create and update listen ranges, update peers' enabled flag, and delete peer groups for a BGP router** - https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-routing-bgp-routers-peers-deploy - - - organizationId (string): Organization ID - - addressFamily (object): Information regarding the address family - - peerGroups (array): Information regarding the peer group peers for a router's peer group - - router (object): Information regarding the BPG router - """ - - kwargs = locals() - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "routers", "peers", "deploy"], - "operation": "createOrganizationSwitchRoutingBgpRoutersPeersDeploy", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/routers/peers/deploy" - - body_params = [ - "addressFamily", - "peerGroups", - "router", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationSwitchRoutingBgpRoutersPeersDeploy: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def deleteOrganizationSwitchRoutingBgpRouter(self, organizationId: str, routerId: str): - """ - **Delete a router from an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-switch-routing-bgp-router - - - organizationId (string): Organization ID - - routerId (string): Router ID - """ - - metadata = { - "tags": ["switch", "configure", "routing", "bgp", "routers"], - "operation": "deleteOrganizationSwitchRoutingBgpRouter", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - routerId = urllib.parse.quote(str(routerId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/bgp/routers/{routerId}" - - return self._session.delete(metadata, resource) - - def getOrganizationSwitchRoutingStaticRoutes(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List layer 3 static routes for switches within an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-routing-static-routes - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter the result set by the included set of network IDs - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 20. - - 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": ["switch", "monitor", "routing", "staticRoutes"], - "operation": "getOrganizationSwitchRoutingStaticRoutes", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/routing/staticRoutes" - - query_params = [ - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchRoutingStaticRoutes: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchSpanningTree(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Returns Spanning Tree configuration settings** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-spanning-tree - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter by network ID. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["switch", "configure", "spanningTree"], - "operation": "getOrganizationSwitchSpanningTree", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/spanningTree" - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationSwitchSpanningTree: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationSwitchStacksPortsMirrorsByStack(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the port mirror configurations in an organization by switch** - https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-stacks-ports-mirrors-by-stack - - - 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 - - ids (array): Return the port mirror configuration for the specified stack(s) - - networkIds (array): Return the port mirror configurations for the specified network(s) - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. - - 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": ["switch", "configure", "stacks", "ports", "mirrors", "byStack"], - "operation": "getOrganizationSwitchStacksPortsMirrorsByStack", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/switch/stacks/ports/mirrors/byStack" - - query_params = [ - "ids", - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "ids", - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationSwitchStacksPortsMirrorsByStack: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationSwitchPortsUsageHistoryByDeviceByInterval: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) diff --git a/meraki/api/users.py b/meraki/api/users.py deleted file mode 100644 index f48c8b5..0000000 --- a/meraki/api/users.py +++ /dev/null @@ -1,838 +0,0 @@ -import urllib - - -class Users(object): - def __init__(self, session): - super(Users, self).__init__() - self._session = session - - def getOrganizationIamUsersAuthorizations( - self, organizationId: str, userIds: list, total_pages=1, direction="next", **kwargs - ): - """ - **List specific authorizations for the list of Meraki end users.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-authorizations - - - organizationId (string): Organization ID - - userIds (array): Meraki end user IDs - - 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 - 50. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "authorizations"], - "operation": "getOrganizationIamUsersAuthorizations", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "userIds", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "userIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationIamUsersAuthorizations: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationIamUsersAuthorization(self, organizationId: str, authZone: dict, **kwargs): - """ - **Authorize a Meraki end user for an auth zone.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-authorization - - - organizationId (string): Organization ID - - authZone (object): Auth zone - - email (string): Meraki end user's email - - idpUserId (string): Meraki end user's ID - - startsAt (string): Start time of the desired access for the authorization. Defaults to now. - - expiresAt (string): Expiration time of the desired access for the authorization - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "authorizations"], - "operation": "createOrganizationIamUsersAuthorization", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations" - - body_params = [ - "email", - "idpUserId", - "authZone", - "startsAt", - "expiresAt", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationIamUsersAuthorization: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationIamUsersAuthorizations(self, organizationId: str, **kwargs): - """ - **Update a Meraki end user's access to an auth zone.** - https://developer.cisco.com/meraki/api-v1/#!update-organization-iam-users-authorizations - - - organizationId (string): Organization ID - - authorizationId (string): Authorization ID - - email (string): Meraki end user's email - - authZone (object): Auth zone - - startsAt (string): Start time of the desired access for the authorization - - expiresAt (string): Expiration time of the desired access for the authorization - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "authorizations"], - "operation": "updateOrganizationIamUsersAuthorizations", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations" - - body_params = [ - "authorizationId", - "email", - "authZone", - "startsAt", - "expiresAt", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationIamUsersAuthorizations: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def revokeOrganizationIamUsersAuthorizationsAuthorization(self, organizationId: str, authZone: dict, **kwargs): - """ - **Revoke a Meraki end user's access to an auth zone.** - https://developer.cisco.com/meraki/api-v1/#!revoke-organization-iam-users-authorizations-authorization - - - organizationId (string): Organization ID - - authZone (object): Auth zone - - email (string): Meraki end user's email - - authorizationId (string): Authorization ID - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "authorizations", "authorization"], - "operation": "revokeOrganizationIamUsersAuthorizationsAuthorization", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations/authorization/revoke" - - body_params = [ - "email", - "authorizationId", - "authZone", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"revokeOrganizationIamUsersAuthorizationsAuthorization: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationIamUsersAuthorizationsZones(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List all of the available auth zones for an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-authorizations-zones - - - 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 10 - 1000. Default is 100. - - 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": ["users", "configure", "iam", "authorizations", "zones"], - "operation": "getOrganizationIamUsersAuthorizationsZones", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations/zones" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationIamUsersAuthorizationsZones: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def deleteOrganizationIamUsersAuthorization(self, organizationId: str, authorizationId: str): - """ - **Delete an authorization for a Meraki end user.** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-iam-users-authorization - - - organizationId (string): Organization ID - - authorizationId (string): Authorization ID - """ - - metadata = { - "tags": ["users", "configure", "iam", "authorizations"], - "operation": "deleteOrganizationIamUsersAuthorization", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - authorizationId = urllib.parse.quote(str(authorizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/authorizations/{authorizationId}" - - return self._session.delete(metadata, resource) - - def createOrganizationIamUsersIdp(self, organizationId: str, name: str, type: str, idpConfig: dict, **kwargs): - """ - **Create an identity provider for an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-idp - - - organizationId (string): Organization ID - - name (string): Name of the identity provider - - type (string): Type of the identity provider - - idpConfig (object): Identity provider configuration. Required for external identity providers. - - description (string): Optional. Description of the identity provider - - syncType (string): The synchronization method for the identity provider. Set to 'proactive' to sync all users and groups from your identity provider. - """ - - kwargs.update(locals()) - - if "type" in kwargs: - options = ["Azure AD"] - assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' - if "syncType" in kwargs and kwargs["syncType"] is not None: - options = ["proactive"] - assert kwargs["syncType"] in options, ( - f'''"syncType" cannot be "{kwargs["syncType"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["users", "configure", "iam", "idps"], - "operation": "createOrganizationIamUsersIdp", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps" - - body_params = [ - "name", - "type", - "description", - "idpConfig", - "syncType", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationIamUsersIdp: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def searchOrganizationIdpGroups(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Search all IdP groups for an organization** - https://developer.cisco.com/meraki/api-v1/#!search-organization-idp-groups - - - 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 - - idpIds (array): Filter IdP groups by IdP ID(s). Multiple IdP IDs can be passed as a comma separated list. - - authZone (object): Auth zone - - searchQuery (string): Fuzzy filter by group name - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "idps", "groups", "search"], - "operation": "searchOrganizationIdpGroups", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/groups/search" - - body_params = [ - "idpIds", - "authZone", - "searchQuery", - "perPage", - "startingAfter", - "endingBefore", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"searchOrganizationIdpGroups: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationIamUsersIdpsProductIntegrations(self, organizationId: str): - """ - **List all available IdP Product Integration urls for the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-idps-product-integrations - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["users", "configure", "iam", "idps", "productIntegrations"], - "operation": "getOrganizationIamUsersIdpsProductIntegrations", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/productIntegrations" - - return self._session.get(metadata, resource) - - def createOrganizationIamUsersIdpsSearch(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Search all IdPs for an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-idps-search - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - idpIds (array): Filter identity providers by id(s). Multiple ids can be passed as a comma separated list. - - type (string): Filter identity providers by idp type. - - authZone (object): Filter by auth zone - """ - - kwargs.update(locals()) - - if "type" in kwargs: - options = ["Azure AD"] - assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["users", "configure", "iam", "idps", "search"], - "operation": "createOrganizationIamUsersIdpsSearch", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/search" - - body_params = [ - "perPage", - "startingAfter", - "endingBefore", - "idpIds", - "type", - "authZone", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationIamUsersIdpsSearch: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationIamUsersIdpsSyncHistory(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get the IdP sync status records for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-idps-sync-history - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - idpId (string): Identity provider ID. Optional. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "idps", "sync", "history"], - "operation": "getOrganizationIamUsersIdpsSyncHistory", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/sync/history" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "idpId", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationIamUsersIdpsSyncHistory: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationIamUsersIdpsSyncLatest(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get the latest IdP sync status records for all IdPs in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-idps-sync-latest - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - idpIds (array): Identity provider IDs. Optional. - - authZoneId (string): Auth Zone ID - - authZoneType (string): Auth Zone type - """ - - kwargs.update(locals()) - - if "authZoneType" in kwargs: - options = ["access_policy", "node_group", "product", "ssid"] - assert kwargs["authZoneType"] in options, ( - f'''"authZoneType" cannot be "{kwargs["authZoneType"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["users", "configure", "iam", "idps", "sync", "latest"], - "operation": "getOrganizationIamUsersIdpsSyncLatest", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/sync/latest" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "idpIds", - "authZoneId", - "authZoneType", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "idpIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationIamUsersIdpsSyncLatest: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationIamUsersIdpsTestConnectivity(self, organizationId: str, **kwargs): - """ - **Test connectivity to an Entra ID identity provider.** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-idps-test-connectivity - - - organizationId (string): Organization ID - - idpId (string): Id of the identity provider - - idpConfig (object): Identity provider configuration. Required for external identity providers. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "idps", "testConnectivity"], - "operation": "createOrganizationIamUsersIdpsTestConnectivity", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/testConnectivity" - - body_params = [ - "idpId", - "idpConfig", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationIamUsersIdpsTestConnectivity: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def createOrganizationIamUsersIdpsUser(self, organizationId: str, **kwargs): - """ - **Create a Meraki user** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-idps-user - - - organizationId (string): Organization ID - - displayName (string): A human-readable identifier for the created user. - - email (string): An email address identified with the user. - - password (string): The password for the user account. - - sendPassword (boolean): If true, sends an email with the password to the user. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "idps"], - "operation": "createOrganizationIamUsersIdpsUser", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/users" - - body_params = [ - "displayName", - "email", - "password", - "sendPassword", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationIamUsersIdpsUser: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def updateOrganizationIamUsersIdpsUser(self, organizationId: str, id: str, **kwargs): - """ - **Update a Meraki user** - https://developer.cisco.com/meraki/api-v1/#!update-organization-iam-users-idps-user - - - organizationId (string): Organization ID - - id (string): ID - - displayName (string): A human-readable identifier for the created user. - - email (string): An email address identified with the user. - - password (string): The password for the user account. - - sendPassword (boolean): If true, sends an email with the password to the user. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "idps"], - "operation": "updateOrganizationIamUsersIdpsUser", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/users/{id}" - - body_params = [ - "displayName", - "email", - "password", - "sendPassword", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationIamUsersIdpsUser: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationIamUsersIdpsUser(self, organizationId: str, id: str): - """ - **Delete a Meraki end user** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-iam-users-idps-user - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["users", "configure", "iam", "idps"], - "operation": "deleteOrganizationIamUsersIdpsUser", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/users/{id}" - - return self._session.delete(metadata, resource) - - def createOrganizationIamUsersIdpSync(self, organizationId: str, idpId: str, **kwargs): - """ - **Trigger an IdP sync for an identity provider** - https://developer.cisco.com/meraki/api-v1/#!create-organization-iam-users-idp-sync - - - organizationId (string): Organization ID - - idpId (string): Idp ID - - emails (array): List of emails to sync - - force (boolean): Force a complete sync of all users and groups - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["users", "configure", "iam", "idps", "sync"], - "operation": "createOrganizationIamUsersIdpSync", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - idpId = urllib.parse.quote(str(idpId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/{idpId}/sync" - - body_params = [ - "emails", - "force", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"createOrganizationIamUsersIdpSync: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationIamUsersIdpSyncLatest(self, organizationId: str, idpId: str): - """ - **Get the latest IdP sync status for an identity provider** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-idp-sync-latest - - - organizationId (string): Organization ID - - idpId (string): Idp ID - """ - - metadata = { - "tags": ["users", "configure", "iam", "idps", "sync", "latest"], - "operation": "getOrganizationIamUsersIdpSyncLatest", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - idpId = urllib.parse.quote(str(idpId), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/{idpId}/sync/latest" - - return self._session.get(metadata, resource) - - def updateOrganizationIamUsersIdp(self, organizationId: str, id: str, **kwargs): - """ - **Update an identity provider** - https://developer.cisco.com/meraki/api-v1/#!update-organization-iam-users-idp - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of the identity provider - - description (string): Description of the identity provider - - idpConfig (object): Identity provider configuration. You can update individual attributes - - syncType (string): The synchronization method for the identity provider. Set to 'proactive' to sync all users and groups from your identity provider. Set to 'null' for on-demand user and group provisioning. - """ - - kwargs.update(locals()) - - if "syncType" in kwargs and kwargs["syncType"] is not None: - options = ["proactive"] - assert kwargs["syncType"] in options, ( - f'''"syncType" cannot be "{kwargs["syncType"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["users", "configure", "iam", "idps"], - "operation": "updateOrganizationIamUsersIdp", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/{id}" - - body_params = [ - "name", - "description", - "idpConfig", - "syncType", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateOrganizationIamUsersIdp: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationIamUsersIdp(self, organizationId: str, id: str): - """ - **Delete a identity provider from an organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-iam-users-idp - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["users", "configure", "iam", "idps"], - "operation": "deleteOrganizationIamUsersIdp", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/{id}" - - return self._session.delete(metadata, resource) - - def getOrganizationIamUsersIdpAuthZones(self, organizationId: str, id: str): - """ - **List all auth zones for an identity provider** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-idp-auth-zones - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["users", "configure", "iam", "idps", "authZones"], - "operation": "getOrganizationIamUsersIdpAuthZones", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/iam/users/idps/{id}/authZones" - - return self._session.get(metadata, resource) - - def searchOrganizationUsers(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the end users and their associated identity providers for an organization.** - https://developer.cisco.com/meraki/api-v1/#!search-organization-users - - - 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 - 50. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - userIds (array): Filter end users by id(s). - - idpIds (array): Filter by identity provider id(s). - - groupIds (array): Filter by identity provider group id(s). - - accessTypes (array): Filter by access type(s). - - searchQuery (string): Fuzzy filter by display name, user name and email. - - statuses (array): Filter by user status(es). - - sortKey (string): Optional parameter to specify the field used to sort results. (default: username) - - sortOrder (string): Optional parameter to specify the sort order. (default: asc) - """ - - kwargs.update(locals()) - - if "sortKey" in kwargs: - options = ["created_at", "updated_at", "username"] - assert kwargs["sortKey"] in options, ( - f'''"sortKey" cannot be "{kwargs["sortKey"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["users", "configure", "iam", "search"], - "operation": "searchOrganizationUsers", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/search" - - body_params = [ - "perPage", - "startingAfter", - "endingBefore", - "userIds", - "idpIds", - "groupIds", - "accessTypes", - "searchQuery", - "statuses", - "sortKey", - "sortOrder", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"searchOrganizationUsers: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - - def getOrganizationIamUsersSummaryPanel(self, organizationId: str): - """ - **Get the count of users and user groups for an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-iam-users-summary-panel - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["users", "configure", "iam", "summaryPanel"], - "operation": "getOrganizationIamUsersSummaryPanel", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/iam/users/summaryPanel" - - return self._session.get(metadata, resource) diff --git a/meraki/api/wireless.py b/meraki/api/wireless.py index cc0c21d..38af399 100644 --- a/meraki/api/wireless.py +++ b/meraki/api/wireless.py @@ -68,7 +68,6 @@ def updateDeviceWirelessBluetoothSettings(self, serial: str, **kwargs): Dashboard's automatically generated value. - minor (integer): Desired minor value of the beacon. If the value is set to null it will reset to Dashboard's automatically generated value. - - transmit (object): Transmit settings including power, interval, and advertised power. """ kwargs.update(locals()) @@ -84,7 +83,6 @@ def updateDeviceWirelessBluetoothSettings(self, serial: str, **kwargs): "uuid", "major", "minor", - "transmit", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -198,23 +196,6 @@ def updateDeviceWirelessElectronicShelfLabel(self, serial: str, **kwargs): return self._session.put(metadata, resource, payload) - def getDeviceWirelessHealthScores(self, serial: str): - """ - **Fetch the health scores for a given AP on this network** - https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-health-scores - - - serial (string): Serial - """ - - metadata = { - "tags": ["wireless", "monitor", "healthScores"], - "operation": "getDeviceWirelessHealthScores", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/healthScores" - - return self._session.get(metadata, resource) - def getDeviceWirelessLatencyStats(self, serial: str, **kwargs): """ **Aggregated latency info for a given AP on this network** @@ -267,123 +248,6 @@ def getDeviceWirelessLatencyStats(self, serial: str, **kwargs): return self._session.get(metadata, resource, params) - def getDeviceWirelessRadioAfcPosition(self, serial: str): - """ - **Return the position for a wireless device** - https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-radio-afc-position - - - serial (string): Serial - """ - - metadata = { - "tags": ["wireless", "configure", "radio", "afc", "position"], - "operation": "getDeviceWirelessRadioAfcPosition", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/radio/afc/position" - - return self._session.get(metadata, resource) - - def updateDeviceWirelessRadioAfcPosition(self, serial: str, **kwargs): - """ - **Update the position attributes for this device** - https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-radio-afc-position - - - serial (string): Serial - - height (object): Height attributes - - gps (object): GPS attributes - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "radio", "afc", "position"], - "operation": "updateDeviceWirelessRadioAfcPosition", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/radio/afc/position" - - body_params = [ - "height", - "gps", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateDeviceWirelessRadioAfcPosition: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getDeviceWirelessRadioAfcPowerLimits(self, serial: str): - """ - **Return the AFC power limits for a wireless device** - https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-radio-afc-power-limits - - - serial (string): Serial - """ - - metadata = { - "tags": ["wireless", "configure", "radio", "afc", "powerLimits"], - "operation": "getDeviceWirelessRadioAfcPowerLimits", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/radio/afc/powerLimits" - - return self._session.get(metadata, resource) - - def getDeviceWirelessRadioOverrides(self, serial: str): - """ - **Return the radio overrides of a device** - https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-radio-overrides - - - serial (string): Serial - """ - - metadata = { - "tags": ["wireless", "configure", "radio", "overrides"], - "operation": "getDeviceWirelessRadioOverrides", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/radio/overrides" - - return self._session.get(metadata, resource) - - def updateDeviceWirelessRadioOverrides(self, serial: str, **kwargs): - """ - **Update 2.4 GHz, 5 GHz, and 6 GHz radio settings (channel, channel width, power, and enable/disable) that override RF profiles.** - https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-radio-overrides - - - serial (string): Serial - - rfProfile (object): This device's RF profile - - radios (array): Radio overrides. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "radio", "overrides"], - "operation": "updateDeviceWirelessRadioOverrides", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/radio/overrides" - - body_params = [ - "rfProfile", - "radios", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateDeviceWirelessRadioOverrides: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - def getDeviceWirelessRadioSettings(self, serial: str): """ **Return the manually configured radio settings overrides of a device, which take precedence over RF profiles.** @@ -436,23 +300,6 @@ def updateDeviceWirelessRadioSettings(self, serial: str, **kwargs): return self._session.put(metadata, resource, payload) - def getDeviceWirelessRadioStatus(self, serial: str): - """ - **Show the status of this device's radios** - https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-radio-status - - - serial (string): Serial - """ - - metadata = { - "tags": ["wireless", "configure", "radio", "status"], - "operation": "getDeviceWirelessRadioStatus", - } - serial = urllib.parse.quote(str(serial), safe="") - resource = f"/devices/{serial}/wireless/radio/status" - - return self._session.get(metadata, resource) - def getDeviceWirelessStatus(self, serial: str): """ **Return the SSID statuses of an access point** @@ -808,7 +655,6 @@ def updateNetworkWirelessBluetoothSettings(self, networkId: str, **kwargs): - majorMinorAssignmentMode (string): The way major and minor number should be assigned to nodes in the network. ('Unique', 'Non-unique') - major (integer): The major number to be used in the beacon identifier. Only valid in 'Non-unique' mode. - minor (integer): The minor number to be used in the beacon identifier. Only valid in 'Non-unique' mode. - - transmit (object): Transmit settings. """ kwargs.update(locals()) @@ -833,7 +679,6 @@ def updateNetworkWirelessBluetoothSettings(self, networkId: str, **kwargs): "majorMinorAssignmentMode", "major", "minor", - "transmit", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1003,23 +848,6 @@ def getNetworkWirelessClientsConnectionStats(self, networkId: str, **kwargs): return self._session.get(metadata, resource, params) - def getNetworkWirelessClientsHealthScores(self, networkId: str): - """ - **Fetch the health scores for all clients on this network** - https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-clients-health-scores - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["wireless", "monitor", "clients", "healthScores"], - "operation": "getNetworkWirelessClientsHealthScores", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/clients/healthScores" - - return self._session.get(metadata, resource) - def getNetworkWirelessClientsLatencyStats(self, networkId: str, **kwargs): """ **Aggregated latency info for this network, grouped by clients** @@ -1074,53 +902,6 @@ def getNetworkWirelessClientsLatencyStats(self, networkId: str, **kwargs): return self._session.get(metadata, resource, params) - def getNetworkWirelessClientsOnboardingHistory(self, networkId: str, **kwargs): - """ - **Return counts of distinct wireless clients connecting to a network over time** - https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-clients-onboarding-history - - - networkId (string): Network ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 7 days. - - resolution (integer): The time resolution in seconds for returned data. The valid resolutions are: 300. The default is 300. - - band (string): Filter results by band (either '2.4', '5' or '6'); this cannot be combined with the SSID filter. - - ssid (integer): Filter results by SSID number; this cannot be combined with the band filter. - """ - - kwargs.update(locals()) - - if "band" in kwargs: - options = ["2.4", "5", "6"] - assert kwargs["band"] in options, f'''"band" cannot be "{kwargs["band"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["wireless", "monitor", "clients", "onboardingHistory"], - "operation": "getNetworkWirelessClientsOnboardingHistory", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/clients/onboardingHistory" - - query_params = [ - "t0", - "t1", - "timespan", - "resolution", - "band", - "ssid", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getNetworkWirelessClientsOnboardingHistory: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - def getNetworkWirelessClientConnectionStats(self, networkId: str, clientId: str, **kwargs): """ **Aggregated connectivity info for a given client on this network** @@ -1257,25 +1038,6 @@ def getNetworkWirelessClientConnectivityEvents( return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getNetworkWirelessClientHealthScores(self, networkId: str, clientId: str): - """ - **Fetch the health scores for a given client on this network** - https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-client-health-scores - - - networkId (string): Network ID - - clientId (string): Client ID - """ - - metadata = { - "tags": ["wireless", "monitor", "clients", "healthScores"], - "operation": "getNetworkWirelessClientHealthScores", - } - networkId = urllib.parse.quote(str(networkId), safe="") - clientId = urllib.parse.quote(str(clientId), safe="") - resource = f"/networks/{networkId}/wireless/clients/{clientId}/healthScores" - - return self._session.get(metadata, resource) - def getNetworkWirelessClientLatencyHistory(self, networkId: str, clientId: str, **kwargs): """ **Return the latency history for a client** @@ -1371,53 +1133,6 @@ def getNetworkWirelessClientLatencyStats(self, networkId: str, clientId: str, ** return self._session.get(metadata, resource, params) - def getNetworkWirelessClientRoamingHistory(self, networkId: str, clientId: str, total_pages=1, direction="next", **kwargs): - """ - **Get client roam events within the specified timespan.** - https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-client-roaming-history - - - networkId (string): Network ID - - clientId (string): Client ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "clients", "roaming", "history"], - "operation": "getNetworkWirelessClientRoamingHistory", - } - networkId = urllib.parse.quote(str(networkId), safe="") - clientId = urllib.parse.quote(str(clientId), safe="") - resource = f"/networks/{networkId}/wireless/clients/{clientId}/roaming/history" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getNetworkWirelessClientRoamingHistory: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getNetworkWirelessConnectionStats(self, networkId: str, **kwargs): """ **Aggregated connectivity info for this network** @@ -1569,23 +1284,6 @@ def getNetworkWirelessDevicesConnectionStats(self, networkId: str, **kwargs): return self._session.get(metadata, resource, params) - def getNetworkWirelessDevicesHealthScores(self, networkId: str): - """ - **Fetch the health scores of all APs on this network** - https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-devices-health-scores - - - networkId (string): Network ID - """ - - metadata = { - "tags": ["wireless", "monitor", "devices", "healthScores"], - "operation": "getNetworkWirelessDevicesHealthScores", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/devices/healthScores" - - return self._session.get(metadata, resource) - def getNetworkWirelessDevicesLatencyStats(self, networkId: str, **kwargs): """ **Aggregated latency info for this network, grouped by node** @@ -1741,7 +1439,6 @@ def createNetworkWirelessEthernetPortsProfile(self, networkId: str, name: str, p - name (string): AP port profile name - ports (array): AP ports configuration - usbPorts (array): AP usb ports configuration - - security (object): AP port security configuration """ kwargs.update(locals()) @@ -1757,7 +1454,6 @@ def createNetworkWirelessEthernetPortsProfile(self, networkId: str, name: str, p "name", "ports", "usbPorts", - "security", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1868,7 +1564,6 @@ def updateNetworkWirelessEthernetPortsProfile(self, networkId: str, profileId: s - name (string): AP port profile name - ports (array): AP ports configuration - usbPorts (array): AP usb ports configuration - - security (object): AP port security configuration """ kwargs.update(locals()) @@ -1885,7 +1580,6 @@ def updateNetworkWirelessEthernetPortsProfile(self, networkId: str, profileId: s "name", "ports", "usbPorts", - "security", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2117,41 +1811,6 @@ def updateNetworkWirelessLocationScanning(self, networkId: str, **kwargs): return self._session.put(metadata, resource, payload) - def updateNetworkWirelessLocationWayfinding(self, networkId: str, **kwargs): - """ - **Change client wayfinding settings** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-location-wayfinding - - - networkId (string): Network ID - - enabled (boolean): Whether to enable client wayfinding on that network (only supported on Wireless networks). - - maintenanceWindow (object): Maintenance window during which optimization might take place to improve location accuracy. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "location", "wayfinding"], - "operation": "updateNetworkWirelessLocationWayfinding", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/location/wayfinding" - - body_params = [ - "enabled", - "maintenanceWindow", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateNetworkWirelessLocationWayfinding: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - def getNetworkWirelessMeshStatuses(self, networkId: str, total_pages=1, direction="next", **kwargs): """ **List wireless mesh statuses for repeaters** @@ -2189,26 +1848,32 @@ def getNetworkWirelessMeshStatuses(self, networkId: str, total_pages=1, directio return self._session.get_pages(metadata, resource, params, total_pages, direction) - def updateNetworkWirelessOpportunisticPcap(self, networkId: str, **kwargs): + def updateNetworkWirelessRadioRrm(self, networkId: str, **kwargs): """ - **Update the Opportunistic Pcap settings for a wireless network** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-opportunistic-pcap + **Update the AutoRF settings for a wireless network** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-radio-rrm - networkId (string): Network ID - - enablement (object): Enablement settings + - busyHour (object): Busy Hour settings + - channel (object): Channel settings + - fra (object): FRA settings + - ai (object): AI settings """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "opportunisticPcap"], - "operation": "updateNetworkWirelessOpportunisticPcap", + "tags": ["wireless", "configure", "radio", "rrm"], + "operation": "updateNetworkWirelessRadioRrm", } networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/opportunisticPcap" + resource = f"/networks/{networkId}/wireless/radio/rrm" body_params = [ - "enablement", + "busyHour", + "channel", + "fra", + "ai", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2216,90 +1881,14 @@ def updateNetworkWirelessOpportunisticPcap(self, networkId: str, **kwargs): all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning( - f"updateNetworkWirelessOpportunisticPcap: ignoring unrecognized kwargs: {invalid}" - ) + self._session._logger.warning(f"updateNetworkWirelessRadioRrm: ignoring unrecognized kwargs: {invalid}") return self._session.put(metadata, resource, payload) - def updateNetworkWirelessRadioAutoRf(self, networkId: str, **kwargs): + def getNetworkWirelessRfProfiles(self, networkId: str, **kwargs): """ - **Update the AutoRF settings for a wireless network** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-radio-auto-rf - - - networkId (string): Network ID - - busyHour (object): Busy Hour settings - - channel (object): Channel settings - - fra (object): FRA settings - - aiRrm (object): AI-RRM settings - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "radio", "autoRf"], - "operation": "updateNetworkWirelessRadioAutoRf", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/radio/autoRf" - - body_params = [ - "busyHour", - "channel", - "fra", - "aiRrm", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkWirelessRadioAutoRf: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def updateNetworkWirelessRadioRrm(self, networkId: str, **kwargs): - """ - **Update the AutoRF settings for a wireless network** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-radio-rrm - - - networkId (string): Network ID - - busyHour (object): Busy Hour settings - - channel (object): Channel settings - - fra (object): FRA settings - - ai (object): AI settings - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "radio", "rrm"], - "operation": "updateNetworkWirelessRadioRrm", - } - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/wireless/radio/rrm" - - body_params = [ - "busyHour", - "channel", - "fra", - "ai", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"updateNetworkWirelessRadioRrm: ignoring unrecognized kwargs: {invalid}") - - return self._session.put(metadata, resource, payload) - - def getNetworkWirelessRfProfiles(self, networkId: str, **kwargs): - """ - **List RF profiles for this network** - https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-rf-profiles + **List RF profiles for this network** + https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-rf-profiles - networkId (string): Network ID - includeTemplateProfiles (boolean): If the network is bound to a template, this parameter controls whether or not the non-basic RF profiles defined on the template should be included in the response alongside the non-basic profiles defined on the bound network. Defaults to false. @@ -2344,7 +1933,6 @@ def createNetworkWirelessRfProfile(self, networkId: str, name: str, bandSelectio - transmission (object): Settings related to radio transmission. - perSsidSettings (object): Per-SSID radio settings by number. - flexRadios (object): Flex radio settings. - - dot11be (object): 802.11be settings """ kwargs.update(locals()) @@ -2379,7 +1967,6 @@ def createNetworkWirelessRfProfile(self, networkId: str, name: str, bandSelectio "transmission", "perSsidSettings", "flexRadios", - "dot11be", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2411,7 +1998,6 @@ def updateNetworkWirelessRfProfile(self, networkId: str, rfProfileId: str, **kwa - transmission (object): Settings related to radio transmission. - perSsidSettings (object): Per-SSID radio settings by number. - flexRadios (object): Flex radio settings. - - dot11be (object): 802.11be settings """ kwargs.update(locals()) @@ -2449,7 +2035,6 @@ def updateNetworkWirelessRfProfile(self, networkId: str, rfProfileId: str, **kwa "transmission", "perSsidSettings", "flexRadios", - "dot11be", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2667,7 +2252,6 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - number (string): Number - name (string): The name of the SSID - enabled (boolean): Whether or not the SSID is enabled - - localAuth (boolean): Extended local auth flag for Enterprise NAC - authMode (string): The association control method for the SSID ('open', 'open-enhanced', 'psk', 'open-with-radius', 'open-enhanced-with-radius', 'open-with-nac', '8021x-meraki', '8021x-nac', '8021x-radius', '8021x-google', '8021x-entra', '8021x-localradius', 'ipsk-with-radius', 'ipsk-without-radius', 'ipsk-with-nac' or 'ipsk-with-radius-easy-psk') - enterpriseAdminAccess (string): Whether or not an SSID is accessible by 'enterprise' administrators ('access disabled' or 'access enabled') - ssidAdminAccessible (boolean): SSID Administrator access status @@ -2699,7 +2283,6 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - radiusAccountingInterimInterval (integer): The interval (in seconds) in which accounting information is updated and sent to the RADIUS accounting server. - radiusAttributeForGroupPolicies (string): Specify the RADIUS attribute used to look up group policies ('Filter-Id', 'Reply-Message', 'Airespace-ACL-Name' or 'Aruba-User-Role'). Access points must receive this attribute in the RADIUS Access-Accept message - ipAssignmentMode (string): The client IP assignment mode ('NAT mode', 'Bridge mode', 'Layer 3 roaming', 'Ethernet over GRE', 'Layer 3 roaming with a concentrator', 'VPN' or 'Campus Gateway') - - campusGateway (object): Campus gateway settings - useVlanTagging (boolean): Whether or not traffic should be directed to use specific VLANs. This param is only valid if the ipAssignmentMode is 'Bridge mode' or 'Layer 3 roaming' - concentratorNetworkId (string): The concentrator to use when the ipAssignmentMode is 'Layer 3 roaming with a concentrator' or 'VPN'. - secondaryConcentratorNetworkId (string): The secondary concentrator to use when the ipAssignmentMode is 'VPN'. If configured, the APs will switch to using this concentrator if the primary concentrator is unreachable. This param is optional. ('disabled' represents no secondary concentrator.) @@ -2821,7 +2404,6 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): body_params = [ "name", "enabled", - "localAuth", "authMode", "enterpriseAdminAccess", "ssidAdminAccessible", @@ -2853,7 +2435,6 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): "radiusAccountingInterimInterval", "radiusAttributeForGroupPolicies", "ipAssignmentMode", - "campusGateway", "useVlanTagging", "concentratorNetworkId", "secondaryConcentratorNetworkId", @@ -3436,154 +3017,6 @@ def updateNetworkWirelessSsidOpenRoaming(self, networkId: str, number: str, **kw return self._session.put(metadata, resource, payload) - def updateNetworkWirelessSsidPoliciesClientExclusion(self, networkId: str, number: str, **kwargs): - """ - **Update the client exclusion status configuration for a given SSID** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ssid-policies-client-exclusion - - - networkId (string): Network ID - - number (string): Number - - static (object): Static client exclusion status - - dynamic (object): Dynamic client exclusion configuration - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "ssids", "policies", "clientExclusion"], - "operation": "updateNetworkWirelessSsidPoliciesClientExclusion", - } - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/wireless/ssids/{number}/policies/clientExclusion" - - body_params = [ - "static", - "dynamic", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateNetworkWirelessSsidPoliciesClientExclusion: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def updateNetworkWirelessSsidPoliciesClientExclusionStaticExclusions( - self, networkId: str, number: str, macs: list, **kwargs - ): - """ - **Replace the static client exclusion list for the given SSID (use PUT /exclusions)** - https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ssid-policies-client-exclusion-static-exclusions - - - networkId (string): Network ID - - number (string): Number - - macs (array): MAC addresses to set as static exclusion list - """ - - kwargs = locals() - - metadata = { - "tags": ["wireless", "configure", "ssids", "policies", "clientExclusion", "static", "exclusions"], - "operation": "updateNetworkWirelessSsidPoliciesClientExclusionStaticExclusions", - } - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/wireless/ssids/{number}/policies/clientExclusion/static/exclusions" - - body_params = [ - "macs", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateNetworkWirelessSsidPoliciesClientExclusionStaticExclusions: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def createNetworkWirelessSsidPoliciesClientExclusionStaticExclusionsBulkAdd( - self, networkId: str, number: str, macs: list, **kwargs - ): - """ - **Add MAC addresses to the existing static client exclusion list for the given SSID (use POST /bulkAdd)** - https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-ssid-policies-client-exclusion-static-exclusions-bulk-add - - - networkId (string): Network ID - - number (string): Number - - macs (array): MAC addresses to add to static exclusion - """ - - kwargs = locals() - - metadata = { - "tags": ["wireless", "configure", "ssids", "policies", "clientExclusion", "static", "exclusions", "bulkAdd"], - "operation": "createNetworkWirelessSsidPoliciesClientExclusionStaticExclusionsBulkAdd", - } - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/wireless/ssids/{number}/policies/clientExclusion/static/exclusions/bulkAdd" - - body_params = [ - "macs", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createNetworkWirelessSsidPoliciesClientExclusionStaticExclusionsBulkAdd: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def createNetworkWirelessSsidPoliciesClientExclusionStaticExclusionsBulkRemove( - self, networkId: str, number: str, macs: list, **kwargs - ): - """ - **Remove MAC addresses from the existing static client exclusion list for the given SSID (use POST /bulkRemove)** - https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-ssid-policies-client-exclusion-static-exclusions-bulk-remove - - - networkId (string): Network ID - - number (string): Number - - macs (array): MAC addresses to remove from static exclusion - """ - - kwargs = locals() - - metadata = { - "tags": ["wireless", "configure", "ssids", "policies", "clientExclusion", "static", "exclusions", "bulkRemove"], - "operation": "createNetworkWirelessSsidPoliciesClientExclusionStaticExclusionsBulkRemove", - } - networkId = urllib.parse.quote(str(networkId), safe="") - number = urllib.parse.quote(str(number), safe="") - resource = f"/networks/{networkId}/wireless/ssids/{number}/policies/clientExclusion/static/exclusions/bulkRemove" - - body_params = [ - "macs", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createNetworkWirelessSsidPoliciesClientExclusionStaticExclusionsBulkRemove: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - def getNetworkWirelessSsidSchedules(self, networkId: str, number: str): """ **List the outage schedule for the SSID** @@ -3672,7 +3105,6 @@ def updateNetworkWirelessSsidSplashSettings(self, networkId: str, number: str, * - redirectUrl (string): The custom redirect URL where the users will go after the splash page. - useRedirectUrl (boolean): The Boolean indicating whether the the user will be redirected to the custom redirect URL after the splash page. A custom redirect URL must be set if this is true. - welcomeMessage (string): The welcome message for the users on the splash page. - - language (string): Language of splash page. - userConsent (object): User consent settings - themeId (string): The id of the selected splash theme. - splashLogo (object): The logo used in the splash page. @@ -3694,32 +3126,6 @@ def updateNetworkWirelessSsidSplashSettings(self, networkId: str, number: str, * assert kwargs["splashTimeout"] in options, ( f'''"splashTimeout" cannot be "{kwargs["splashTimeout"]}", & must be set to one of: {options}''' ) - if "language" in kwargs: - options = [ - "DA", - "DE", - "EL", - "EN", - "ES", - "FI", - "FR", - "GL", - "IT", - "JA", - "KO", - "NL", - "NO", - "PL", - "PT", - "RU", - "SK", - "SV", - "UK", - "ZH", - ] - assert kwargs["language"] in options, ( - f'''"language" cannot be "{kwargs["language"]}", & must be set to one of: {options}''' - ) if "controllerDisconnectionBehavior" in kwargs: options = ["default", "open", "restricted"] assert kwargs["controllerDisconnectionBehavior"] in options, ( @@ -3741,7 +3147,6 @@ def updateNetworkWirelessSsidSplashSettings(self, networkId: str, number: str, * "redirectUrl", "useRedirectUrl", "welcomeMessage", - "language", "userConsent", "themeId", "splashLogo", @@ -3974,38 +3379,34 @@ def updateNetworkWirelessZigbee(self, networkId: str, **kwargs): return self._session.put(metadata, resource, payload) - def getOrganizationAssuranceConnectivityWirelessRfHealthByBand(self, organizationId: str, networkIds: list, **kwargs): + def getOrganizationWirelessAirMarshalRules(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Show the by-device RF Health score overview information for the organization in the given interval** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-connectivity-wireless-rf-health-by-band + **Returns the current Air Marshal rules for this organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-air-marshal-rules - organizationId (string): Organization ID - - networkIds (array): Networks for which information should be gathered. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 1 day. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 3600, 14400, 86400. The default is 3600. Interval is calculated if time params are provided. - - minimumRfHealthScore (integer): Minimum RF Health score for an AP to be retrieved. - - maximumRfHealthScore (integer): Maximum RF Health score for an AP to be retrieved. + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - networkIds (array): (optional) The set of network IDs to include. + - 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": ["wireless", "configure", "connectivity", "rfHealth", "byBand"], - "operation": "getOrganizationAssuranceConnectivityWirelessRfHealthByBand", + "tags": ["wireless", "configure", "airMarshal", "rules"], + "operation": "getOrganizationWirelessAirMarshalRules", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/connectivity/wireless/rfHealth/byBand" + resource = f"/organizations/{organizationId}/wireless/airMarshal/rules" query_params = [ - "t0", - "t1", - "timespan", - "interval", "networkIds", - "minimumRfHealthScore", - "maximumRfHealthScore", + "perPage", + "startingAfter", + "endingBefore", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} @@ -4022,26 +3423,23 @@ def getOrganizationAssuranceConnectivityWirelessRfHealthByBand(self, organizatio invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceConnectivityWirelessRfHealthByBand: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessAirMarshalRules: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceImpactedDeviceWirelessByNetwork( + def getOrganizationWirelessAirMarshalSettingsByNetwork( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **Returns count of impacted wireless devices per network on a given organization and time range.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-impacted-device-wireless-by-network + **Returns the current Air Marshal settings for this network** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-air-marshal-settings-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 - - networkGroupIds (array): Filter results by a list of network group IDs. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 2 hours and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 5000. Default is 1000. + - networkIds (array): The network IDs to include in the result set. + - 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. """ @@ -4049,17 +3447,14 @@ def getOrganizationAssuranceImpactedDeviceWirelessByNetwork( kwargs.update(locals()) metadata = { - "tags": ["wireless", "monitor", "impactedDevice", "byNetwork"], - "operation": "getOrganizationAssuranceImpactedDeviceWirelessByNetwork", + "tags": ["wireless", "configure", "airMarshal", "settings", "byNetwork"], + "operation": "getOrganizationWirelessAirMarshalSettingsByNetwork", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/impactedDevice/wireless/byNetwork" + resource = f"/organizations/{organizationId}/wireless/airMarshal/settings/byNetwork" query_params = [ - "networkGroupIds", - "t0", - "t1", - "timespan", + "networkIds", "perPage", "startingAfter", "endingBefore", @@ -4067,7 +3462,7 @@ def getOrganizationAssuranceImpactedDeviceWirelessByNetwork( params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "networkGroupIds", + "networkIds", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4079,29 +3474,23 @@ def getOrganizationAssuranceImpactedDeviceWirelessByNetwork( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceImpactedDeviceWirelessByNetwork: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessAirMarshalSettingsByNetwork: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationWirelessClientsOverviewByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Summarizes wireless post connection capacity successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network + **List access point client count at the moment in an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-overview-by-device - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - networkIds (array): Optional parameter to filter access points client counts by network ID. This filter uses multiple exact matches. + - serials (array): Optional parameter to filter access points client counts by its serial numbers. This filter uses multiple exact matches. + - campusGatewayClusterIds (array): Optional parameter to filter access points client counts by MCG cluster IDs. This filter uses multiple exact matches. + - 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. """ @@ -4109,20 +3498,16 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetwork( kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetwork", + "tags": ["wireless", "monitor", "clients", "overview", "byDevice"], + "operation": "getOrganizationWirelessClientsOverviewByDevice", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork" + resource = f"/organizations/{organizationId}/wireless/clients/overview/byDevice" query_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", + "campusGatewayClusterIds", "perPage", "startingAfter", "endingBefore", @@ -4132,8 +3517,7 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetwork( array_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", + "campusGatewayClusterIds", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4145,61 +3529,57 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetwork( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetwork: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessClientsOverviewByDevice: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByBand( + def getOrganizationWirelessDevicesChannelUtilizationByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **Summarizes wireless post connection capacity successes and failures by band.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network-by-band + **Get average channel utilization for all bands in a network, split by AP** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-by-device - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - serials (array): Filter results by device. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 7 days. + - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "byNetwork", "byBand"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByBand", + "tags": ["wireless", "monitor", "devices", "channelUtilization", "byDevice"], + "operation": "getOrganizationWirelessDevicesChannelUtilizationByDevice", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork/byBand" + resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/byDevice" query_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", "perPage", "startingAfter", "endingBefore", - ] + "t0", + "t1", + "timespan", + "interval", + ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4211,61 +3591,57 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByBand invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByBand: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesChannelUtilizationByDevice: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClient( + def getOrganizationWirelessDevicesChannelUtilizationByNetwork( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **Summarizes wireless post connection capacity successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network-by-client + **Get average channel utilization across all bands for all networks in the organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-by-network - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - serials (array): Filter results by device. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 7 days. + - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "byNetwork", "byClient"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClient", + "tags": ["wireless", "monitor", "devices", "channelUtilization", "byNetwork"], + "operation": "getOrganizationWirelessDevicesChannelUtilizationByNetwork", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork/byClient" + resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/byNetwork" query_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", "perPage", "startingAfter", "endingBefore", + "t0", + "t1", + "timespan", + "interval", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4277,61 +3653,57 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClie invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClient: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesChannelUtilizationByNetwork: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClientOs( + def getOrganizationWirelessDevicesChannelUtilizationHistoryByDeviceByInterval( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **Summarizes wireless post connection capacity successes and failures by client OS and driver version.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network-by-client-os + **Get a time-series of average channel utilization for all bands, segmented by device.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-history-by-device-by-interval - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - serials (array): Filter results by device. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 7 days. + - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "byNetwork", "byClientOs"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClientOs", + "tags": ["wireless", "monitor", "devices", "channelUtilization", "history", "byDevice", "byInterval"], + "operation": "getOrganizationWirelessDevicesChannelUtilizationHistoryByDeviceByInterval", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork/byClientOs" + resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/history/byDevice/byInterval" query_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", "perPage", "startingAfter", "endingBefore", + "t0", + "t1", + "timespan", + "interval", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4343,61 +3715,57 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClie invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClientOs: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesChannelUtilizationHistoryByDeviceByInterval: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClientType( + def getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **Summarizes wireless post connection capacity successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network-by-client-type + **Get a time-series of average channel utilization for all bands** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-history-by-network-by-interval - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - serials (array): Filter results by device. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 7 days. + - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "byNetwork", "byClientType"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClientType", + "tags": ["wireless", "monitor", "devices", "channelUtilization", "history", "byNetwork", "byInterval"], + "operation": "getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork/byClientType" + resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/history/byNetwork/byInterval" query_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", "perPage", "startingAfter", "endingBefore", + "t0", + "t1", + "timespan", + "interval", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4409,61 +3777,44 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClie invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByClientType: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationWirelessDevicesEthernetStatuses(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Summarizes wireless post connection capacity successes and failures by device.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network-by-device + **List the most recent Ethernet link speed, duplex, aggregation and power mode and status information for wireless devices.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-ethernet-statuses - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - 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): A list of Meraki network IDs to filter results to contain only specified networks. E.g.: networkIds[]=N_12345678&networkIds[]=L_3456 """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "byNetwork", "byDevice"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByDevice", + "tags": ["wireless", "monitor", "devices", "ethernet", "statuses"], + "operation": "getOrganizationWirelessDevicesEthernetStatuses", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork/byDevice" + resource = f"/organizations/{organizationId}/wireless/devices/ethernet/statuses" query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", "perPage", "startingAfter", "endingBefore", + "networkIds", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", - "serials", - "ssidNumbers", - "bands", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4475,63 +3826,59 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByDevi invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByDevice: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesEthernetStatuses: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationWirelessDevicesPacketLossByClient(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Time-series of wireless post connection capacity successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network-by-interval + **Get average packet loss for the given timespan for all clients in the organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-client - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 14400, 86400. The default is 300. Interval is calculated if time params are provided. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - ssids (array): Filter results by SSID number. + - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. + - macs (array): Filter results by client mac address(es). + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 90 days. The default is 7 days. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "monitor", "experience", "channelAvailability", "byNetwork", "byInterval"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByInterval", + "tags": ["wireless", "monitor", "devices", "packetLoss", "byClient"], + "operation": "getOrganizationWirelessDevicesPacketLossByClient", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork/byInterval" + resource = f"/organizations/{organizationId}/wireless/devices/packetLoss/byClient" query_params = [ "networkIds", - "serials", - "ssidNumbers", + "ssids", "bands", - "t0", - "t1", - "timespan", - "interval", + "macs", "perPage", "startingAfter", "endingBefore", + "t0", + "t1", + "timespan", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", - "serials", - "ssidNumbers", + "ssids", "bands", + "macs", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4543,60 +3890,58 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByInte invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesPacketLossByClient: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationWirelessDevicesPacketLossByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Summarizes wireless post connection capacity successes and failures by ssid.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-by-network-by-ssid + **Get average packet loss for the given timespan for all devices in the organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-device - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - serials (array): Filter results by device. + - ssids (array): Filter results by SSID number. + - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 90 days. The default is 7 days. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "byNetwork", "bySsid"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkBySsid", + "tags": ["wireless", "monitor", "devices", "packetLoss", "byDevice"], + "operation": "getOrganizationWirelessDevicesPacketLossByDevice", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/byNetwork/bySsid" + resource = f"/organizations/{organizationId}/wireless/devices/packetLoss/byDevice" query_params = [ "networkIds", "serials", - "ssidNumbers", + "ssids", "bands", - "t0", - "t1", - "timespan", "perPage", "startingAfter", "endingBefore", + "t0", + "t1", + "timespan", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", "serials", - "ssidNumbers", + "ssids", "bands", ] for k, v in kwargs.items(): @@ -4609,77 +3954,60 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkBySsid invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityByNetworkBySsid: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesPacketLossByDevice: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwork( + def getOrganizationWirelessDevicesPacketLossByNetwork( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **Provides insights into wireless capacity experience by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-channel-availability-insights-by-network + **Get average packet loss for the given timespan for all networks in the organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-network - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - contributor (string): Contributor for which to retrieve insights. If not specified, returns overall insights. - - subContributor (string): Sub-contributor for which to retrieve insights. If not specified, returns all sub contributor insights. - - insights (string): Insights version to use. Defaults to 2. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - serials (array): Filter results by device. + - ssids (array): Filter results by SSID number. + - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 90 days. The default is 7 days. """ kwargs.update(locals()) - if "contributor" in kwargs: - options = ["Co-channel interference", "High traffic", "Non-wifi interference"] - assert kwargs["contributor"] in options, ( - f'''"contributor" cannot be "{kwargs["contributor"]}", & must be set to one of: {options}''' - ) - if "insights" in kwargs: - options = ["1", "2"] - assert kwargs["insights"] in options, ( - f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' - ) - metadata = { - "tags": ["wireless", "configure", "experience", "channelAvailability", "insights", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwork", + "tags": ["wireless", "monitor", "devices", "packetLoss", "byNetwork"], + "operation": "getOrganizationWirelessDevicesPacketLossByNetwork", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/channelAvailability/insights/byNetwork" + resource = f"/organizations/{organizationId}/wireless/devices/packetLoss/byNetwork" query_params = [ "networkIds", "serials", - "ssidNumbers", + "ssids", "bands", - "contributor", - "subContributor", - "insights", - "t0", - "t1", - "timespan", "perPage", "startingAfter", "endingBefore", + "t0", + "t1", + "timespan", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", "serials", - "ssidNumbers", + "ssids", "bands", ] for k, v in kwargs.items(): @@ -4692,143 +4020,53 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwo invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwork: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesPacketLossByNetwork: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceClientsInsights(self, organizationId: str, **kwargs): - """ - **Returns the top wireless service-level insights for the specified time window, including each network and the impacted client count per metric.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-clients-insights - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. - - limit (integer): Number of top networks to return. Default is 5. Maximum is 10. - """ - - kwargs.update(locals()) - - if "limit" in kwargs: - options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - assert kwargs["limit"] in options, f'''"limit" cannot be "{kwargs["limit"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["wireless", "configure", "experience", "clients", "insights"], - "operation": "getOrganizationAssuranceWirelessExperienceClientsInsights", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/clients/insights" - - query_params = [ - "t0", - "t1", - "timespan", - "limit", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceClientsInsights: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWirelessExperienceClientsOverviewHistoryByInterval(self, organizationId: str, **kwargs): - """ - **Returns time series data for impacted and active clients for organization wireless experience metrics.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-clients-overview-history-by-interval - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - resolution (integer): The time resolution in seconds for returned data. The valid resolutions are: 300, 600, 900, 1800, 3600, 86400. The default is 300. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "experience", "clients", "overview", "history", "byInterval"], - "operation": "getOrganizationAssuranceWirelessExperienceClientsOverviewHistoryByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/clients/overview/history/byInterval" - - query_params = [ - "t0", - "t1", - "timespan", - "resolution", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceClientsOverviewHistoryByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWirelessExperienceCoverageByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationWirelessDevicesPowerModeHistory(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Summarizes wireless coverage successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network + **Return a record of power mode changes for wireless devices in the organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-power-mode-history - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 1 day from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 1 day after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 1 day. The default is 1 day. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - 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 """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetwork", + "tags": ["wireless", "monitor", "devices", "power", "mode", "history"], + "operation": "getOrganizationWirelessDevicesPowerModeHistory", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork" + resource = f"/organizations/{organizationId}/wireless/devices/power/mode/history" query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", "t0", "t1", "timespan", "perPage", "startingAfter", "endingBefore", + "networkIds", + "serials", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", "serials", - "ssidNumbers", - "bands", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -4840,5359 +4078,133 @@ def getOrganizationAssuranceWirelessExperienceCoverageByNetwork( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetwork: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesPowerModeHistory: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationAssuranceWirelessExperienceCoverageByNetworkByBand( + def getOrganizationWirelessDevicesProvisioningDeployments( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **Summarizes wireless coverage successes and failures by band.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network-by-band + **List the zero touch deployments for wireless access points in an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-provisioning-deployments - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 20. - 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. + - search (string): Filter by MAC address, serial number, new device name, old device name, or model. + - sortBy (string): Field used to sort results. Default is 'status'. + - sortOrder (string): Sort order. Default is 'asc'. + - deploymentType (string): Filter deployments by type. """ kwargs.update(locals()) - metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "byNetwork", "byBand"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetworkByBand", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork/byBand" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetworkByBand: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClient( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless coverage successes and failures by client.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network-by-client - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "byNetwork", "byClient"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork/byClient" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClientOs( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless coverage successes and failures by client OS.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network-by-client-os - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "byNetwork", "byClientOs"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClientOs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork/byClientOs" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClientOs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClientType( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless coverage successes and failures by client type.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network-by-client-type - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "byNetwork", "byClientType"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClientType", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork/byClientType" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetworkByClientType: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceCoverageByNetworkByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless coverage successes and failures by device.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "byNetwork", "byDevice"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetworkByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork/byDevice" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetworkByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceCoverageByNetworkByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Time-series of wireless coverage successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network-by-interval - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 60, 300, 600, 3600, 14400, 86400. The default is 300. Interval is calculated if time params are provided. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "experience", "coverage", "byNetwork", "byInterval"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetworkByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork/byInterval" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", - "interval", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceCoverageByNetworkBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless coverage successes and failures by SSID.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-by-network-by-ssid - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "byNetwork", "bySsid"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageByNetworkBySsid", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/byNetwork/bySsid" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageByNetworkBySsid: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceCoverageInsightsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Provides insights into wireless coverage experience by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-coverage-insights-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - contributor (string): Contributor for which to retrieve insights. If not specified, returns overall insights. - - subContributor (string): Sub-contributor for which to retrieve insights. If not specified, returns all sub contributor insights. - - insights (string): Insights version to use. Defaults to 2. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "contributor" in kwargs: - options = ["Admin power restriction", "Insufficient AP density", "Sticky client", "Transient weak signal"] - assert kwargs["contributor"] in options, ( - f'''"contributor" cannot be "{kwargs["contributor"]}", & must be set to one of: {options}''' - ) - if "insights" in kwargs: - options = ["1", "2"] - assert kwargs["insights"] in options, ( - f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "coverage", "insights", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceCoverageInsightsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/coverage/insights/byNetwork" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "contributor", - "subContributor", - "insights", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceCoverageInsightsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceMetricsOverviewHistoryByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns organization wireless experience metrics overview grouped by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-metrics-overview-history-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 5000. 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": ["wireless", "configure", "experience", "metrics", "overview", "history", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceMetricsOverviewHistoryByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/metrics/overview/history/byNetwork" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceMetricsOverviewHistoryByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceMostImpactedNetworks(self, organizationId: str, **kwargs): - """ - **Returns the most impacted wireless experience networks and the top failure contributor for each network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-most-impacted-networks - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - limit (integer): Number of most impacted networks to return. Default is 5. Maximum is 10. - """ - - kwargs.update(locals()) - - if "limit" in kwargs: - options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - assert kwargs["limit"] in options, f'''"limit" cannot be "{kwargs["limit"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["wireless", "configure", "experience", "mostImpactedNetworks"], - "operation": "getOrganizationAssuranceWirelessExperienceMostImpactedNetworks", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/mostImpactedNetworks" - - query_params = [ - "t0", - "t1", - "timespan", - "limit", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceMostImpactedNetworks: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWirelessExperienceMostImpactedXMs(self, organizationId: str, **kwargs): - """ - **Returns the most impacted wireless experience metrics and the top failure contributor for each metric/network pair.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-most-impacted-x-ms - - - organizationId (string): Organization ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - limit (integer): Number of most impacted XMs to return. Default is 5. Maximum is 10. - """ - - kwargs.update(locals()) - - if "limit" in kwargs: - options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - assert kwargs["limit"] in options, f'''"limit" cannot be "{kwargs["limit"]}", & must be set to one of: {options}''' - - metadata = { - "tags": ["wireless", "configure", "experience", "mostImpactedXMs"], - "operation": "getOrganizationAssuranceWirelessExperienceMostImpactedXMs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/mostImpactedXMs" - - query_params = [ - "t0", - "t1", - "timespan", - "limit", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceMostImpactedXMs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByBand( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by band.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-band - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork", "byBand"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByBand", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/byBand" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByBand: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClient( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by client.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-client - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 10000. - - 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()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork", "byClient"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/byClient" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClientOs( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by client OS.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-client-os - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork", "byClientOs"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClientOs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/byClientOs" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClientOs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClientType( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by client type.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-client-type - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork", "byClientType"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClientType", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/byClientType" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByClientType: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by device.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork", "byDevice"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/byDevice" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Time-series of wireless connection successes and failures by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-interval - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 60, 300, 600, 3600, 14400, 86400. The default is 300. Interval is calculated if time params are provided. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "monitor", "experience", "successfulConnects", "byNetwork", "byInterval"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/byInterval" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "interval", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByServer( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by server.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-server - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork", "byServer"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/byServer" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkByServer: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by ssid.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-by-network-by-ssid - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "byNetwork", "bySsid"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkBySsid", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/byNetwork/bySsid" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsByNetworkBySsid: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsInsightsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Provides insights into wireless successful connects experience by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connects-insights-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - contributor (string): Contributor for which to retrieve insights. If not specified, returns overall insights. - - subContributor (string): Sub-contributor for which to retrieve insights. If not specified, returns all sub contributor insights. - - insights (string): Insights version to use. Defaults to 2. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "contributor" in kwargs: - options = ["assoc", "auth", "dhcp", "dns"] - assert kwargs["contributor"] in options, ( - f'''"contributor" cannot be "{kwargs["contributor"]}", & must be set to one of: {options}''' - ) - if "insights" in kwargs: - options = ["1", "2"] - assert kwargs["insights"] in options, ( - f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' - ) - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "successfulConnects", "insights", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectsInsightsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnects/insights/byNetwork" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "contributor", - "subContributor", - "insights", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectsInsightsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless time to connect metrics by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByBand( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by band.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-band - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork", "byBand"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByBand", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/byBand" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByBand: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClient( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless time to connect metrics by client.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-client - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 10000. - - 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()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork", "byClient"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/byClient" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClientOs( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by client OS.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-client-os - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork", "byClientOs"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClientOs", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/byClientOs" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClientOs: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClientType( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection successes and failures by client type.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-client-type - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork", "byClientType"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClientType", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/byClientType" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByClientType: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection time to connect metrics by device.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork", "byDevice"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/byDevice" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Time-series of wireless time to connect by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-interval - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 14 days. The default is 2 hours. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 60, 300, 600, 3600, 14400, 86400. The default is 300. Interval is calculated if time params are provided. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "monitor", "experience", "timeToConnect", "byNetwork", "byInterval"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/byInterval" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "interval", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByServer( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection time to connect metrics by server.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-server - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork", "byServer"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByServer", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/byServer" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkByServer: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarizes wireless connection time to connect metrics by ssid.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-by-network-by-ssid - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "byNetwork", "bySsid"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkBySsid", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/byNetwork/bySsid" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectByNetworkBySsid: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationAssuranceWirelessExperienceTimeToConnectInsightsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Provides insights into wireless time to connect experience by network.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-time-to-connect-insights-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. - - contributor (string): Contributor for which to retrieve insights. If not specified, returns overall insights. - - subContributor (string): Sub-contributor for which to retrieve insights. If not specified, returns all sub contributor insights. - - insights (string): Insights version to use. Defaults to 2. - - variant (string): Wireless State Machine variant to use. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "contributor" in kwargs: - options = ["assoc", "auth", "dhcp", "dns"] - assert kwargs["contributor"] in options, ( - f'''"contributor" cannot be "{kwargs["contributor"]}", & must be set to one of: {options}''' - ) - if "insights" in kwargs: - options = ["1", "2"] - assert kwargs["insights"] in options, ( - f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' - ) - if "variant" in kwargs: - options = ["A", "B"] - assert kwargs["variant"] in options, ( - f'''"variant" cannot be "{kwargs["variant"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "experience", "timeToConnect", "insights", "byNetwork"], - "operation": "getOrganizationAssuranceWirelessExperienceTimeToConnectInsightsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/assurance/wireless/experience/timeToConnect/insights/byNetwork" - - query_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - "contributor", - "subContributor", - "insights", - "variant", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssidNumbers", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationAssuranceWirelessExperienceTimeToConnectInsightsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessAirMarshalRules(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Returns the current Air Marshal rules for this organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-air-marshal-rules - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): (optional) The set of network IDs to include. - - 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": ["wireless", "configure", "airMarshal", "rules"], - "operation": "getOrganizationWirelessAirMarshalRules", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/airMarshal/rules" - - query_params = [ - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessAirMarshalRules: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessAirMarshalSettingsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns the current Air Marshal settings for this network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-air-marshal-settings-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): The network IDs to include in the result set. - - 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": ["wireless", "configure", "airMarshal", "settings", "byNetwork"], - "operation": "getOrganizationWirelessAirMarshalSettingsByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/airMarshal/settings/byNetwork" - - query_params = [ - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessAirMarshalSettingsByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessAlertsLowPowerByDevice(self, organizationId: str, networkIds: list, **kwargs): - """ - **Gets all low power related alerts over a given network and returns information by device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-alerts-low-power-by-device - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "alerts", "lowPower", "byDevice"], - "operation": "getOrganizationWirelessAlertsLowPowerByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/alerts/lowPower/byDevice" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessAlertsLowPowerByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessCertificatesOpenRoamingCertificateAuthority(self, organizationId: str): - """ - **Query for details on the organization's OpenRoaming Certificate Authority certificate (CAs).** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-certificates-open-roaming-certificate-authority - - - organizationId (string): Organization ID - """ - - metadata = { - "tags": ["wireless", "configure", "certificates", "openRoaming", "certificateAuthority"], - "operation": "getOrganizationWirelessCertificatesOpenRoamingCertificateAuthority", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/certificates/openRoaming/certificateAuthority" - - return self._session.get(metadata, resource) - - def getOrganizationWirelessClientsConnectionsAssociationByClient(self, organizationId: str, **kwargs): - """ - **Summarize association outcomes per wireless client across an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-connections-association-by-client - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "clients", "connections", "association", "byClient"], - "operation": "getOrganizationWirelessClientsConnectionsAssociationByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/connections/association/byClient" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsConnectionsAssociationByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessClientsConnectionsAuthenticationByClient(self, organizationId: str, **kwargs): - """ - **Summarize authentication outcomes per wireless client across an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-connections-authentication-by-client - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "clients", "connections", "authentication", "byClient"], - "operation": "getOrganizationWirelessClientsConnectionsAuthenticationByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/connections/authentication/byClient" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsConnectionsAuthenticationByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessClientsConnectionsDhcpByClient(self, organizationId: str, **kwargs): - """ - **Get IP assignment for all clients in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-connections-dhcp-by-client - - - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 7 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 2 hours. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "clients", "connections", "dhcp", "byClient"], - "operation": "getOrganizationWirelessClientsConnectionsDhcpByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/connections/dhcp/byClient" - - query_params = [ - "networkIds", - "t0", - "t1", - "timespan", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsConnectionsDhcpByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessClientsConnectionsFailuresHistoryByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns failed wireless client connections for this organization by device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-connections-failures-history-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 - - connectionTimeSortOrder (string): (optional) Sort order of events by connection start time. (default desc) - - failureSteps (array): (optional) The step in the connection process that failed - - clientMac (string): (optional) The MAC address of the client with which the list of events will be filtered. - - serials (array): (optional) Filter devices by serial number - - timespan (integer): (optional) The timespan, in seconds, for the failed connections. The period will be from [timespan] seconds ago until now. The maximum allowed timespan is 1 month. Default: 86400 (24 hours) - - ssidNumber (integer): (optional) The SSID number to include - - networkIds (array): (optional) The set of network IDs to include. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 50. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - """ - - kwargs.update(locals()) - - if "connectionTimeSortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["connectionTimeSortOrder"] in options, ( - f'''"connectionTimeSortOrder" cannot be "{kwargs["connectionTimeSortOrder"]}", & must be set to one of: {options}''' - ) - if "ssidNumber" in kwargs: - options = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] - assert kwargs["ssidNumber"] in options, ( - f'''"ssidNumber" cannot be "{kwargs["ssidNumber"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "clients", "connections", "failures", "history", "byDevice"], - "operation": "getOrganizationWirelessClientsConnectionsFailuresHistoryByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/connections/failures/history/byDevice" - - query_params = [ - "connectionTimeSortOrder", - "failureSteps", - "clientMac", - "serials", - "timespan", - "ssidNumber", - "networkIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "failureSteps", - "serials", - "networkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsConnectionsFailuresHistoryByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessClientsConnectionsImpactedByNetworkBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Summarize the number of wireless clients impacted by connection failures on network SSIDs, across an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-connections-impacted-by-network-by-ssid - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - networkGroupIds (array): Filter results by a list of network group IDs. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 7 days. The default is 2 hours. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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": ["wireless", "monitor", "clients", "connections", "impacted", "byNetwork", "bySsid"], - "operation": "getOrganizationWirelessClientsConnectionsImpactedByNetworkBySsid", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/connections/impacted/byNetwork/bySsid" - - query_params = [ - "networkIds", - "networkGroupIds", - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "networkGroupIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsConnectionsImpactedByNetworkBySsid: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessClientsOverviewByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List access point client count at the moment in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-overview-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter access points client counts by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter access points client counts by its serial numbers. This filter uses multiple exact matches. - - campusGatewayClusterIds (array): Optional parameter to filter access points client counts by MCG cluster IDs. This filter uses multiple exact matches. - - 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": ["wireless", "monitor", "clients", "overview", "byDevice"], - "operation": "getOrganizationWirelessClientsOverviewByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/overview/byDevice" - - query_params = [ - "networkIds", - "serials", - "campusGatewayClusterIds", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "campusGatewayClusterIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsOverviewByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def byOrganizationWirelessClientsRfHealthOverviewNetwork(self, organizationId: str, **kwargs): - """ - **Show the by-network client information for the organization in the given interval** - https://developer.cisco.com/meraki/api-v1/#!by-organization-wireless-clients-rf-health-overview-network - - - organizationId (string): Organization ID - - networkIds (array): Networks for which information should be gathered. - - bands (array): Bands for which information should be gathered. Valid bands are 2.4, 5, and 6. - - channels (array): Channel for which information should be gathered. - - serials (array): Serial number of the devices for which information should be gathered. - - gFloorplanId (string): Geoaligned floorplan ID nodes for which information is gathered belong to. - - tags (array): Access Point tags for which information should be gathered. - - models (array): Access Point models for which information should be gathered. - - rfProfiles (array): Rf Profiles for which information should be gathered. - - minimumRfHealthScore (integer): Minimum RF Health score for an AP to be retrieved. - - maximumRfHealthScore (integer): Maximum RF Health score for an AP to be retrieved. - - retryOnEmpty (boolean): If true, the query will be retried with a longer timeframe if the results are empty. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "clients", "rfHealth", "overview"], - "operation": "byOrganizationWirelessClientsRfHealthOverviewNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/rfHealth/overview/byNetwork" - - query_params = [ - "networkIds", - "bands", - "channels", - "serials", - "gFloorplanId", - "tags", - "models", - "rfProfiles", - "minimumRfHealthScore", - "maximumRfHealthScore", - "retryOnEmpty", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "bands", - "channels", - "serials", - "tags", - "models", - "rfProfiles", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"byOrganizationWirelessClientsRfHealthOverviewNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessClientsStickyEvents(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get sticky client events within the specified timespan.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-sticky-events - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - clientIds (array): Filter results by client id. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "clients", "stickyEvents"], - "operation": "getOrganizationWirelessClientsStickyEvents", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/stickyEvents" - - query_params = [ - "networkIds", - "clientIds", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "clientIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsStickyEvents: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessClientsUsageByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Returns client usage details for wireless networks within an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-usage-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 1 hour and be less than or equal to 7 days. The default is 2 hours. - - networkIds (array): Filter results by a list of network IDs. - - networkGroupIds (array): Filter results by a list of network group IDs. - - gatewayNetworkIds (array): Limit the results to clients tunneled to campus gateways in the provided networks. - - usageUnits (string): Usage units to use in the response. - """ - - kwargs.update(locals()) - - if "usageUnits" in kwargs: - options = ["GB", "KB", "MB", "TB"] - assert kwargs["usageUnits"] in options, ( - f'''"usageUnits" cannot be "{kwargs["usageUnits"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "monitor", "clients", "usage", "byNetwork"], - "operation": "getOrganizationWirelessClientsUsageByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/usage/byNetwork" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "networkIds", - "networkGroupIds", - "gatewayNetworkIds", - "usageUnits", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "networkGroupIds", - "gatewayNetworkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsUsageByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessClientsUsageByNetworkBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns client usage details for wireless network SSIDs within an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-usage-by-network-by-ssid - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 1 hour and be less than or equal to 7 days. The default is 2 hours. - - networkIds (array): Filter results by a list of network IDs. - - networkGroupIds (array): Filter results by a list of network group IDs. - - ssidIds (array): Filter results by a list of SSID IDs. - - ssidNames (array): Filter results by a list of SSID names. - - gatewayNetworkIds (array): Limit the results to clients tunneled to campus gateways in the provided networks. - - usageUnits (string): Usage units to use in the response. - """ - - kwargs.update(locals()) - - if "usageUnits" in kwargs: - options = ["GB", "KB", "MB", "TB"] - assert kwargs["usageUnits"] in options, ( - f'''"usageUnits" cannot be "{kwargs["usageUnits"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "monitor", "clients", "usage", "byNetwork", "bySsid"], - "operation": "getOrganizationWirelessClientsUsageByNetworkBySsid", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/usage/byNetwork/bySsid" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "networkIds", - "networkGroupIds", - "ssidIds", - "ssidNames", - "gatewayNetworkIds", - "usageUnits", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "networkGroupIds", - "ssidIds", - "ssidNames", - "gatewayNetworkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsUsageByNetworkBySsid: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessClientsUsageBySsid(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Returns client usage details for SSIDs within an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-clients-usage-by-ssid - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 8 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 1 hour and be less than or equal to 7 days. The default is 2 hours. - - ssidNames (array): Filter results by a list of SSID names. - - networkIds (array): Limit the results to clients that belong to one of the provided networks. - - networkGroupIds (array): Limit the results to clients that belong to one of the provided network groups. - - gatewayNetworkIds (array): Limit the results to clients tunneled to campus gateways in the provided networks. - - usageUnits (string): Usage units to use in the response. - """ - - kwargs.update(locals()) - - if "usageUnits" in kwargs: - options = ["GB", "KB", "MB", "TB"] - assert kwargs["usageUnits"] in options, ( - f'''"usageUnits" cannot be "{kwargs["usageUnits"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "monitor", "clients", "usage", "bySsid"], - "operation": "getOrganizationWirelessClientsUsageBySsid", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/clients/usage/bySsid" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "ssidNames", - "networkIds", - "networkGroupIds", - "gatewayNetworkIds", - "usageUnits", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "ssidNames", - "networkIds", - "networkGroupIds", - "gatewayNetworkIds", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessClientsUsageBySsid: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesAccelerometerStatuses( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the most recent AP accelerometer status information for wireless devices that support it.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-accelerometer-statuses - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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): A list of Meraki network IDs to filter results to contain only specified networks. E.g.: networkIds[]=N_12345678&networkIds[]=L_3456 - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "accelerometer", "statuses"], - "operation": "getOrganizationWirelessDevicesAccelerometerStatuses", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/accelerometer/statuses" - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesAccelerometerStatuses: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesChannelUtilizationByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get average channel utilization for all bands in a network, split by AP** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 7 days. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "channelUtilization", "byDevice"], - "operation": "getOrganizationWirelessDevicesChannelUtilizationByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/byDevice" - - query_params = [ - "networkIds", - "serials", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesChannelUtilizationByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesChannelUtilizationByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get average channel utilization across all bands for all networks in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 7 days. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "channelUtilization", "byNetwork"], - "operation": "getOrganizationWirelessDevicesChannelUtilizationByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/byNetwork" - - query_params = [ - "networkIds", - "serials", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesChannelUtilizationByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesChannelUtilizationHistoryByDeviceByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get a time-series of average channel utilization for all bands, segmented by device.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-history-by-device-by-interval - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 7 days. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "channelUtilization", "history", "byDevice", "byInterval"], - "operation": "getOrganizationWirelessDevicesChannelUtilizationHistoryByDeviceByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/history/byDevice/byInterval" - - query_params = [ - "networkIds", - "serials", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesChannelUtilizationHistoryByDeviceByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get a time-series of average channel utilization for all bands** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-channel-utilization-history-by-network-by-interval - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 7 days. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 3600, 7200, 14400, 21600. The default is 3600. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "channelUtilization", "history", "byNetwork", "byInterval"], - "operation": "getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/channelUtilization/history/byNetwork/byInterval" - - query_params = [ - "networkIds", - "serials", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "interval", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesDataRateByClient(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get average uplink and downlink datarates for all clients in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-data-rate-by-client - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial number. - - ssids (array): Filter results by SSID number. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - macs (array): Filter results by client mac address(es). - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "dataRate", "byClient"], - "operation": "getOrganizationWirelessDevicesDataRateByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/dataRate/byClient" - - query_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "macs", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "macs", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesDataRateByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesEthernetStatuses(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the most recent Ethernet link speed, duplex, aggregation and power mode and status information for wireless devices.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-ethernet-statuses - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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): A list of Meraki network IDs to filter results to contain only specified networks. E.g.: networkIds[]=N_12345678&networkIds[]=L_3456 - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "ethernet", "statuses"], - "operation": "getOrganizationWirelessDevicesEthernetStatuses", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/ethernet/statuses" - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesEthernetStatuses: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesLatencyByClient(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get latency summaries for all wireless devices in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-latency-by-client - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 7 days. - - networkIds (array): Filter results by network. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - ssids (array): Filter results by SSID number. - - macs (array): Filter results by client mac address(es). - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "devices", "latency", "byClient"], - "operation": "getOrganizationWirelessDevicesLatencyByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/latency/byClient" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "networkIds", - "bands", - "ssids", - "macs", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "bands", - "ssids", - "macs", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesLatencyByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesLatencyByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get latency summaries for all wireless devices in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-latency-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 - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 7 days. - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - ssids (array): Filter results by SSID number. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "devices", "latency", "byDevice"], - "operation": "getOrganizationWirelessDevicesLatencyByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/latency/byDevice" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "networkIds", - "serials", - "bands", - "ssids", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "bands", - "ssids", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesLatencyByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesLatencyByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get per-network latency summaries for all wireless networks in an organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-latency-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 90 days. The default is 7 days. - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - ssids (array): Filter results by SSID number. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "devices", "latency", "byNetwork"], - "operation": "getOrganizationWirelessDevicesLatencyByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/latency/byNetwork" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "networkIds", - "serials", - "bands", - "ssids", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "bands", - "ssids", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesLatencyByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationWirelessDevicesLiveToolsClientDisconnect(self, organizationId: str, clientId: str, **kwargs): - """ - **Enqueue a job to disconnect a client from an AP** - https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-devices-live-tools-client-disconnect - - - organizationId (string): Organization ID - - clientId (string): Client ID - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "liveTools", "devices", "clients", "disconnect"], - "operation": "createOrganizationWirelessDevicesLiveToolsClientDisconnect", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - clientId = urllib.parse.quote(str(clientId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/liveTools/clients/{clientId}/disconnect" - - body_params = [ - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationWirelessDevicesLiveToolsClientDisconnect: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def getOrganizationWirelessDevicesPacketLossByClient(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get average packet loss for the given timespan for all clients in the organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-client - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - ssids (array): Filter results by SSID number. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - macs (array): Filter results by client mac address(es). - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 90 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "packetLoss", "byClient"], - "operation": "getOrganizationWirelessDevicesPacketLossByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/packetLoss/byClient" - - query_params = [ - "networkIds", - "ssids", - "bands", - "macs", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "ssids", - "bands", - "macs", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesPacketLossByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesPacketLossByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Get average packet loss for the given timespan for all devices in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - ssids (array): Filter results by SSID number. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 90 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "packetLoss", "byDevice"], - "operation": "getOrganizationWirelessDevicesPacketLossByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/packetLoss/byDevice" - - query_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssids", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesPacketLossByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesPacketLossByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get average packet loss for the given timespan for all networks in the organization.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device. - - ssids (array): Filter results by SSID number. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 90 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "packetLoss", "byNetwork"], - "operation": "getOrganizationWirelessDevicesPacketLossByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/packetLoss/byNetwork" - - query_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssids", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesPacketLossByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesPowerModeHistory(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return a record of power mode changes for wireless devices in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-power-mode-history - - - 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 - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 1 day from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 1 day after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 1 day. The default is 1 day. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - 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 - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "power", "mode", "history"], - "operation": "getOrganizationWirelessDevicesPowerModeHistory", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/power/mode/history" - - query_params = [ - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesPowerModeHistory: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesProvisioningDeployments( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the zero touch deployments for wireless access points in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-provisioning-deployments - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 20. - - 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. - - search (string): Filter by MAC address, serial number, new device name, old device name, or model. - - sortBy (string): Field used to sort results. Default is 'status'. - - sortOrder (string): Sort order. Default is 'asc'. - - deploymentType (string): Filter deployments by type. - """ - - kwargs.update(locals()) - - if "sortBy" in kwargs: - options = ["afterAction", "createdAt", "deploymentId", "name", "status"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - if "deploymentType" in kwargs: - options = ["deploy", "replace"] - assert kwargs["deploymentType"] in options, ( - f'''"deploymentType" cannot be "{kwargs["deploymentType"]}", & must be set to one of: {options}''' - ) - - metadata = { - "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], - "operation": "getOrganizationWirelessDevicesProvisioningDeployments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "search", - "sortBy", - "sortOrder", - "deploymentType", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - if self._session._validate_kwargs: - all_params = query_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesProvisioningDeployments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationWirelessDevicesProvisioningDeployment(self, organizationId: str, items: list, **kwargs): - """ - **Create a zero touch deployment for a wireless access point** - https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-devices-provisioning-deployment - - - organizationId (string): Organization ID - - items (array): List of zero touch deployments to create - - meta (object): Metadata relevant to the paginated dataset - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], - "operation": "createOrganizationWirelessDevicesProvisioningDeployment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments" - - body_params = [ - "items", - "meta", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationWirelessDevicesProvisioningDeployment: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) - - def updateOrganizationWirelessDevicesProvisioningDeployments(self, organizationId: str, items: list, **kwargs): - """ - **Update a zero touch deployment** - https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-devices-provisioning-deployments - - - organizationId (string): Organization ID - - items (array): List of zero touch deployments to create - - meta (object): Metadata relevant to the paginated dataset - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], - "operation": "updateOrganizationWirelessDevicesProvisioningDeployments", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments" - - body_params = [ - "items", - "meta", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationWirelessDevicesProvisioningDeployments: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def getOrganizationWirelessDevicesProvisioningDeploymentsByNewDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Returns deployment IDs for the given new node serial numbers** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-provisioning-deployments-by-new-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 - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 80. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - serials (array): Array of new device serial numbers to query - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "devices", "provisioning", "deployments", "byNewDevice"], - "operation": "getOrganizationWirelessDevicesProvisioningDeploymentsByNewDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments/byNewDevice" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "serials", - ] - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesProvisioningDeploymentsByNewDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def deleteOrganizationWirelessDevicesProvisioningDeployment(self, organizationId: str, deploymentId: str): - """ - **Delete a zero touch deployment** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-devices-provisioning-deployment - - - organizationId (string): Organization ID - - deploymentId (string): Deployment ID - """ - - metadata = { - "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], - "operation": "deleteOrganizationWirelessDevicesProvisioningDeployment", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - deploymentId = urllib.parse.quote(str(deploymentId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments/{deploymentId}" - - return self._session.delete(metadata, resource) - - def getOrganizationWirelessDevicesProvisioningRecommendationsTags(self, organizationId: str, **kwargs): - """ - **List the recommended device tags for zero touch deployments available for the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-provisioning-recommendations-tags - - - organizationId (string): Organization ID - - networkIds (array): The list of networks to use as hints for device tags recommendations. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "devices", "provisioning", "recommendations", "tags"], - "operation": "getOrganizationWirelessDevicesProvisioningRecommendationsTags", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/provisioning/recommendations/tags" - - query_params = [ - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesProvisioningRecommendationsTags: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesRadsecCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" - ) - - 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} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationWirelessDevicesRadsecCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" - ) - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrls: ignoring unrecognized kwargs: {invalid}" - ) - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrlsDeltas: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessDevicesSignalQualityByClient( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get average signal quality for all clients in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-signal-quality-by-client - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial number. - - ssids (array): Filter results by SSID number. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - macs (array): Filter results by client mac address(es). - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "signalQuality", "byClient"], - "operation": "getOrganizationWirelessDevicesSignalQualityByClient", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/signalQuality/byClient" - - query_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "macs", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "macs", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesSignalQualityByClient: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesSignalQualityByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get average signal quality for all devices in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-signal-quality-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial number. - - ssids (array): Filter results by SSID number. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "signalQuality", "byDevice"], - "operation": "getOrganizationWirelessDevicesSignalQualityByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/signalQuality/byDevice" - - query_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssids", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesSignalQualityByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesSignalQualityByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Get average signal quality for all networks in the organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-signal-quality-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Filter results by network. - - serials (array): Filter results by device serial number. - - ssids (array): Filter results by SSID number. - - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 7 days. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "signalQuality", "byNetwork"], - "operation": "getOrganizationWirelessDevicesSignalQualityByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/signalQuality/byNetwork" - - query_params = [ - "networkIds", - "serials", - "ssids", - "bands", - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "ssids", - "bands", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesSignalQualityByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - 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.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-system-cpu-load-history - - - 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 - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 1 day from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 1 day after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 1 day. The default is 1 day. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - 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 - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "system", "cpu", "load", "history"], - "operation": "getOrganizationWirelessDevicesSystemCpuLoadHistory", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/system/cpu/load/history" - - query_params = [ - "t0", - "t1", - "timespan", - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesSystemCpuLoadHistory: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesTelemetry(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the wireless device telemetry of an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-telemetry - - - 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 - 200. Default is 100. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 3 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 minutes after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 5 minutes and be less than or equal to 30 minutes. The default is 30 minutes. - - networkIds (array): Optional parameter to filter results by network. - - serials (array): Optional parameter to filter results by device serial. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "monitor", "devices", "telemetry"], - "operation": "getOrganizationWirelessDevicesTelemetry", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/telemetry" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "t0", - "t1", - "timespan", - "networkIds", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesTelemetry: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessDevicesWirelessControllersByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List of Catalyst access points information** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-wireless-controllers-by-device - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter access points by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter access points by its cloud ID. This filter uses multiple exact matches. - - controllerSerials (array): Optional parameter to filter access points by its wireless LAN controller cloud ID. This filter uses multiple exact matches. - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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": ["wireless", "monitor", "devices", "wirelessControllers", "byDevice"], - "operation": "getOrganizationWirelessDevicesWirelessControllersByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/devices/wirelessControllers/byDevice" - - query_params = [ - "networkIds", - "serials", - "controllerSerials", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - "controllerSerials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessDevicesWirelessControllersByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessLocationScanningByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessLocationScanningReceivers: ignoring unrecognized kwargs: {invalid}" - ) - - 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, **kwargs - ): - """ - **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} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"createOrganizationWirelessLocationScanningReceiver: ignoring unrecognized kwargs: {invalid}" - ) - - 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} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationWirelessLocationScanningReceiver: ignoring unrecognized kwargs: {invalid}" - ) - - 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 getOrganizationWirelessLocationWayfindingByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **Return Client wayfinding settings** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-wayfinding-by-network - - - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter wayfinding settings by network ID. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "location", "wayfinding", "byNetwork"], - "operation": "getOrganizationWirelessLocationWayfindingByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/location/wayfinding/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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessLocationWayfindingByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessMqttSettings(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **Return MQTT Settings for networks** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-mqtt-settings - - - 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 mqtt settings by network ID. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "mqtt", "settings"], - "operation": "getOrganizationWirelessMqttSettings", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/mqtt/settings" - - 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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationWirelessMqttSettings: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def updateOrganizationWirelessMqttSettings(self, organizationId: str, network: dict, mqtt: dict, **kwargs): - """ - **Add new broker config for wireless MQTT** - https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-mqtt-settings - - - organizationId (string): Organization ID - - network (object): Add MQTT Settings for network - - mqtt (object): MQTT Settings for network - - ble (object): MQTT BLE Settings for network - - wifi (object): MQTT Wi-Fi Settings for network - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "mqtt", "settings"], - "operation": "updateOrganizationWirelessMqttSettings", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/mqtt/settings" - - body_params = [ - "network", - "mqtt", - "ble", - "wifi", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationWirelessMqttSettings: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def byOrganizationWirelessOpportunisticPcapLicenseNetwork(self, organizationId: str, **kwargs): - """ - **Check the Opportunistic Pcap license status of an organization by network** - https://developer.cisco.com/meraki/api-v1/#!by-organization-wireless-opportunistic-pcap-license-network - - - organizationId (string): Organization ID - - networkIds (array): Optional parameter to filter results by network. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "opportunisticPcap", "license"], - "operation": "byOrganizationWirelessOpportunisticPcapLicenseNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/opportunisticPcap/license/byNetwork" - - query_params = [ - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"byOrganizationWirelessOpportunisticPcapLicenseNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessRadioAfcPositionByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): - """ - **List the AFC power limits of an organization by device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-afc-position-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 - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter device's AFC position by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter device's AFC position by device serial numbers. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "radio", "afc", "position", "byDevice"], - "operation": "getOrganizationWirelessRadioAfcPositionByDevice", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/afc/position/byDevice" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessRadioAfcPositionByDevice: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def getOrganizationWirelessRadioAfcPowerLimitsByDevice( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List the AFC power limits of an organization by device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-afc-power-limits-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 - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter device's AFC power limits by network ID. This filter uses multiple exact matches. - - serials (array): Optional parameter to filter device's AFC power limits by device serial numbers. This filter uses multiple exact matches. - """ - - kwargs.update(locals()) + if "sortBy" in kwargs: + options = ["afterAction", "createdAt", "deploymentId", "name", "status"] + assert kwargs["sortBy"] in options, ( + f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' + ) + if "sortOrder" in kwargs: + options = ["asc", "desc"] + assert kwargs["sortOrder"] in options, ( + f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' + ) + if "deploymentType" in kwargs: + options = ["deploy", "replace"] + assert kwargs["deploymentType"] in options, ( + f'''"deploymentType" cannot be "{kwargs["deploymentType"]}", & must be set to one of: {options}''' + ) metadata = { - "tags": ["wireless", "configure", "radio", "afc", "powerLimits", "byDevice"], - "operation": "getOrganizationWirelessRadioAfcPowerLimitsByDevice", + "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], + "operation": "getOrganizationWirelessDevicesProvisioningDeployments", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/afc/powerLimits/byDevice" + resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments" query_params = [ "perPage", "startingAfter", "endingBefore", - "networkIds", - "serials", + "search", + "sortBy", + "sortOrder", + "deploymentType", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - array_params = [ - "networkIds", - "serials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = query_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRadioAfcPowerLimitsByDevice: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesProvisioningDeployments: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessRadioAutoRfByNetwork(self, organizationId: str, **kwargs): - """ - **List the AutoRF settings of an organization by network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-auto-rf-by-network - - - organizationId (string): Organization ID - - networkIds (array): Optional parameter to filter results by network. - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "radio", "autoRf", "byNetwork"], - "operation": "getOrganizationWirelessRadioAutoRfByNetwork", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/autoRf/byNetwork" - - query_params = [ - "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()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessRadioAutoRfByNetwork: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get(metadata, resource, params) - - def getOrganizationWirelessRadioAutoRfChannelsPlanningActivities(self, organizationId: str, **kwargs): + def createOrganizationWirelessDevicesProvisioningDeployment(self, organizationId: str, items: list, **kwargs): """ - **List the channel planning activities of an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-auto-rf-channels-planning-activities + **Create a zero touch deployment for a wireless access point** + https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-devices-provisioning-deployment - organizationId (string): Organization ID - - networkIds (array): Optional parameter to filter results by network. - - deviceSerials (array): Optional parameter to filter results by device serial. - - bands (array): Optional parameter to filter results by bands. Valid bands are 2.4, 5, and 6. - - channels (array): Optional parameter to filter results by channels. - - serials (array): Serial number of the devices for which information should be gathered. - - gFloorplanId (string): Geoaligned floorplan ID nodes for which information is gathered belong to. - - tags (array): Optional parameter to filter results by node tags. - - models (array): Optional parameter to filter results by access point models. - - rfProfiles (array): Optional parameter to filter results by RF Profiles. - - minimumRfHealthScore (integer): Minimum RF Health score for an AP to be retrieved. - - maximumRfHealthScore (integer): Maximum RF Health score for an AP to be retrieved. + - items (array): List of zero touch deployments to create + - meta (object): Metadata relevant to the paginated dataset """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "radio", "autoRf", "channels", "planning", "activities"], - "operation": "getOrganizationWirelessRadioAutoRfChannelsPlanningActivities", + "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], + "operation": "createOrganizationWirelessDevicesProvisioningDeployment", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/autoRf/channels/planning/activities" - - query_params = [ - "networkIds", - "deviceSerials", - "bands", - "channels", - "serials", - "gFloorplanId", - "tags", - "models", - "rfProfiles", - "minimumRfHealthScore", - "maximumRfHealthScore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments" - array_params = [ - "networkIds", - "deviceSerials", - "bands", - "channels", - "serials", - "tags", - "models", - "rfProfiles", + body_params = [ + "items", + "meta", ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRadioAutoRfChannelsPlanningActivities: ignoring unrecognized kwargs: {invalid}" + f"createOrganizationWirelessDevicesProvisioningDeployment: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.post(metadata, resource, payload) - def recalculateOrganizationWirelessRadioAutoRfChannels(self, organizationId: str, networkIds: list, **kwargs): + def updateOrganizationWirelessDevicesProvisioningDeployments(self, organizationId: str, items: list, **kwargs): """ - **Recalculates automatically assigned channels for every AP within specified the specified network(s)** - https://developer.cisco.com/meraki/api-v1/#!recalculate-organization-wireless-radio-auto-rf-channels + **Update a zero touch deployment** + https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-devices-provisioning-deployments - organizationId (string): Organization ID - - networkIds (array): A list of network ids (limit: 15). + - items (array): List of zero touch deployments to create + - meta (object): Metadata relevant to the paginated dataset """ - kwargs = locals() + kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "radio", "autoRf", "channels"], - "operation": "recalculateOrganizationWirelessRadioAutoRfChannels", + "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], + "operation": "updateOrganizationWirelessDevicesProvisioningDeployments", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/autoRf/channels/recalculate" + resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments" body_params = [ - "networkIds", + "items", + "meta", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -10201,47 +4213,55 @@ def recalculateOrganizationWirelessRadioAutoRfChannels(self, organizationId: str invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"recalculateOrganizationWirelessRadioAutoRfChannels: ignoring unrecognized kwargs: {invalid}" + f"updateOrganizationWirelessDevicesProvisioningDeployments: ignoring unrecognized kwargs: {invalid}" ) - return self._session.post(metadata, resource, payload) + return self._session.put(metadata, resource, payload) - def getOrganizationWirelessRadioOverridesByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): + def deleteOrganizationWirelessDevicesProvisioningDeployment(self, organizationId: str, deploymentId: str): """ - **Return a list of radio overrides** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-overrides-by-device + **Delete a zero touch deployment** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-devices-provisioning-deployment - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 100. - - 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): A list of network IDs. The returned radio overrides will be filtered to only include these networks. - - serials (array): A list of serial numbers. The returned radio overrides will be filtered to only include these serials. + - deploymentId (string): Deployment ID + """ + + metadata = { + "tags": ["wireless", "configure", "devices", "provisioning", "deployments"], + "operation": "deleteOrganizationWirelessDevicesProvisioningDeployment", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + deploymentId = urllib.parse.quote(str(deploymentId), safe="") + resource = f"/organizations/{organizationId}/wireless/devices/provisioning/deployments/{deploymentId}" + + return self._session.delete(metadata, resource) + + 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", "radio", "overrides", "byDevice"], - "operation": "getOrganizationWirelessRadioOverridesByDevice", + "tags": ["wireless", "configure", "devices", "radsec", "certificates", "authorities"], + "operation": "getOrganizationWirelessDevicesRadsecCertificatesAuthorities", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/overrides/byDevice" + resource = f"/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities" query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "serials", + "certificateAuthorityIds", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "networkIds", - "serials", + "certificateAuthorityIds", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10253,132 +4273,88 @@ def getOrganizationWirelessRadioOverridesByDevice(self, organizationId: str, tot invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRadioOverridesByDevice: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesRadsecCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get_pages(metadata, resource, params, total_pages, direction) + return self._session.get(metadata, resource, params) - def byOrganizationWirelessRadioRfHealthNeighborsRssiDevice(self, organizationId: str, **kwargs): + def updateOrganizationWirelessDevicesRadsecCertificatesAuthorities(self, organizationId: str, **kwargs): """ - **Show the by-device neighbor rssi information for the organization in the given interval** - https://developer.cisco.com/meraki/api-v1/#!by-organization-wireless-radio-rf-health-neighbors-rssi-device + **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 - - networkIds (array): Networks for which information should be gathered. - - bands (array): Bands for which information should be gathered. Valid bands are 2.4, 5, and 6. - - channels (array): Channel for which information should be gathered. - - serials (array): Serial number of the devices for which information should be gathered. - - tags (array): Access Point tags for which information should be gathered. - - models (array): Access Point models for which information should be gathered. - - rfProfiles (array): Rf Profiles for which information should be gathered. - - gFloorplanId (string): Geoaligned floorplan ID nodes for which information is gathered belong to. - - minimumNeighborRssi (integer): Minimum Neighbor RSSI score for a neighbor entry to be retrieved. - - maximumNeighborRssi (integer): Maximum Neighbor RSSI score for a neighbor entry to be retrieved. - - minimumRfHealthScore (integer): Minimum RF Health score for an AP to be retrieved. - - maximumRfHealthScore (integer): Maximum RF Health score for an AP to be retrieved. - - rfScoreInterval (integer): Size of the rf score interval in seconds. - - rfScoreRetryOnEmpty (boolean): If true, the query will be retried further back if no data is present in the latest rf score interval. + - 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", "radio", "rfHealth", "neighbors", "rssi"], - "operation": "byOrganizationWirelessRadioRfHealthNeighborsRssiDevice", + "tags": ["wireless", "configure", "devices", "radsec", "certificates", "authorities"], + "operation": "updateOrganizationWirelessDevicesRadsecCertificatesAuthorities", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/rfHealth/neighbors/rssi/byDevice" - - query_params = [ - "networkIds", - "bands", - "channels", - "serials", - "tags", - "models", - "rfProfiles", - "gFloorplanId", - "minimumNeighborRssi", - "maximumNeighborRssi", - "minimumRfHealthScore", - "maximumRfHealthScore", - "rfScoreInterval", - "rfScoreRetryOnEmpty", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + resource = f"/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities" - array_params = [ - "networkIds", - "bands", - "channels", - "serials", - "tags", - "models", - "rfProfiles", + body_params = [ + "status", + "certificateAuthorityId", ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"byOrganizationWirelessRadioRfHealthNeighborsRssiDevice: ignoring unrecognized kwargs: {invalid}" + f"updateOrganizationWirelessDevicesRadsecCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, 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 getOrganizationWirelessRadioRfHealthOverviewByNetworkByInterval(self, organizationId: str, **kwargs): + def getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrls(self, organizationId: str, **kwargs): """ - **Show the by-network RF Health score overview information for the organization in the given interval** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-rf-health-overview-by-network-by-interval + **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 - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 182 days, 14 hours, 54 minutes, and 36 seconds from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 30 days, 10 hours, 29 minutes, and 6 seconds after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days, 10 hours, 29 minutes, and 6 seconds. The default is 14 days. If interval is provided, the timespan will be autocalculated. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 7200, 86400. The default is 7200. Interval is calculated if time params are provided. - - networkIds (array): Networks for which information should be gathered. - - bands (array): Bands for which information should be gathered. Valid bands are 2.4, 5, and 6. - - minimumRfHealthScore (integer): Minimum RF Health score for a network to be retrieved. - - maximumRfHealthScore (integer): Maximum RF Health score for a network to be retrieved. - - minimumHighCciPercentage (integer): Minimum percentage of radios with high CCI for a network to be retrieved. - - maximumHighCciPercentage (integer): Maximum percentage of radios with high CCI for a network to be retrieved. - - minimumChannelChanges (integer): Minimum number of channel changes for a network to be retrieved. - - maximumChannelChanges (integer): Maximum number of channel changes for a network to be retrieved. + - 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", "radio", "rfHealth", "overview", "byNetwork", "byInterval"], - "operation": "getOrganizationWirelessRadioRfHealthOverviewByNetworkByInterval", + "tags": ["wireless", "configure", "devices", "radsec", "certificates", "authorities", "crls"], + "operation": "getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrls", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/rfHealth/overview/byNetwork/byInterval" + resource = f"/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities/crls" query_params = [ - "t0", - "t1", - "timespan", - "interval", - "networkIds", - "bands", - "minimumRfHealthScore", - "maximumRfHealthScore", - "minimumHighCciPercentage", - "maximumHighCciPercentage", - "minimumChannelChanges", - "maximumChannelChanges", + "certificateAuthorityIds", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "networkIds", - "bands", + "certificateAuthorityIds", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10390,52 +4366,36 @@ def getOrganizationWirelessRadioRfHealthOverviewByNetworkByInterval(self, organi invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRadioRfHealthOverviewByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrls: ignoring unrecognized kwargs: {invalid}" ) return self._session.get(metadata, resource, params) - def getOrganizationWirelessRadioRrmByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): + def getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrlsDeltas(self, organizationId: str, **kwargs): """ - **List the AutoRF settings of an organization by network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-rrm-by-network + **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 - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): Optional parameter to filter results by network. - - startingAfter (string): Retrieving items after this network ID - - endingBefore (string): Retrieving items before this network ID - - perPage (integer): Number of items per page - - sortOrder (string): The sort order of items + - 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()) - if "sortOrder" in kwargs: - options = ["ascending", "descending"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - metadata = { - "tags": ["wireless", "configure", "radio", "rrm", "byNetwork"], - "operation": "getOrganizationWirelessRadioRrmByNetwork", + "tags": ["wireless", "configure", "devices", "radsec", "certificates", "authorities", "crls", "deltas"], + "operation": "getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrlsDeltas", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/rrm/byNetwork" + resource = f"/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities/crls/deltas" query_params = [ - "networkIds", - "startingAfter", - "endingBefore", - "perPage", - "sortOrder", + "certificateAuthorityIds", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "networkIds", + "certificateAuthorityIds", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10447,31 +4407,47 @@ def getOrganizationWirelessRadioRrmByNetwork(self, organizationId: str, total_pa invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRadioRrmByNetwork: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrlsDeltas: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get_pages(metadata, resource, params, total_pages, direction) + return self._session.get(metadata, resource, params) - def getOrganizationWirelessRadioStatusByNetwork(self, organizationId: str, **kwargs): + def getOrganizationWirelessDevicesSystemCpuLoadHistory( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): """ - **Show the status of this organization's radios, categorized by network and device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-status-by-network + **Return the CPU Load history for a list of wireless devices in the organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-system-cpu-load-history - organizationId (string): Organization ID - - networkIds (array): Networks for which radio status should be returned. - - serials (array): Serials for which radio status should be returned. + - 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 + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 1 day from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 1 day after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 1 day. The default is 1 day. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - 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 """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "radio", "status", "byNetwork"], - "operation": "getOrganizationWirelessRadioStatusByNetwork", + "tags": ["wireless", "monitor", "devices", "system", "cpu", "load", "history"], + "operation": "getOrganizationWirelessDevicesSystemCpuLoadHistory", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/radio/status/byNetwork" + resource = f"/organizations/{organizationId}/wireless/devices/system/cpu/load/history" query_params = [ + "t0", + "t1", + "timespan", + "perPage", + "startingAfter", + "endingBefore", "networkIds", "serials", ] @@ -10491,66 +4467,52 @@ def getOrganizationWirelessRadioStatusByNetwork(self, organizationId: str, **kwa invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRadioStatusByNetwork: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesSystemCpuLoadHistory: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessRfProfilesAssignmentsByDevice( + def getOrganizationWirelessDevicesWirelessControllersByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **List the RF profiles of an organization by device** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-rf-profiles-assignments-by-device + **List of Catalyst access points information** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-wireless-controllers-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 - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + - networkIds (array): Optional parameter to filter access points by network ID. This filter uses multiple exact matches. + - serials (array): Optional parameter to filter access points by its cloud ID. This filter uses multiple exact matches. + - controllerSerials (array): Optional parameter to filter access points by its wireless LAN controller cloud ID. This filter uses multiple exact matches. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - 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, 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. - - model (string): Optional parameter to filter RF profiles by device model. All returned devices will have a model that contains the search term or is an exact match. - - macs (array): Optional parameter to filter RF profiles by one or more device MAC addresses. All returned devices will have a MAC address that is an exact match. - - serials (array): Optional parameter to filter RF profiles by one or more device serial numbers. All returned devices will have a serial number that is an exact match. - - models (array): Optional parameter to filter RF profiles by one or more device models. All returned devices will have a model that is an exact match. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "rfProfiles", "assignments", "byDevice"], - "operation": "getOrganizationWirelessRfProfilesAssignmentsByDevice", + "tags": ["wireless", "monitor", "devices", "wirelessControllers", "byDevice"], + "operation": "getOrganizationWirelessDevicesWirelessControllersByDevice", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/rfProfiles/assignments/byDevice" - - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "productTypes", - "name", - "mac", - "serial", - "model", - "macs", + resource = f"/organizations/{organizationId}/wireless/devices/wirelessControllers/byDevice" + + query_params = [ + "networkIds", "serials", - "models", + "controllerSerials", + "perPage", + "startingAfter", + "endingBefore", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", - "productTypes", - "macs", "serials", - "models", + "controllerSerials", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10562,39 +4524,39 @@ def getOrganizationWirelessRfProfilesAssignmentsByDevice( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRfProfilesAssignmentsByDevice: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessDevicesWirelessControllersByDevice: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessRoamingByNetworkByInterval(self, organizationId: str, networkIds: list, **kwargs): + def getOrganizationWirelessLocationScanningByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Get all wireless clients' roam events within the specified timespan grouped by network and time interval.** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-roaming-by-network-by-interval + **Return scanning API settings** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-scanning-by-network - organizationId (string): Organization ID - - networkIds (array): Filter results by network. - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 7 days. - - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 600, 1800, 3600, 7200, 10800, 14400, 18000, 21600, 25200, 28800, 32400, 36000, 39600, 43200, 86400, 604800. The default is 7200. + - 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", "monitor", "roaming", "byNetwork", "byInterval"], - "operation": "getOrganizationWirelessRoamingByNetworkByInterval", + "tags": ["wireless", "configure", "location", "scanning", "byNetwork"], + "operation": "getOrganizationWirelessLocationScanningByNetwork", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/roaming/byNetwork/byInterval" + resource = f"/organizations/{organizationId}/wireless/location/scanning/byNetwork" query_params = [ + "perPage", + "startingAfter", + "endingBefore", "networkIds", - "t0", - "t1", - "timespan", - "interval", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} @@ -10611,49 +4573,44 @@ def getOrganizationWirelessRoamingByNetworkByInterval(self, organizationId: str, invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessRoamingByNetworkByInterval: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessLocationScanningByNetwork: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessSsidsFirewallIsolationAllowlistEntries( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationWirelessLocationScanningReceivers(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **List the L2 isolation allow list MAC entry in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-firewall-isolation-allowlist-entries + **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 - 1000. Default is 1000. + - 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): networkIds array to filter out results - - ssids (array): ssids number array to filter out results + - networkIds (array): Optional parameter to filter scanning API receivers by network ID. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "ssids", "firewall", "isolation", "allowlist", "entries"], - "operation": "getOrganizationWirelessSsidsFirewallIsolationAllowlistEntries", + "tags": ["wireless", "configure", "location", "scanning", "receivers"], + "operation": "getOrganizationWirelessLocationScanningReceivers", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries" + resource = f"/organizations/{organizationId}/wireless/location/scanning/receivers" query_params = [ "perPage", "startingAfter", "endingBefore", "networkIds", - "ssids", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", - "ssids", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10665,39 +4622,41 @@ def getOrganizationWirelessSsidsFirewallIsolationAllowlistEntries( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessSsidsFirewallIsolationAllowlistEntries: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessLocationScanningReceivers: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def createOrganizationWirelessSsidsFirewallIsolationAllowlistEntry( - self, organizationId: str, client: dict, ssid: dict, network: dict, **kwargs + def createOrganizationWirelessLocationScanningReceiver( + self, organizationId: str, network: dict, url: str, version: str, radio: dict, sharedSecret: str, **kwargs ): """ - **Create isolation allow list MAC entry for this organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-ssids-firewall-isolation-allowlist-entry + **Add new receiver for scanning API** + https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-location-scanning-receiver - organizationId (string): Organization ID - - client (object): The client of allowlist - - ssid (object): The SSID that allowlist belongs to - - network (object): The Network that allowlist belongs to - - description (string): The description of mac address + - 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.update(locals()) + kwargs = locals() metadata = { - "tags": ["wireless", "configure", "ssids", "firewall", "isolation", "allowlist", "entries"], - "operation": "createOrganizationWirelessSsidsFirewallIsolationAllowlistEntry", + "tags": ["wireless", "configure", "location", "scanning", "receivers"], + "operation": "createOrganizationWirelessLocationScanningReceiver", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries" + resource = f"/organizations/{organizationId}/wireless/location/scanning/receivers" body_params = [ - "description", - "client", - "ssid", "network", + "url", + "version", + "radio", + "sharedSecret", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -10706,54 +4665,37 @@ def createOrganizationWirelessSsidsFirewallIsolationAllowlistEntry( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"createOrganizationWirelessSsidsFirewallIsolationAllowlistEntry: ignoring unrecognized kwargs: {invalid}" + f"createOrganizationWirelessLocationScanningReceiver: ignoring unrecognized kwargs: {invalid}" ) return self._session.post(metadata, resource, payload) - def deleteOrganizationWirelessSsidsFirewallIsolationAllowlistEntry(self, organizationId: str, entryId: str): - """ - **Destroy isolation allow list MAC entry for this organization** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-ssids-firewall-isolation-allowlist-entry - - - organizationId (string): Organization ID - - entryId (string): Entry ID - """ - - metadata = { - "tags": ["wireless", "configure", "ssids", "firewall", "isolation", "allowlist", "entries"], - "operation": "deleteOrganizationWirelessSsidsFirewallIsolationAllowlistEntry", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - entryId = urllib.parse.quote(str(entryId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries/{entryId}" - - return self._session.delete(metadata, resource) - - def updateOrganizationWirelessSsidsFirewallIsolationAllowlistEntry(self, organizationId: str, entryId: str, **kwargs): + def updateOrganizationWirelessLocationScanningReceiver(self, organizationId: str, receiverId: str, **kwargs): """ - **Update isolation allow list MAC entry info** - https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-ssids-firewall-isolation-allowlist-entry + **Change scanning API receiver settings** + https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-location-scanning-receiver - organizationId (string): Organization ID - - entryId (string): Entry ID - - description (string): The description of mac address - - client (object): The client of allowlist + - 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", "ssids", "firewall", "isolation", "allowlist", "entries"], - "operation": "updateOrganizationWirelessSsidsFirewallIsolationAllowlistEntry", + "tags": ["wireless", "configure", "location", "scanning", "receivers"], + "operation": "updateOrganizationWirelessLocationScanningReceiver", } organizationId = urllib.parse.quote(str(organizationId), safe="") - entryId = urllib.parse.quote(str(entryId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries/{entryId}" + receiverId = urllib.parse.quote(str(receiverId), safe="") + resource = f"/organizations/{organizationId}/wireless/location/scanning/receivers/{receiverId}" body_params = [ - "description", - "client", + "url", + "version", + "radio", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -10762,41 +4704,58 @@ def updateOrganizationWirelessSsidsFirewallIsolationAllowlistEntry(self, organiz invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"updateOrganizationWirelessSsidsFirewallIsolationAllowlistEntry: ignoring unrecognized kwargs: {invalid}" + f"updateOrganizationWirelessLocationScanningReceiver: ignoring unrecognized kwargs: {invalid}" ) return self._session.put(metadata, resource, payload) - def getOrganizationWirelessSsidsOpenRoamingByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): + def deleteOrganizationWirelessLocationScanningReceiver(self, organizationId: str, receiverId: str): """ - **Returns an array of objects, each containing SSID OpenRoaming configs for the corresponding network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-open-roaming-by-network + **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 getOrganizationWirelessMqttSettings(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **Return MQTT Settings for networks** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-mqtt-settings - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + - 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 OpenRoaming configuration by Network Id. - - includeDisabledSsids (boolean): Optional parameter to include OpenRoaming configuration for disabled ssids. + - networkIds (array): Optional parameter to filter mqtt settings by network ID. """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "ssids", "openRoaming", "byNetwork"], - "operation": "getOrganizationWirelessSsidsOpenRoamingByNetwork", + "tags": ["wireless", "configure", "mqtt", "settings"], + "operation": "getOrganizationWirelessMqttSettings", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/openRoaming/byNetwork" + resource = f"/organizations/{organizationId}/wireless/mqtt/settings" query_params = [ "perPage", "startingAfter", "endingBefore", "networkIds", - "includeDisabledSsids", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} @@ -10812,108 +4771,123 @@ def getOrganizationWirelessSsidsOpenRoamingByNetwork(self, organizationId: str, all_params = query_params + array_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessSsidsOpenRoamingByNetwork: ignoring unrecognized kwargs: {invalid}" - ) + self._session._logger.warning(f"getOrganizationWirelessMqttSettings: ignoring unrecognized kwargs: {invalid}") return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessSsidsPoliciesClientExclusionBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def updateOrganizationWirelessMqttSettings(self, organizationId: str, network: dict, mqtt: dict, **kwargs): """ - **Returns an array of objects, each containing client exclusion enablement statuses for one SSID** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-policies-client-exclusion-by-ssid + **Add new broker config for wireless MQTT** + https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-mqtt-settings - 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 - 100000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter by Network ID. - - includeDisabledSsids (boolean): Optional parameter to include disabled SSID's. - - ssidNumbers (array): Optional parameter to filter by SSID numbers. + - network (object): Add MQTT Settings for network + - mqtt (object): MQTT Settings for network + - ble (object): MQTT BLE Settings for network + - wifi (object): MQTT Wi-Fi Settings for network """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "ssids", "policies", "clientExclusion", "bySsid"], - "operation": "getOrganizationWirelessSsidsPoliciesClientExclusionBySsid", + "tags": ["wireless", "configure", "mqtt", "settings"], + "operation": "updateOrganizationWirelessMqttSettings", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/policies/clientExclusion/bySsid" + resource = f"/organizations/{organizationId}/wireless/mqtt/settings" - query_params = [ - "perPage", - "startingAfter", - "endingBefore", - "networkIds", - "includeDisabledSsids", - "ssidNumbers", + body_params = [ + "network", + "mqtt", + "ble", + "wifi", ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - array_params = [ + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"updateOrganizationWirelessMqttSettings: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def recalculateOrganizationWirelessRadioAutoRfChannels(self, organizationId: str, networkIds: list, **kwargs): + """ + **Recalculates automatically assigned channels for every AP within specified the specified network(s)** + https://developer.cisco.com/meraki/api-v1/#!recalculate-organization-wireless-radio-auto-rf-channels + + - organizationId (string): Organization ID + - networkIds (array): A list of network ids (limit: 15). + """ + + kwargs = locals() + + metadata = { + "tags": ["wireless", "configure", "radio", "autoRf", "channels"], + "operation": "recalculateOrganizationWirelessRadioAutoRfChannels", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/radio/autoRf/channels/recalculate" + + body_params = [ "networkIds", - "ssidNumbers", ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessSsidsPoliciesClientExclusionBySsid: ignoring unrecognized kwargs: {invalid}" + f"recalculateOrganizationWirelessRadioAutoRfChannels: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get_pages(metadata, resource, params, total_pages, direction) + return self._session.post(metadata, resource, payload) - def getOrganizationWirelessSsidsPoliciesClientExclusionStaticExclusionsBySsid( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def getOrganizationWirelessRadioRrmByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Returns an array of objects, each containing a list of MAC's excluded from a given SSID** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-policies-client-exclusion-static-exclusions-by-ssid + **List the AutoRF settings of an organization by network** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-radio-rrm-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 - 100000. Default is 1000. - - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - - networkIds (array): Optional parameter to filter Network ID. - - includeDisabledSsids (boolean): Optional parameter to include disabled SSID's. - - ssidNumbers (array): Optional parameter to filter by SSID numbers. + - networkIds (array): Optional parameter to filter results by network. + - startingAfter (string): Retrieving items after this network ID + - endingBefore (string): Retrieving items before this network ID + - perPage (integer): Number of items per page + - sortOrder (string): The sort order of items """ kwargs.update(locals()) + if "sortOrder" in kwargs: + options = ["ascending", "descending"] + assert kwargs["sortOrder"] in options, ( + f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' + ) + metadata = { - "tags": ["wireless", "configure", "ssids", "policies", "clientExclusion", "static", "exclusions", "bySsid"], - "operation": "getOrganizationWirelessSsidsPoliciesClientExclusionStaticExclusionsBySsid", + "tags": ["wireless", "configure", "radio", "rrm", "byNetwork"], + "operation": "getOrganizationWirelessRadioRrmByNetwork", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/policies/clientExclusion/static/exclusions/bySsid" + resource = f"/organizations/{organizationId}/wireless/radio/rrm/byNetwork" query_params = [ - "perPage", + "networkIds", "startingAfter", "endingBefore", - "networkIds", - "includeDisabledSsids", - "ssidNumbers", + "perPage", + "sortOrder", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", - "ssidNumbers", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10925,61 +4899,66 @@ def getOrganizationWirelessSsidsPoliciesClientExclusionStaticExclusionsBySsid( invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessSsidsPoliciesClientExclusionStaticExclusionsBySsid: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessRadioRrmByNetwork: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessSsidsProfiles(self, organizationId: str, total_pages=1, direction="next", **kwargs): + def getOrganizationWirelessRfProfilesAssignmentsByDevice( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): """ - **Returns the SSID profiles for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-profiles + **List the RF profiles of an organization by device** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-rf-profiles-assignments-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 - - name (string): (Optional) Filter results by name. Case insensitive substring match. - - sortBy (string): Column to sort results by. Default is `name`. - - sortOrder (string): Direction to sort results by. Default is `asc`. - - profileIds (array): (Optional) Filter results by a list of SSID profile IDs. - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Optional parameter to filter devices by network. + - 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. + - model (string): Optional parameter to filter RF profiles by device model. All returned devices will have a model that contains the search term or is an exact match. + - macs (array): Optional parameter to filter RF profiles by one or more device MAC addresses. All returned devices will have a MAC address that is an exact match. + - serials (array): Optional parameter to filter RF profiles by one or more device serial numbers. All returned devices will have a serial number that is an exact match. + - models (array): Optional parameter to filter RF profiles by one or more device models. All returned devices will have a model that is an exact match. """ kwargs.update(locals()) - if "sortBy" in kwargs: - options = ["name"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - metadata = { - "tags": ["wireless", "configure", "ssids", "profiles"], - "operation": "getOrganizationWirelessSsidsProfiles", + "tags": ["wireless", "configure", "rfProfiles", "assignments", "byDevice"], + "operation": "getOrganizationWirelessRfProfilesAssignmentsByDevice", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles" + resource = f"/organizations/{organizationId}/wireless/rfProfiles/assignments/byDevice" query_params = [ - "name", - "sortBy", - "sortOrder", - "profileIds", "perPage", "startingAfter", "endingBefore", + "networkIds", + "productTypes", + "name", + "mac", + "serial", + "model", + "macs", + "serials", + "models", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "profileIds", + "networkIds", + "productTypes", + "macs", + "serials", + "models", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -10989,87 +4968,51 @@ def getOrganizationWirelessSsidsProfiles(self, organizationId: str, total_pages= if self._session._validate_kwargs: all_params = query_params + array_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"getOrganizationWirelessSsidsProfiles: ignoring unrecognized kwargs: {invalid}") - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def createOrganizationWirelessSsidsProfile(self, organizationId: str, name: str, ssid: dict, **kwargs): - """ - **Create a new SSID profile in an organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-ssids-profile - - - organizationId (string): Organization ID - - name (string): Name of the SSID profile - - ssid (object): SSID configuration for the profile - - precedence (object): Precedence configuration for the SSID profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "ssids", "profiles"], - "operation": "createOrganizationWirelessSsidsProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles" - - body_params = [ - "name", - "precedence", - "ssid", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"createOrganizationWirelessSsidsProfile: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessRfProfilesAssignmentsByDevice: ignoring unrecognized kwargs: {invalid}" ) - return self._session.post(metadata, resource, payload) + return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessSsidsProfilesAssignments(self, organizationId: str, total_pages=1, direction="next", **kwargs): + def getOrganizationWirelessSsidsFirewallIsolationAllowlistEntries( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): """ - **List the SSID profile assignments in an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-profiles-assignments + **List the L2 isolation allow list MAC entry in an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-firewall-isolation-allowlist-entries - organizationId (string): Organization ID - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): The network IDs to include in the result set. - - ssidIds (array): The SSID IDs to include in the result set. - - profileIds (array): The SSID profile IDs to include in the result set. - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): networkIds array to filter out results + - ssids (array): ssids number array to filter out results """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "ssids", "profiles", "assignments"], - "operation": "getOrganizationWirelessSsidsProfilesAssignments", + "tags": ["wireless", "configure", "ssids", "firewall", "isolation", "allowlist", "entries"], + "operation": "getOrganizationWirelessSsidsFirewallIsolationAllowlistEntries", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/assignments" + resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries" query_params = [ - "networkIds", - "ssidIds", - "profileIds", "perPage", "startingAfter", "endingBefore", + "networkIds", + "ssids", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ "networkIds", - "ssidIds", - "profileIds", + "ssids", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -11081,33 +5024,37 @@ def getOrganizationWirelessSsidsProfilesAssignments(self, organizationId: str, t invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessSsidsProfilesAssignments: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessSsidsFirewallIsolationAllowlistEntries: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def createOrganizationWirelessSsidsProfilesAssignment(self, organizationId: str, profile: dict, ssid: dict, **kwargs): + def createOrganizationWirelessSsidsFirewallIsolationAllowlistEntry( + self, organizationId: str, client: dict, ssid: dict, network: dict, **kwargs + ): """ - **Assigns an SSID profile to an SSID in the organization** - https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-ssids-profiles-assignment + **Create isolation allow list MAC entry for this organization** + https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-ssids-firewall-isolation-allowlist-entry - organizationId (string): Organization ID - - profile (object): SSID profile to assign - - ssid (object): SSID to assign the SSID profile to - - network (object): Network containing the SSID (required if SSID number is used) + - client (object): The client of allowlist + - ssid (object): The SSID that allowlist belongs to + - network (object): The Network that allowlist belongs to + - description (string): The description of mac address """ kwargs.update(locals()) metadata = { - "tags": ["wireless", "configure", "ssids", "profiles", "assignments"], - "operation": "createOrganizationWirelessSsidsProfilesAssignment", + "tags": ["wireless", "configure", "ssids", "firewall", "isolation", "allowlist", "entries"], + "operation": "createOrganizationWirelessSsidsFirewallIsolationAllowlistEntry", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/assignments" + resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries" body_params = [ - "profile", + "description", + "client", "ssid", "network", ] @@ -11118,161 +5065,102 @@ def createOrganizationWirelessSsidsProfilesAssignment(self, organizationId: str, invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"createOrganizationWirelessSsidsProfilesAssignment: ignoring unrecognized kwargs: {invalid}" + f"createOrganizationWirelessSsidsFirewallIsolationAllowlistEntry: ignoring unrecognized kwargs: {invalid}" ) return self._session.post(metadata, resource, payload) - def deleteOrganizationWirelessSsidsProfilesAssignments(self, organizationId: str, ssid: dict, **kwargs): + def deleteOrganizationWirelessSsidsFirewallIsolationAllowlistEntry(self, organizationId: str, entryId: str): """ - **Unassigns the SSID profile assigned to an SSID** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-ssids-profiles-assignments + **Destroy isolation allow list MAC entry for this organization** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-ssids-firewall-isolation-allowlist-entry - organizationId (string): Organization ID - - ssid (object): SSID to delete the SSID profile assignment of - - network (object): Network containing the SSID (required if SSID number is used) + - entryId (string): Entry ID """ - kwargs.update(locals()) - metadata = { - "tags": ["wireless", "configure", "ssids", "profiles", "assignments"], - "operation": "deleteOrganizationWirelessSsidsProfilesAssignments", + "tags": ["wireless", "configure", "ssids", "firewall", "isolation", "allowlist", "entries"], + "operation": "deleteOrganizationWirelessSsidsFirewallIsolationAllowlistEntry", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/assignments" + entryId = urllib.parse.quote(str(entryId), safe="") + resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries/{entryId}" return self._session.delete(metadata, resource) - def getOrganizationWirelessSsidsProfilesAssignmentsByNetwork( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): + def updateOrganizationWirelessSsidsFirewallIsolationAllowlistEntry(self, organizationId: str, entryId: str, **kwargs): """ - **List the SSID profile assignments in an organization, grouped by network** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-profiles-assignments-by-network + **Update isolation allow list MAC entry info** + https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-ssids-firewall-isolation-allowlist-entry - organizationId (string): Organization ID - - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - - direction (string): direction to paginate, either "next" (default) or "prev" page - - networkIds (array): The network IDs to include in the result set. - - profileIds (array): The SSID profile IDs to include in the result set. - - networkGroupIds (array): The network group IDs to include in the result set. - - includeAllNetworks (boolean): When set to true, include all networks in the organization, even those without any SSID profile assignments. Defaults to false. - - excludeProfileIds (array): The SSID profile IDs to exclude from the result set. - - sortBy (string): Optional parameter to specify the field used to sort results. (default: network) - - sortOrder (string): Optional parameter to specify the sort order. Default value is asc. - - search (string): Optional parameter to search on network name or network group name. - - 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. + - entryId (string): Entry ID + - description (string): The description of mac address + - client (object): The client of allowlist """ kwargs.update(locals()) - if "sortBy" in kwargs: - options = ["group", "network"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - metadata = { - "tags": ["wireless", "configure", "ssids", "profiles", "assignments", "byNetwork"], - "operation": "getOrganizationWirelessSsidsProfilesAssignmentsByNetwork", + "tags": ["wireless", "configure", "ssids", "firewall", "isolation", "allowlist", "entries"], + "operation": "updateOrganizationWirelessSsidsFirewallIsolationAllowlistEntry", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/assignments/byNetwork" - - query_params = [ - "networkIds", - "profileIds", - "networkGroupIds", - "includeAllNetworks", - "excludeProfileIds", - "sortBy", - "sortOrder", - "search", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + entryId = urllib.parse.quote(str(entryId), safe="") + resource = f"/organizations/{organizationId}/wireless/ssids/firewall/isolation/allowlist/entries/{entryId}" - array_params = [ - "networkIds", - "profileIds", - "networkGroupIds", - "excludeProfileIds", + body_params = [ + "description", + "client", ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} if self._session._validate_kwargs: - all_params = query_params + array_params + all_params = [] + body_params invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessSsidsProfilesAssignmentsByNetwork: ignoring unrecognized kwargs: {invalid}" + f"updateOrganizationWirelessSsidsFirewallIsolationAllowlistEntry: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get_pages(metadata, resource, params, total_pages, direction) + return self._session.put(metadata, resource, payload) - def getOrganizationWirelessSsidsProfilesOverviews(self, organizationId: str, total_pages=1, direction="next", **kwargs): + def getOrganizationWirelessSsidsOpenRoamingByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Returns the SSID profiles' overview information for an organization** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-profiles-overviews + **Returns an array of objects, each containing SSID OpenRoaming configs for the corresponding network** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-open-roaming-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 - - name (string): (Optional) Filter results by name. Case insensitive substring match. - - sortBy (string): Column to sort results by. Default is `name`. - - sortOrder (string): Direction to sort results by. Default is `asc`. - - profileIds (array): (Optional) Filter results by a list of SSID profile IDs. - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Optional parameter to filter OpenRoaming configuration by Network Id. + - includeDisabledSsids (boolean): Optional parameter to include OpenRoaming configuration for disabled ssids. """ kwargs.update(locals()) - if "sortBy" in kwargs: - options = ["name"] - assert kwargs["sortBy"] in options, ( - f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' - ) - if "sortOrder" in kwargs: - options = ["asc", "desc"] - assert kwargs["sortOrder"] in options, ( - f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' - ) - metadata = { - "tags": ["wireless", "configure", "ssids", "profiles", "overviews"], - "operation": "getOrganizationWirelessSsidsProfilesOverviews", + "tags": ["wireless", "configure", "ssids", "openRoaming", "byNetwork"], + "operation": "getOrganizationWirelessSsidsOpenRoamingByNetwork", } organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/overviews" + resource = f"/organizations/{organizationId}/wireless/ssids/openRoaming/byNetwork" query_params = [ - "name", - "sortBy", - "sortOrder", - "profileIds", "perPage", "startingAfter", "endingBefore", + "networkIds", + "includeDisabledSsids", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = [ - "profileIds", + "networkIds", ] for k, v in kwargs.items(): if k.strip() in array_params: @@ -11284,67 +5172,11 @@ def getOrganizationWirelessSsidsProfilesOverviews(self, organizationId: str, tot invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] if invalid and self._session._logger: self._session._logger.warning( - f"getOrganizationWirelessSsidsProfilesOverviews: ignoring unrecognized kwargs: {invalid}" + f"getOrganizationWirelessSsidsOpenRoamingByNetwork: ignoring unrecognized kwargs: {invalid}" ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - def updateOrganizationWirelessSsidsProfile(self, organizationId: str, id: str, **kwargs): - """ - **Update this SSID profile** - https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-ssids-profile - - - organizationId (string): Organization ID - - id (string): ID - - name (string): Name of the SSID profile - - ssid (object): SSID configuration for the profile - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wireless", "configure", "ssids", "profiles"], - "operation": "updateOrganizationWirelessSsidsProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/{id}" - - body_params = [ - "name", - "ssid", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"updateOrganizationWirelessSsidsProfile: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.put(metadata, resource, payload) - - def deleteOrganizationWirelessSsidsProfile(self, organizationId: str, id: str): - """ - **Delete an SSID profile** - https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-ssids-profile - - - organizationId (string): Organization ID - - id (string): ID - """ - - metadata = { - "tags": ["wireless", "configure", "ssids", "profiles"], - "operation": "deleteOrganizationWirelessSsidsProfile", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - id = urllib.parse.quote(str(id), safe="") - resource = f"/organizations/{organizationId}/wireless/ssids/profiles/{id}" - - return self._session.delete(metadata, resource) - def getOrganizationWirelessSsidsStatusesByDevice(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **List status information of all BSSIDs in your organization** diff --git a/meraki/api/wirelessController.py b/meraki/api/wirelessController.py index 3ba7fa1..23510e4 100644 --- a/meraki/api/wirelessController.py +++ b/meraki/api/wirelessController.py @@ -177,59 +177,6 @@ def getOrganizationWirelessControllerConnections(self, organizationId: str, tota return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessControllerConnectionsUnassigned( - self, organizationId: str, total_pages=1, direction="next", **kwargs - ): - """ - **List of unassigned Catalyst access points and summary information** - https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-controller-connections-unassigned - - - 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 - - controllerSerials (array): Optional parameter to filter access points by wireless LAN controller cloud ID. This filter uses multiple exact matches. - - supported (boolean): Optional parameter to filter access points based on if they are supported for dashboard monitoring. Values can be true/false, if not provided then all unassigned APs will be returned - - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. - - 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": ["wirelessController", "configure", "connections", "unassigned"], - "operation": "getOrganizationWirelessControllerConnectionsUnassigned", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wirelessController/connections/unassigned" - - query_params = [ - "controllerSerials", - "supported", - "perPage", - "startingAfter", - "endingBefore", - ] - params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - - array_params = [ - "controllerSerials", - ] - for k, v in kwargs.items(): - if k.strip() in array_params: - params[f"{k.strip()}[]"] = kwargs[f"{k}"] - params.pop(k.strip()) - - if self._session._validate_kwargs: - all_params = query_params + array_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"getOrganizationWirelessControllerConnectionsUnassigned: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.get_pages(metadata, resource, params, total_pages, direction) - def getOrganizationWirelessControllerDevicesInterfacesL2ByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): @@ -914,36 +861,3 @@ def getOrganizationWirelessControllerOverviewByDevice( ) return self._session.get_pages(metadata, resource, params, total_pages, direction) - - def generateOrganizationWirelessControllerRegulatoryDomainPackage(self, organizationId: str, **kwargs): - """ - **Generate the regulatory domain package** - https://developer.cisco.com/meraki/api-v1/#!generate-organization-wireless-controller-regulatory-domain-package - - - organizationId (string): Organization ID - - networkIds (array): A list of network IDs to filter by - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["wirelessController", "configure", "regulatoryDomain", "package"], - "operation": "generateOrganizationWirelessControllerRegulatoryDomainPackage", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/wirelessController/regulatoryDomain/package/generate" - - body_params = [ - "networkIds", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning( - f"generateOrganizationWirelessControllerRegulatoryDomainPackage: ignoring unrecognized kwargs: {invalid}" - ) - - return self._session.post(metadata, resource, payload) diff --git a/pyproject.toml b/pyproject.toml index c95e54d..0bc0861 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "meraki" -version = "4.3.0b1" +version = "4.3.0" description = "Cisco Meraki Dashboard API library" authors = [ {name = "Cisco Meraki", email = "api-feedback@meraki.net"} diff --git a/uv.lock b/uv.lock index 1652dd3..a9e24b8 100644 --- a/uv.lock +++ b/uv.lock @@ -354,7 +354,7 @@ wheels = [ [[package]] name = "meraki" -version = "4.3.0b1" +version = "4.3.0" source = { editable = "." } dependencies = [ { name = "httpx" },