From 33da1fe9eb20c3f4bb6926790544635bae24c4af Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 5 Aug 2026 14:53:58 +0000 Subject: [PATCH] Auto-generated library v4.4.0 for API v1.73.0. --- docs/generation-report.md | 6 + meraki/__init__.py | 2 +- meraki/_version.py | 2 +- meraki/aio/api/appliance.py | 6 +- meraki/aio/api/campusGateway.py | 605 ++++++++++++++++++++++++ meraki/aio/api/networks.py | 5 +- meraki/aio/api/organizations.py | 382 ++++++++++++++- meraki/aio/api/sm.py | 14 +- meraki/aio/api/switch.py | 4 +- meraki/aio/api/wireless.py | 755 +++++++++++++++++++++++++++++- meraki/api/appliance.py | 6 +- meraki/api/batch/appliance.py | 2 +- meraki/api/batch/campusGateway.py | 73 +++ meraki/api/batch/networks.py | 5 +- meraki/api/batch/organizations.py | 221 +++++++++ meraki/api/batch/switch.py | 4 +- meraki/api/batch/wireless.py | 132 +++++- meraki/api/campusGateway.py | 605 ++++++++++++++++++++++++ meraki/api/networks.py | 5 +- meraki/api/organizations.py | 382 ++++++++++++++- meraki/api/sm.py | 14 +- meraki/api/switch.py | 4 +- meraki/api/wireless.py | 755 +++++++++++++++++++++++++++++- pyproject.toml | 2 +- uv.lock | 2 +- 25 files changed, 3961 insertions(+), 32 deletions(-) diff --git a/docs/generation-report.md b/docs/generation-report.md index 3196bdd3..01ada315 100644 --- a/docs/generation-report.md +++ b/docs/generation-report.md @@ -1,5 +1,11 @@ # Generation Report +## 2026-08-05 | Library v4.4.0 | API 1.73.0 + + +No Python keyword parameter conflicts detected. + + ## 2026-07-16 | Library v4.3.1 | API 1.72.0 diff --git a/meraki/__init__.py b/meraki/__init__.py index 114dcfe0..2fa9b497 100644 --- a/meraki/__init__.py +++ b/meraki/__init__.py @@ -60,7 +60,7 @@ from meraki._version import __version__ # noqa: F401 from datetime import datetime -__api_version__ = "1.72.0" +__api_version__ = "1.73.0" __all__ = [ "APIError", diff --git a/meraki/_version.py b/meraki/_version.py index ed48cdab..ecdb1cef 100644 --- a/meraki/_version.py +++ b/meraki/_version.py @@ -1 +1 @@ -__version__ = "4.3.1" +__version__ = "4.4.0" diff --git a/meraki/aio/api/appliance.py b/meraki/aio/api/appliance.py index 09c98051..e4984ca4 100644 --- a/meraki/aio/api/appliance.py +++ b/meraki/aio/api/appliance.py @@ -1214,7 +1214,7 @@ def updateNetworkAppliancePort(self, networkId: str, portId: str, **kwargs): - type (string): The type of the port: 'access' or 'trunk'. - 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. + - accessPolicy (string): The name of the policy. Only applicable to Access ports. Valid values are: 'open', '8021x-radius', 'mac-radius', 'hybrid-radius', 'access-manager' 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. - sgt (object): Security Group Tag settings for the port. """ @@ -1963,6 +1963,7 @@ 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 + - enabled (boolean): Enable/disable the static route """ kwargs.update(locals()) @@ -1979,6 +1980,7 @@ def createNetworkApplianceStaticRoute(self, networkId: str, name: str, subnet: s "subnet", "gatewayIp", "gatewayVlanId", + "enabled", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -4558,7 +4560,7 @@ def updateOrganizationApplianceVpnSiteToSiteIpsecPeersSlas(self, organizationId: def getOrganizationApplianceVpnStats(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Show VPN history stat for networks in an organization** + **Show VPN history stats for networks in an organization** https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vpn-stats - organizationId (string): Organization ID diff --git a/meraki/aio/api/campusGateway.py b/meraki/aio/api/campusGateway.py index ed7cee55..e33ec921 100644 --- a/meraki/aio/api/campusGateway.py +++ b/meraki/aio/api/campusGateway.py @@ -96,6 +96,96 @@ 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 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** @@ -143,6 +233,521 @@ 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 getOrganizationCampusGatewayClustersTunnelable( + self, organizationId: str, fromNetworkIds: list, total_pages=1, direction="next", **kwargs + ): + """ + **List available campus gateway clusters that can be used for wireless network tunneling** + https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-clusters-tunnelable + + - organizationId (string): Organization ID + - fromNetworkIds (array): Filter results by wireless network 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 + - excludeSsidNumbers (array): Optional SSID numbers (0-15) to exclude from restriction checks, corresponding to each fromNetworkIds entry. Only one SSID per network can be excluded. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 200. Default is 200. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should 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", "tunnelable"], + "operation": "getOrganizationCampusGatewayClustersTunnelable", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/campusGateway/clusters/tunnelable" + + query_params = [ + "fromNetworkIds", + "excludeSsidNumbers", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "fromNetworkIds", + "excludeSsidNumbers", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationCampusGatewayClustersTunnelable: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + 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/networks.py b/meraki/aio/api/networks.py index 34865da2..83474d0d 100644 --- a/meraki/aio/api/networks.py +++ b/meraki/aio/api/networks.py @@ -1056,6 +1056,7 @@ def updateNetworkFirmwareUpgrades(self, networkId: str, **kwargs): - upgradeWindow (object): Upgrade window for devices in network - timezone (string): The timezone for the network - products (object): Contains information about the network to update + - featureLossAcknowledgements (array): Acknowledges the target version has removed certain features that the network is currently using. """ kwargs.update(locals()) @@ -1071,6 +1072,7 @@ def updateNetworkFirmwareUpgrades(self, networkId: str, **kwargs): "upgradeWindow", "timezone", "products", + "featureLossAcknowledgements", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1101,6 +1103,7 @@ def createNetworkFirmwareUpgradesRollback(self, networkId: str, reasons: list, * options = [ "appliance", "camera", + "campusGateway", "cellularGateway", "secureConnect", "switch", @@ -2638,7 +2641,7 @@ def updateNetworkSettings(self, networkId: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!update-network-settings - networkId (string): Network ID - - localStatusPageEnabled (boolean): Enables / disables the local device status pages (my.meraki.com, ap.meraki.com, switch.meraki.com, wired.meraki.com). Optional (defaults to false) + - localStatusPageEnabled (boolean): Enables / disables the local device status pages (my.meraki.com, ap.meraki.com, switch.meraki.com, wired.meraki.com). Optional (defaults to true) - 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. diff --git a/meraki/aio/api/organizations.py b/meraki/aio/api/organizations.py index c043f253..5c6bd5ef 100644 --- a/meraki/aio/api/organizations.py +++ b/meraki/aio/api/organizations.py @@ -1824,6 +1824,130 @@ def getOrganizationAssuranceAlertsOverviewHistorical( return self._session.get(metadata, resource, params) + def getOrganizationAssuranceAlertsProfiles(self, organizationId: str): + """ + **List the alert profiles for this organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-alerts-profiles + + - organizationId (string): Organization ID + """ + + metadata = { + "tags": ["organizations", "configure", "alerts", "profiles"], + "operation": "getOrganizationAssuranceAlertsProfiles", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/assurance/alerts/profiles" + + return self._session.get(metadata, resource) + + def createOrganizationAssuranceAlertsProfile( + self, organizationId: str, name: str, networkIds: list, alertTypes: list, configuration: dict, **kwargs + ): + """ + **Create an alert profile** + https://developer.cisco.com/meraki/api-v1/#!create-organization-assurance-alerts-profile + + - organizationId (string): Organization ID + - name (string): Name of the alert profile + - networkIds (array): Networks associated with this alert profile + - alertTypes (array): Alert types associated with this alert profile + - configuration (object): Alert configuration for this profile + - alertScheduleId (string): ID of the alert schedule associated with this profile + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "alerts", "profiles"], + "operation": "createOrganizationAssuranceAlertsProfile", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/assurance/alerts/profiles" + + body_params = [ + "name", + "networkIds", + "alertTypes", + "alertScheduleId", + "configuration", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"createOrganizationAssuranceAlertsProfile: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def updateOrganizationAssuranceAlertsProfile( + self, organizationId: str, profileId: str, name: str, networkIds: list, alertTypes: list, configuration: dict, **kwargs + ): + """ + **Update an alert profile** + https://developer.cisco.com/meraki/api-v1/#!update-organization-assurance-alerts-profile + + - organizationId (string): Organization ID + - profileId (string): Profile ID + - name (string): Name of the alert profile + - networkIds (array): Networks associated with this alert profile + - alertTypes (array): Alert types associated with this alert profile + - configuration (object): Alert configuration for this profile + - alertScheduleId (string): ID of the alert schedule associated with this profile + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "alerts", "profiles"], + "operation": "updateOrganizationAssuranceAlertsProfile", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + profileId = urllib.parse.quote(str(profileId), safe="") + resource = f"/organizations/{organizationId}/assurance/alerts/profiles/{profileId}" + + body_params = [ + "name", + "networkIds", + "alertTypes", + "alertScheduleId", + "configuration", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"updateOrganizationAssuranceAlertsProfile: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def deleteOrganizationAssuranceAlertsProfile(self, organizationId: str, profileId: str): + """ + **Delete an alert profile for this organization** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-assurance-alerts-profile + + - organizationId (string): Organization ID + - profileId (string): Profile ID + """ + + metadata = { + "tags": ["organizations", "configure", "alerts", "profiles"], + "operation": "deleteOrganizationAssuranceAlertsProfile", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + profileId = urllib.parse.quote(str(profileId), safe="") + resource = f"/organizations/{organizationId}/assurance/alerts/profiles/{profileId}" + + return self._session.delete(metadata, resource) + def restoreOrganizationAssuranceAlerts(self, organizationId: str, alertIds: list, **kwargs): """ **Restore health alerts from dismissed** @@ -5751,6 +5875,251 @@ def combineOrganizationNetworks(self, organizationId: str, name: str, networkIds 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", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for 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}") + + return self._session.post(metadata, resource, payload) + + 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() + + metadata = { + "tags": ["organizations", "configure", "networks", "groups"], + "operation": "bulkOrganizationNetworksGroupUnassign", + } + 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} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for 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}" + ) + + return self._session.post(metadata, resource, payload) + def createNetworkMove(self, organizationId: str, network: dict, organizations: dict, **kwargs): """ **Move networks from one organization to another** @@ -7655,7 +8024,18 @@ def detachOrganizationSaseSites(self, organizationId: str, **kwargs): organizationId = urllib.parse.quote(str(organizationId), safe="") resource = f"/organizations/{organizationId}/sase/sites/detach" - return self._session.delete(metadata, resource) + 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"detachOrganizationSaseSites: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) def updateOrganizationSaseSite(self, organizationId: str, siteId: str, **kwargs): """ diff --git a/meraki/aio/api/sm.py b/meraki/aio/api/sm.py index 26075e3d..ed5f8290 100644 --- a/meraki/aio/api/sm.py +++ b/meraki/aio/api/sm.py @@ -855,12 +855,17 @@ def getNetworkSmDeviceWlanLists(self, networkId: str, deviceId: str): return self._session.get(metadata, resource) - def getNetworkSmProfiles(self, networkId: str, **kwargs): + def getNetworkSmProfiles(self, networkId: str, total_pages=1, direction="next", **kwargs): """ - **List all profiles in a network** + **List profiles in a network** https://developer.cisco.com/meraki/api-v1/#!get-network-sm-profiles - networkId (string): Network ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 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. - payloadTypes (array): Filter by payload types """ @@ -874,6 +879,9 @@ def getNetworkSmProfiles(self, networkId: str, **kwargs): resource = f"/networks/{networkId}/sm/profiles" query_params = [ + "perPage", + "startingAfter", + "endingBefore", "payloadTypes", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} @@ -892,7 +900,7 @@ def getNetworkSmProfiles(self, networkId: str, **kwargs): if invalid and self._session._logger: self._session._logger.warning(f"getNetworkSmProfiles: ignoring unrecognized kwargs: {invalid}") - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) def getNetworkSmTargetGroups(self, networkId: str, **kwargs): """ diff --git a/meraki/aio/api/switch.py b/meraki/aio/api/switch.py index ab988ac5..14e4e8b2 100644 --- a/meraki/aio/api/switch.py +++ b/meraki/aio/api/switch.py @@ -175,7 +175,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - daiTrusted (boolean): If true, ARP packets for this port will be considered trusted, and Dynamic ARP Inspection will allow the traffic. - profile (object): Profile attributes - dot3az (object): dot3az settings for the port - - highSpeed (object): High speed port enablement settings for C9500-32QC + - highSpeed (object): High speed port enablement settings for a high-speed logical port. """ kwargs.update(locals()) @@ -3056,7 +3056,7 @@ def updateOrganizationConfigTemplateSwitchProfilePort( - daiTrusted (boolean): If true, ARP packets for this port will be considered trusted, and Dynamic ARP Inspection will allow the traffic. - profile (object): Profile attributes - dot3az (object): dot3az settings for the port - - highSpeed (object): High speed port enablement settings for C9500-32QC + - highSpeed (object): High speed port enablement settings for a high-speed logical port. """ kwargs.update(locals()) diff --git a/meraki/aio/api/wireless.py b/meraki/aio/api/wireless.py index b9ece30d..c2f93b25 100644 --- a/meraki/aio/api/wireless.py +++ b/meraki/aio/api/wireless.py @@ -2260,7 +2260,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - wpaEncryptionMode (string): The types of WPA encryption. ('WPA1 only', 'WPA1 and WPA2', 'WPA2 only', 'WPA3 Transition Mode', 'WPA3 only' or 'WPA3 192-bit Security') - dot11w (object): The current setting for Protected Management Frames (802.11w). - dot11r (object): The current setting for 802.11r - - splashPage (string): The type of splash page for the SSID ('None', 'Click-through splash page', 'Billing', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'SMS authentication', 'Systems Manager Sentry', 'Facebook Wi-Fi', 'Google OAuth', 'Microsoft Entra ID', 'Sponsored guest', 'Cisco ISE' or 'Google Apps domain').This attribute is not supported for template children. + - splashPage (string): The type of splash page for the SSID ('None', 'Click-through splash page', 'Billing', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'SMS authentication', 'Systems Manager Sentry', 'Facebook Wi-Fi', 'Google OAuth', 'Microsoft Entra ID', 'Sponsored guest' or 'Cisco ISE').This attribute is not supported for template children. - splashGuestSponsorDomains (array): Array of valid sponsor email domains for sponsored guest splash type. - oauth (object): The OAuth settings of this SSID. Only valid if splashPage is 'Google OAuth'. - localRadius (object): The current setting for Local Authentication, a built-in RADIUS server on the access point. Only valid if authMode is '8021x-localradius'. @@ -2283,6 +2283,7 @@ 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.) @@ -2362,7 +2363,6 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): "Cisco ISE", "Click-through splash page", "Facebook Wi-Fi", - "Google Apps domain", "Google OAuth", "Microsoft Entra ID", "None", @@ -2435,6 +2435,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): "radiusAccountingInterimInterval", "radiusAttributeForGroupPolicies", "ipAssignmentMode", + "campusGateway", "useVlanTagging", "concentratorNetworkId", "secondaryConcentratorNetworkId", @@ -3379,6 +3380,63 @@ def updateNetworkWirelessZigbee(self, networkId: str, **kwargs): return self._session.put(metadata, resource, payload) + def getOrganizationAssuranceImpactedDeviceWirelessByNetwork( + 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 + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get 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. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should 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", "impactedDevice", "byNetwork"], + "operation": "getOrganizationAssuranceImpactedDeviceWirelessByNetwork", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/assurance/impactedDevice/wireless/byNetwork" + + query_params = [ + "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 = [ + "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"getOrganizationAssuranceImpactedDeviceWirelessByNetwork: 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** @@ -3479,6 +3537,66 @@ def getOrganizationWirelessAirMarshalSettingsByNetwork( 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** @@ -3534,6 +3652,224 @@ def getOrganizationWirelessClientsOverviewByDevice(self, organizationId: str, to 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 getOrganizationWirelessDevicesChannelUtilizationByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): @@ -5177,6 +5513,421 @@ def getOrganizationWirelessSsidsOpenRoamingByNetwork(self, organizationId: str, return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationWirelessSsidsProfiles(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 + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get 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. + """ + + 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", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/ssids/profiles" + + query_params = [ + "name", + "sortBy", + "sortOrder", + "profileIds", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "profileIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for 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}" + ) + + return self._session.post(metadata, resource, payload) + + def getOrganizationWirelessSsidsProfilesAssignments(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 + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get 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. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "configure", "ssids", "profiles", "assignments"], + "operation": "getOrganizationWirelessSsidsProfilesAssignments", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/ssids/profiles/assignments" + + query_params = [ + "networkIds", + "ssidIds", + "profileIds", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "ssidIds", + "profileIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for 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}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + 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()) + + metadata = { + "tags": ["wireless", "configure", "ssids", "profiles", "assignments"], + "operation": "createOrganizationWirelessSsidsProfilesAssignment", + } + 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} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for 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}" + ) + + return self._session.post(metadata, resource, payload) + + 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()) + + metadata = { + "tags": ["wireless", "configure", "ssids", "profiles", "assignments"], + "operation": "deleteOrganizationWirelessSsidsProfilesAssignments", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/ssids/profiles/assignments" + + return self._session.delete(metadata, resource) + + def getOrganizationWirelessSsidsProfilesAssignmentsByNetwork( + self, organizationId: str, total_pages=1, direction="next", **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 + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get 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. + """ + + 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", + } + 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} + + array_params = [ + "networkIds", + "profileIds", + "networkGroupIds", + "excludeProfileIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for 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}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationWirelessSsidsProfilesOverviews(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 + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get 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. + """ + + 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", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/ssids/profiles/overviews" + + query_params = [ + "name", + "sortBy", + "sortOrder", + "profileIds", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "profileIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for 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}" + ) + + 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/appliance.py b/meraki/api/appliance.py index 82023191..b0767455 100644 --- a/meraki/api/appliance.py +++ b/meraki/api/appliance.py @@ -1214,7 +1214,7 @@ def updateNetworkAppliancePort(self, networkId: str, portId: str, **kwargs): - type (string): The type of the port: 'access' or 'trunk'. - 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. + - accessPolicy (string): The name of the policy. Only applicable to Access ports. Valid values are: 'open', '8021x-radius', 'mac-radius', 'hybrid-radius', 'access-manager' 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. - sgt (object): Security Group Tag settings for the port. """ @@ -1963,6 +1963,7 @@ 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 + - enabled (boolean): Enable/disable the static route """ kwargs.update(locals()) @@ -1979,6 +1980,7 @@ def createNetworkApplianceStaticRoute(self, networkId: str, name: str, subnet: s "subnet", "gatewayIp", "gatewayVlanId", + "enabled", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -4558,7 +4560,7 @@ def updateOrganizationApplianceVpnSiteToSiteIpsecPeersSlas(self, organizationId: def getOrganizationApplianceVpnStats(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **Show VPN history stat for networks in an organization** + **Show VPN history stats for networks in an organization** https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vpn-stats - organizationId (string): Organization ID diff --git a/meraki/api/batch/appliance.py b/meraki/api/batch/appliance.py index a672cfb5..fbf0e788 100644 --- a/meraki/api/batch/appliance.py +++ b/meraki/api/batch/appliance.py @@ -323,7 +323,7 @@ def updateNetworkAppliancePort(self, networkId: str, portId: str, **kwargs): - type (string): The type of the port: 'access' or 'trunk'. - 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. + - accessPolicy (string): The name of the policy. Only applicable to Access ports. Valid values are: 'open', '8021x-radius', 'mac-radius', 'hybrid-radius', 'access-manager' 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. - sgt (object): Security Group Tag settings for the port. """ diff --git a/meraki/api/batch/campusGateway.py b/meraki/api/batch/campusGateway.py index 6127c57b..a4b1a2e2 100644 --- a/meraki/api/batch/campusGateway.py +++ b/meraki/api/batch/campusGateway.py @@ -82,3 +82,76 @@ 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 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 diff --git a/meraki/api/batch/networks.py b/meraki/api/batch/networks.py index c7113741..adfb0620 100644 --- a/meraki/api/batch/networks.py +++ b/meraki/api/batch/networks.py @@ -247,6 +247,7 @@ def updateNetworkFirmwareUpgrades(self, networkId: str, **kwargs): - upgradeWindow (object): Upgrade window for devices in network - timezone (string): The timezone for the network - products (object): Contains information about the network to update + - featureLossAcknowledgements (array): Acknowledges the target version has removed certain features that the network is currently using. """ kwargs.update(locals()) @@ -258,6 +259,7 @@ def updateNetworkFirmwareUpgrades(self, networkId: str, **kwargs): "upgradeWindow", "timezone", "products", + "featureLossAcknowledgements", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -286,6 +288,7 @@ def createNetworkFirmwareUpgradesRollback(self, networkId: str, reasons: list, * options = [ "appliance", "camera", + "campusGateway", "cellularGateway", "secureConnect", "switch", @@ -875,7 +878,7 @@ def updateNetworkSettings(self, networkId: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!update-network-settings - networkId (string): Network ID - - localStatusPageEnabled (boolean): Enables / disables the local device status pages (my.meraki.com, ap.meraki.com, switch.meraki.com, wired.meraki.com). Optional (defaults to false) + - localStatusPageEnabled (boolean): Enables / disables the local device status pages (my.meraki.com, ap.meraki.com, switch.meraki.com, wired.meraki.com). Optional (defaults to true) - 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. diff --git a/meraki/api/batch/organizations.py b/meraki/api/batch/organizations.py index 846c2023..f6c1d1d7 100644 --- a/meraki/api/batch/organizations.py +++ b/meraki/api/batch/organizations.py @@ -451,6 +451,97 @@ def deleteOrganizationAlertsProfile(self, organizationId: str, alertConfigId: st } return action + def createOrganizationAssuranceAlertsProfile( + self, organizationId: str, name: str, networkIds: list, alertTypes: list, configuration: dict, **kwargs + ): + """ + **Create an alert profile** + https://developer.cisco.com/meraki/api-v1/#!create-organization-assurance-alerts-profile + + - organizationId (string): Organization ID + - name (string): Name of the alert profile + - networkIds (array): Networks associated with this alert profile + - alertTypes (array): Alert types associated with this alert profile + - configuration (object): Alert configuration for this profile + - alertScheduleId (string): ID of the alert schedule associated with this profile + """ + + kwargs.update(locals()) + + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/assurance/alerts/profiles" + + body_params = [ + "name", + "networkIds", + "alertTypes", + "alertScheduleId", + "configuration", + ] + 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 updateOrganizationAssuranceAlertsProfile( + self, organizationId: str, profileId: str, name: str, networkIds: list, alertTypes: list, configuration: dict, **kwargs + ): + """ + **Update an alert profile** + https://developer.cisco.com/meraki/api-v1/#!update-organization-assurance-alerts-profile + + - organizationId (string): Organization ID + - profileId (string): Profile ID + - name (string): Name of the alert profile + - networkIds (array): Networks associated with this alert profile + - alertTypes (array): Alert types associated with this alert profile + - configuration (object): Alert configuration for this profile + - alertScheduleId (string): ID of the alert schedule associated with this profile + """ + + kwargs.update(locals()) + + organizationId = urllib.parse.quote(str(organizationId), safe="") + profileId = urllib.parse.quote(str(profileId), safe="") + resource = f"/organizations/{organizationId}/assurance/alerts/profiles/{profileId}" + + body_params = [ + "name", + "networkIds", + "alertTypes", + "alertScheduleId", + "configuration", + ] + 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 deleteOrganizationAssuranceAlertsProfile(self, organizationId: str, profileId: str): + """ + **Delete an alert profile for this organization** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-assurance-alerts-profile + + - organizationId (string): Organization ID + - profileId (string): Profile ID + """ + + organizationId = urllib.parse.quote(str(organizationId), safe="") + profileId = urllib.parse.quote(str(profileId), safe="") + resource = f"/organizations/{organizationId}/assurance/alerts/profiles/{profileId}" + + action = { + "resource": resource, + "operation": "destroy", + } + return action + def createOrganizationBrandingPolicy(self, organizationId: str, name: str, **kwargs): """ **Add a new branding policy to an organization** @@ -1338,6 +1429,131 @@ 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 createOrganizationPoliciesGlobalFirewallRuleset(self, organizationId: str, name: str, **kwargs): """ **Create an Organization-Wide Policy Firewall Ruleset** @@ -2109,9 +2325,14 @@ def detachOrganizationSaseSites(self, organizationId: str, **kwargs): organizationId = urllib.parse.quote(str(organizationId), safe="") resource = f"/organizations/{organizationId}/sase/sites/detach" + body_params = [ + "items", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, "operation": "detach", + "body": payload, } return action diff --git a/meraki/api/batch/switch.py b/meraki/api/batch/switch.py index 9c0662b8..b0691bb4 100644 --- a/meraki/api/batch/switch.py +++ b/meraki/api/batch/switch.py @@ -68,7 +68,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - daiTrusted (boolean): If true, ARP packets for this port will be considered trusted, and Dynamic ARP Inspection will allow the traffic. - profile (object): Profile attributes - dot3az (object): dot3az settings for the port - - highSpeed (object): High speed port enablement settings for C9500-32QC + - highSpeed (object): High speed port enablement settings for a high-speed logical port. """ kwargs.update(locals()) @@ -1690,7 +1690,7 @@ def updateOrganizationConfigTemplateSwitchProfilePort( - daiTrusted (boolean): If true, ARP packets for this port will be considered trusted, and Dynamic ARP Inspection will allow the traffic. - profile (object): Profile attributes - dot3az (object): dot3az settings for the port - - highSpeed (object): High speed port enablement settings for C9500-32QC + - highSpeed (object): High speed port enablement settings for a high-speed logical port. """ kwargs.update(locals()) diff --git a/meraki/api/batch/wireless.py b/meraki/api/batch/wireless.py index 69e45e3f..e517441d 100644 --- a/meraki/api/batch/wireless.py +++ b/meraki/api/batch/wireless.py @@ -711,7 +711,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - wpaEncryptionMode (string): The types of WPA encryption. ('WPA1 only', 'WPA1 and WPA2', 'WPA2 only', 'WPA3 Transition Mode', 'WPA3 only' or 'WPA3 192-bit Security') - dot11w (object): The current setting for Protected Management Frames (802.11w). - dot11r (object): The current setting for 802.11r - - splashPage (string): The type of splash page for the SSID ('None', 'Click-through splash page', 'Billing', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'SMS authentication', 'Systems Manager Sentry', 'Facebook Wi-Fi', 'Google OAuth', 'Microsoft Entra ID', 'Sponsored guest', 'Cisco ISE' or 'Google Apps domain').This attribute is not supported for template children. + - splashPage (string): The type of splash page for the SSID ('None', 'Click-through splash page', 'Billing', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'SMS authentication', 'Systems Manager Sentry', 'Facebook Wi-Fi', 'Google OAuth', 'Microsoft Entra ID', 'Sponsored guest' or 'Cisco ISE').This attribute is not supported for template children. - splashGuestSponsorDomains (array): Array of valid sponsor email domains for sponsored guest splash type. - oauth (object): The OAuth settings of this SSID. Only valid if splashPage is 'Google OAuth'. - localRadius (object): The current setting for Local Authentication, a built-in RADIUS server on the access point. Only valid if authMode is '8021x-localradius'. @@ -734,6 +734,7 @@ 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.) @@ -813,7 +814,6 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): "Cisco ISE", "Click-through splash page", "Facebook Wi-Fi", - "Google Apps domain", "Google OAuth", "Microsoft Entra ID", "None", @@ -882,6 +882,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): "radiusAccountingInterimInterval", "radiusAttributeForGroupPolicies", "ipAssignmentMode", + "campusGateway", "useVlanTagging", "concentratorNetworkId", "secondaryConcentratorNetworkId", @@ -1740,6 +1741,133 @@ 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/campusGateway.py b/meraki/api/campusGateway.py index c5636184..aaf8028a 100644 --- a/meraki/api/campusGateway.py +++ b/meraki/api/campusGateway.py @@ -96,6 +96,96 @@ 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 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** @@ -143,6 +233,521 @@ 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 getOrganizationCampusGatewayClustersTunnelable( + self, organizationId: str, fromNetworkIds: list, total_pages=1, direction="next", **kwargs + ): + """ + **List available campus gateway clusters that can be used for wireless network tunneling** + https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-clusters-tunnelable + + - organizationId (string): Organization ID + - fromNetworkIds (array): Filter results by wireless network 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 + - excludeSsidNumbers (array): Optional SSID numbers (0-15) to exclude from restriction checks, corresponding to each fromNetworkIds entry. Only one SSID per network can be excluded. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 200. Default is 200. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should 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", "tunnelable"], + "operation": "getOrganizationCampusGatewayClustersTunnelable", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/campusGateway/clusters/tunnelable" + + query_params = [ + "fromNetworkIds", + "excludeSsidNumbers", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "fromNetworkIds", + "excludeSsidNumbers", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationCampusGatewayClustersTunnelable: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + 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/networks.py b/meraki/api/networks.py index ea29c61f..00fb032f 100644 --- a/meraki/api/networks.py +++ b/meraki/api/networks.py @@ -1056,6 +1056,7 @@ def updateNetworkFirmwareUpgrades(self, networkId: str, **kwargs): - upgradeWindow (object): Upgrade window for devices in network - timezone (string): The timezone for the network - products (object): Contains information about the network to update + - featureLossAcknowledgements (array): Acknowledges the target version has removed certain features that the network is currently using. """ kwargs.update(locals()) @@ -1071,6 +1072,7 @@ def updateNetworkFirmwareUpgrades(self, networkId: str, **kwargs): "upgradeWindow", "timezone", "products", + "featureLossAcknowledgements", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1101,6 +1103,7 @@ def createNetworkFirmwareUpgradesRollback(self, networkId: str, reasons: list, * options = [ "appliance", "camera", + "campusGateway", "cellularGateway", "secureConnect", "switch", @@ -2638,7 +2641,7 @@ def updateNetworkSettings(self, networkId: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!update-network-settings - networkId (string): Network ID - - localStatusPageEnabled (boolean): Enables / disables the local device status pages (my.meraki.com, ap.meraki.com, switch.meraki.com, wired.meraki.com). Optional (defaults to false) + - localStatusPageEnabled (boolean): Enables / disables the local device status pages (my.meraki.com, ap.meraki.com, switch.meraki.com, wired.meraki.com). Optional (defaults to true) - 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. diff --git a/meraki/api/organizations.py b/meraki/api/organizations.py index 896e794e..5dbbc85c 100644 --- a/meraki/api/organizations.py +++ b/meraki/api/organizations.py @@ -1824,6 +1824,130 @@ def getOrganizationAssuranceAlertsOverviewHistorical( return self._session.get(metadata, resource, params) + def getOrganizationAssuranceAlertsProfiles(self, organizationId: str): + """ + **List the alert profiles for this organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-alerts-profiles + + - organizationId (string): Organization ID + """ + + metadata = { + "tags": ["organizations", "configure", "alerts", "profiles"], + "operation": "getOrganizationAssuranceAlertsProfiles", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/assurance/alerts/profiles" + + return self._session.get(metadata, resource) + + def createOrganizationAssuranceAlertsProfile( + self, organizationId: str, name: str, networkIds: list, alertTypes: list, configuration: dict, **kwargs + ): + """ + **Create an alert profile** + https://developer.cisco.com/meraki/api-v1/#!create-organization-assurance-alerts-profile + + - organizationId (string): Organization ID + - name (string): Name of the alert profile + - networkIds (array): Networks associated with this alert profile + - alertTypes (array): Alert types associated with this alert profile + - configuration (object): Alert configuration for this profile + - alertScheduleId (string): ID of the alert schedule associated with this profile + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "alerts", "profiles"], + "operation": "createOrganizationAssuranceAlertsProfile", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/assurance/alerts/profiles" + + body_params = [ + "name", + "networkIds", + "alertTypes", + "alertScheduleId", + "configuration", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"createOrganizationAssuranceAlertsProfile: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def updateOrganizationAssuranceAlertsProfile( + self, organizationId: str, profileId: str, name: str, networkIds: list, alertTypes: list, configuration: dict, **kwargs + ): + """ + **Update an alert profile** + https://developer.cisco.com/meraki/api-v1/#!update-organization-assurance-alerts-profile + + - organizationId (string): Organization ID + - profileId (string): Profile ID + - name (string): Name of the alert profile + - networkIds (array): Networks associated with this alert profile + - alertTypes (array): Alert types associated with this alert profile + - configuration (object): Alert configuration for this profile + - alertScheduleId (string): ID of the alert schedule associated with this profile + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "alerts", "profiles"], + "operation": "updateOrganizationAssuranceAlertsProfile", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + profileId = urllib.parse.quote(str(profileId), safe="") + resource = f"/organizations/{organizationId}/assurance/alerts/profiles/{profileId}" + + body_params = [ + "name", + "networkIds", + "alertTypes", + "alertScheduleId", + "configuration", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"updateOrganizationAssuranceAlertsProfile: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def deleteOrganizationAssuranceAlertsProfile(self, organizationId: str, profileId: str): + """ + **Delete an alert profile for this organization** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-assurance-alerts-profile + + - organizationId (string): Organization ID + - profileId (string): Profile ID + """ + + metadata = { + "tags": ["organizations", "configure", "alerts", "profiles"], + "operation": "deleteOrganizationAssuranceAlertsProfile", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + profileId = urllib.parse.quote(str(profileId), safe="") + resource = f"/organizations/{organizationId}/assurance/alerts/profiles/{profileId}" + + return self._session.delete(metadata, resource) + def restoreOrganizationAssuranceAlerts(self, organizationId: str, alertIds: list, **kwargs): """ **Restore health alerts from dismissed** @@ -5751,6 +5875,251 @@ def combineOrganizationNetworks(self, organizationId: str, name: str, networkIds 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", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for 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}") + + return self._session.post(metadata, resource, payload) + + 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() + + metadata = { + "tags": ["organizations", "configure", "networks", "groups"], + "operation": "bulkOrganizationNetworksGroupUnassign", + } + 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} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for 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}" + ) + + return self._session.post(metadata, resource, payload) + def createNetworkMove(self, organizationId: str, network: dict, organizations: dict, **kwargs): """ **Move networks from one organization to another** @@ -7655,7 +8024,18 @@ def detachOrganizationSaseSites(self, organizationId: str, **kwargs): organizationId = urllib.parse.quote(str(organizationId), safe="") resource = f"/organizations/{organizationId}/sase/sites/detach" - return self._session.delete(metadata, resource) + 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"detachOrganizationSaseSites: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) def updateOrganizationSaseSite(self, organizationId: str, siteId: str, **kwargs): """ diff --git a/meraki/api/sm.py b/meraki/api/sm.py index c79ab088..ce89b7a5 100644 --- a/meraki/api/sm.py +++ b/meraki/api/sm.py @@ -855,12 +855,17 @@ def getNetworkSmDeviceWlanLists(self, networkId: str, deviceId: str): return self._session.get(metadata, resource) - def getNetworkSmProfiles(self, networkId: str, **kwargs): + def getNetworkSmProfiles(self, networkId: str, total_pages=1, direction="next", **kwargs): """ - **List all profiles in a network** + **List profiles in a network** https://developer.cisco.com/meraki/api-v1/#!get-network-sm-profiles - networkId (string): Network ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 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. - payloadTypes (array): Filter by payload types """ @@ -874,6 +879,9 @@ def getNetworkSmProfiles(self, networkId: str, **kwargs): resource = f"/networks/{networkId}/sm/profiles" query_params = [ + "perPage", + "startingAfter", + "endingBefore", "payloadTypes", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} @@ -892,7 +900,7 @@ def getNetworkSmProfiles(self, networkId: str, **kwargs): if invalid and self._session._logger: self._session._logger.warning(f"getNetworkSmProfiles: ignoring unrecognized kwargs: {invalid}") - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) def getNetworkSmTargetGroups(self, networkId: str, **kwargs): """ diff --git a/meraki/api/switch.py b/meraki/api/switch.py index 4004ce53..1f65cc67 100644 --- a/meraki/api/switch.py +++ b/meraki/api/switch.py @@ -175,7 +175,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - daiTrusted (boolean): If true, ARP packets for this port will be considered trusted, and Dynamic ARP Inspection will allow the traffic. - profile (object): Profile attributes - dot3az (object): dot3az settings for the port - - highSpeed (object): High speed port enablement settings for C9500-32QC + - highSpeed (object): High speed port enablement settings for a high-speed logical port. """ kwargs.update(locals()) @@ -3056,7 +3056,7 @@ def updateOrganizationConfigTemplateSwitchProfilePort( - daiTrusted (boolean): If true, ARP packets for this port will be considered trusted, and Dynamic ARP Inspection will allow the traffic. - profile (object): Profile attributes - dot3az (object): dot3az settings for the port - - highSpeed (object): High speed port enablement settings for C9500-32QC + - highSpeed (object): High speed port enablement settings for a high-speed logical port. """ kwargs.update(locals()) diff --git a/meraki/api/wireless.py b/meraki/api/wireless.py index 38af3999..349077ae 100644 --- a/meraki/api/wireless.py +++ b/meraki/api/wireless.py @@ -2260,7 +2260,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - wpaEncryptionMode (string): The types of WPA encryption. ('WPA1 only', 'WPA1 and WPA2', 'WPA2 only', 'WPA3 Transition Mode', 'WPA3 only' or 'WPA3 192-bit Security') - dot11w (object): The current setting for Protected Management Frames (802.11w). - dot11r (object): The current setting for 802.11r - - splashPage (string): The type of splash page for the SSID ('None', 'Click-through splash page', 'Billing', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'SMS authentication', 'Systems Manager Sentry', 'Facebook Wi-Fi', 'Google OAuth', 'Microsoft Entra ID', 'Sponsored guest', 'Cisco ISE' or 'Google Apps domain').This attribute is not supported for template children. + - splashPage (string): The type of splash page for the SSID ('None', 'Click-through splash page', 'Billing', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'SMS authentication', 'Systems Manager Sentry', 'Facebook Wi-Fi', 'Google OAuth', 'Microsoft Entra ID', 'Sponsored guest' or 'Cisco ISE').This attribute is not supported for template children. - splashGuestSponsorDomains (array): Array of valid sponsor email domains for sponsored guest splash type. - oauth (object): The OAuth settings of this SSID. Only valid if splashPage is 'Google OAuth'. - localRadius (object): The current setting for Local Authentication, a built-in RADIUS server on the access point. Only valid if authMode is '8021x-localradius'. @@ -2283,6 +2283,7 @@ 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.) @@ -2362,7 +2363,6 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): "Cisco ISE", "Click-through splash page", "Facebook Wi-Fi", - "Google Apps domain", "Google OAuth", "Microsoft Entra ID", "None", @@ -2435,6 +2435,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): "radiusAccountingInterimInterval", "radiusAttributeForGroupPolicies", "ipAssignmentMode", + "campusGateway", "useVlanTagging", "concentratorNetworkId", "secondaryConcentratorNetworkId", @@ -3379,6 +3380,63 @@ def updateNetworkWirelessZigbee(self, networkId: str, **kwargs): return self._session.put(metadata, resource, payload) + def getOrganizationAssuranceImpactedDeviceWirelessByNetwork( + 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 + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get 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. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should 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", "impactedDevice", "byNetwork"], + "operation": "getOrganizationAssuranceImpactedDeviceWirelessByNetwork", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/assurance/impactedDevice/wireless/byNetwork" + + query_params = [ + "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 = [ + "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"getOrganizationAssuranceImpactedDeviceWirelessByNetwork: 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** @@ -3479,6 +3537,66 @@ def getOrganizationWirelessAirMarshalSettingsByNetwork( 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** @@ -3534,6 +3652,224 @@ def getOrganizationWirelessClientsOverviewByDevice(self, organizationId: str, to 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 getOrganizationWirelessDevicesChannelUtilizationByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): @@ -5177,6 +5513,421 @@ def getOrganizationWirelessSsidsOpenRoamingByNetwork(self, organizationId: str, return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationWirelessSsidsProfiles(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 + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get 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. + """ + + 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", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/ssids/profiles" + + query_params = [ + "name", + "sortBy", + "sortOrder", + "profileIds", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "profileIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for 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}" + ) + + return self._session.post(metadata, resource, payload) + + def getOrganizationWirelessSsidsProfilesAssignments(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 + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get 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. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "configure", "ssids", "profiles", "assignments"], + "operation": "getOrganizationWirelessSsidsProfilesAssignments", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/ssids/profiles/assignments" + + query_params = [ + "networkIds", + "ssidIds", + "profileIds", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "ssidIds", + "profileIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for 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}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + 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()) + + metadata = { + "tags": ["wireless", "configure", "ssids", "profiles", "assignments"], + "operation": "createOrganizationWirelessSsidsProfilesAssignment", + } + 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} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for 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}" + ) + + return self._session.post(metadata, resource, payload) + + 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()) + + metadata = { + "tags": ["wireless", "configure", "ssids", "profiles", "assignments"], + "operation": "deleteOrganizationWirelessSsidsProfilesAssignments", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/ssids/profiles/assignments" + + return self._session.delete(metadata, resource) + + def getOrganizationWirelessSsidsProfilesAssignmentsByNetwork( + self, organizationId: str, total_pages=1, direction="next", **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 + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get 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. + """ + + 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", + } + 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} + + array_params = [ + "networkIds", + "profileIds", + "networkGroupIds", + "excludeProfileIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for 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}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationWirelessSsidsProfilesOverviews(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 + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get 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. + """ + + 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", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/ssids/profiles/overviews" + + query_params = [ + "name", + "sortBy", + "sortOrder", + "profileIds", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "profileIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for 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}" + ) + + 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/pyproject.toml b/pyproject.toml index fa88ea59..8917b141 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "meraki" -version = "4.3.1" +version = "4.4.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 ca99b27a..a5681f9c 100644 --- a/uv.lock +++ b/uv.lock @@ -363,7 +363,7 @@ wheels = [ [[package]] name = "meraki" -version = "4.3.1" +version = "4.4.0" source = { editable = "." } dependencies = [ { name = "httpx" },