diff --git a/docs/generation-report.md b/docs/generation-report.md index c1572f7..0237561 100644 --- a/docs/generation-report.md +++ b/docs/generation-report.md @@ -1,5 +1,11 @@ # Generation Report +## 2026-11-04 | Library v4.8.0 | API 1.76.0 + + +No Python keyword parameter conflicts detected. + + ## 2026-10-17 | Library v4.7.0 | API 1.75.1 diff --git a/meraki/__init__.py b/meraki/__init__.py index 072f72b..c08d02e 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.75.1" +__api_version__ = "1.76.0" __all__ = [ "APIError", diff --git a/meraki/_version.py b/meraki/_version.py index 8355eb4..ea674c5 100644 --- a/meraki/_version.py +++ b/meraki/_version.py @@ -1 +1 @@ -__version__ = "4.7.0" +__version__ = "4.8.0" diff --git a/meraki/aio/api/appliance.py b/meraki/aio/api/appliance.py index d003403..dc1d14f 100644 --- a/meraki/aio/api/appliance.py +++ b/meraki/aio/api/appliance.py @@ -2519,6 +2519,7 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw - networkId (string): Network ID - custom (array): Custom VPN exclusion rules. Pass an empty array to clear existing rules. - majorApplications (array): Major Application based VPN exclusion rules. Pass an empty array to clear existing rules. + - applicationCategoryMapping (object): Options for mapping configured majorApplications to application categories. """ kwargs.update(locals()) @@ -2533,6 +2534,7 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw body_params = [ "custom", "majorApplications", + "applicationCategoryMapping", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -3147,7 +3149,7 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): def getNetworkApplianceVpnSiteToSiteVpn(self, networkId: str): """ - **Return the site-to-site VPN settings of a network** + **Return the site-to-site VPN settings of an MX network or configuration template.** https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-vpn-site-to-site-vpn - networkId (string): Network ID @@ -3164,13 +3166,15 @@ def getNetworkApplianceVpnSiteToSiteVpn(self, networkId: str): def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kwargs): """ - **Update the site-to-site VPN settings of a network** + **Update the site-to-site VPN settings of an MX network or configuration template in NAT mode** https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-vpn-site-to-site-vpn - networkId (string): Network ID - mode (string): The site-to-site VPN mode. Can be one of 'none', 'spoke' or 'hub' + - confirmed (boolean): Whether to accept the confirmation warnings for these changes. Defaults to true, which accepts confirmation warnings and preserves the existing update behavior. Set to false to opt in to confirmation warnings. Review the warnings returned in confirmations, then retry with confirmed: true to accept them. Fatal errors must be corrected before retrying. + - natTraversal (object): NAT traversal settings. Omit to leave the existing setting unchanged. - hubs (array): The list of VPN hubs, in order of preference. In spoke mode, at least 1 hub is required. - - subnets (array): The list of subnets and their VPN presence. + - subnets (array): The list of local VPN subnets and their VPN presence. VLAN entries include vlanId and subnetting where applicable. When the corresponding NFO is enabled, NAT settings are returned for every VLAN; non-VLAN entries omit vlanId, subnetting, and nat.legacy. - sgt (object): Security Group Tag settings for the VPN peer. - subnet (object): Configuration of subnet features - hostTranslations (array): The list of VPN host translations. Host translations are supported starting from MX firmware version 26.1.2 @@ -3190,7 +3194,9 @@ def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kw resource = f"/networks/{networkId}/appliance/vpn/siteToSiteVpn" body_params = [ + "confirmed", "mode", + "natTraversal", "hubs", "subnets", "sgt", @@ -5674,7 +5680,7 @@ def getOrganizationApplianceVpnStatuses(self, organizationId: str, total_pages=1 def getOrganizationApplianceVpnThirdPartyVPNPeers(self, organizationId: str): """ - **Return the third party VPN peers for an organization** + **Return the configured third-party VPN peers for an organization.** https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vpn-third-party-v-p-n-peers - organizationId (string): Organization ID diff --git a/meraki/aio/api/devices.py b/meraki/aio/api/devices.py index baaaf51..6968341 100644 --- a/meraki/aio/api/devices.py +++ b/meraki/aio/api/devices.py @@ -232,6 +232,56 @@ def createDeviceCellularUplinksBandsMasksUpdate(self, serial: str, slot: str, ty return self._session.post(metadata, resource, payload) + def revokeDeviceCertificate(self, serial: str, certificateSerial: str, **kwargs): + """ + **Revoke a device certificate** + https://developer.cisco.com/meraki/api-v1/#!revoke-device-certificate + + - serial (string): Serial + - certificateSerial (string): Certificate serial + - reason (string): Revocation reason per RFC 5280; omit to use `unspecified` + """ + + kwargs.update(locals()) + + if "reason" in kwargs: + options = [ + "aACompromise", + "affiliationChanged", + "cACompromise", + "certificateHold", + "cessationOfOperation", + "keyCompromise", + "privilegeWithdrawn", + "removeFromCRL", + "superseded", + "unspecified", + ] + assert kwargs["reason"] in options, ( + f'''"reason" cannot be "{kwargs["reason"]}", & must be set to one of: {options}''' + ) + + metadata = { + "tags": ["devices", "configure", "certificates"], + "operation": "revokeDeviceCertificate", + } + serial = urllib.parse.quote(str(serial), safe="") + certificateSerial = urllib.parse.quote(str(certificateSerial), safe="") + resource = f"/devices/{serial}/certificates/{certificateSerial}/revoke" + + body_params = [ + "reason", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"revokeDeviceCertificate: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) + def getDeviceClients(self, serial: str, **kwargs): """ **List the clients of a device, up to a maximum of a month ago** @@ -781,6 +831,68 @@ def getDeviceLiveToolsPowerUsage(self, serial: str, jobId: str): return self._session.get(metadata, resource) + def createDeviceLiveToolsRouteDetail(self, serial: str, type: str, vrf: dict, destination: dict, nextHop: dict, **kwargs): + """ + **Enqueue a live tool job to fetch route details from a device.** + https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-route-detail + + - serial (string): Serial + - type (string): The type of the route provided. The only supported value for now is 'BGP'. + - vrf (object): The route VRF to inspect. + - destination (object): The destination of the route provided + - nextHop (object): The next-hop-IP of the route provided. + - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret + """ + + kwargs.update(locals()) + + if "type" in kwargs: + options = ["BGP"] + assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["devices", "liveTools", "route", "details"], + "operation": "createDeviceLiveToolsRouteDetail", + } + serial = urllib.parse.quote(str(serial), safe="") + resource = f"/devices/{serial}/liveTools/route/details" + + body_params = [ + "type", + "vrf", + "destination", + "nextHop", + "callback", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"createDeviceLiveToolsRouteDetail: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) + + def getDeviceLiveToolsRouteDetail(self, serial: str, jobId: str): + """ + **Return a route details live tool job for a device.** + https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-route-detail + + - serial (string): Serial + - jobId (string): Job ID + """ + + metadata = { + "tags": ["devices", "liveTools", "route", "details"], + "operation": "getDeviceLiveToolsRouteDetail", + } + serial = urllib.parse.quote(str(serial), safe="") + jobId = urllib.parse.quote(str(jobId), safe="") + resource = f"/devices/{serial}/liveTools/route/details/{jobId}" + + return self._session.get(metadata, resource) + def createDeviceLiveToolsRoutingTableLookup(self, serial: str, **kwargs): """ **Enqueue a job to perform a routing table lookup request for a device** diff --git a/meraki/aio/api/organizations.py b/meraki/aio/api/organizations.py index 66c9f33..5d1f48a 100644 --- a/meraki/aio/api/organizations.py +++ b/meraki/aio/api/organizations.py @@ -180,17 +180,28 @@ def createOrganizationActionBatch(self, organizationId: str, actions: list, **kw return self._session.post(metadata, resource, payload) - def getOrganizationActionBatches(self, organizationId: str, **kwargs): + def getOrganizationActionBatches(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Return the list of action batches in the organization** https://developer.cisco.com/meraki/api-v1/#!get-organization-action-batches - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get 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. + - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'ascending'. - status (string): Filter batches by status. Valid types are pending, completed, and failed. """ kwargs.update(locals()) + if "sortOrder" in kwargs: + options = ["ascending", "descending"] + assert kwargs["sortOrder"] in options, ( + f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' + ) if "status" in kwargs: options = ["completed", "failed", "pending"] assert kwargs["status"] in options, ( @@ -205,6 +216,10 @@ def getOrganizationActionBatches(self, organizationId: str, **kwargs): resource = f"/organizations/{organizationId}/actionBatches" query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "sortOrder", "status", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} @@ -215,7 +230,7 @@ def getOrganizationActionBatches(self, organizationId: str, **kwargs): if invalid and self._session._logger: self._session._logger.warning(f"getOrganizationActionBatches: ignoring unrecognized kwargs: {invalid}") - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) def getOrganizationActionBatch(self, organizationId: str, actionBatchId: str): """ @@ -2286,6 +2301,245 @@ def deleteOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId return self._session.delete(metadata, resource) + def getOrganizationCertificatesAuthorities(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **List certificate authorities for an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates-authorities + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - authorityIds (array): Feature certificate authority IDs to filter by (exact match on each id; duplicates are ignored) + - sortBy (string): Field to sort by (default: authorityId) + - includeChain (boolean): When true, include the certification path from each certificate authority up to the self signed root. Required by validators that cannot anchor trust at a non self signed certificate authority. Defaults to false. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + if "sortBy" in kwargs: + options = ["authorityId", "featureType", "status"] + assert kwargs["sortBy"] in options, ( + f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' + ) + + metadata = { + "tags": ["organizations", "configure", "certificates", "authorities"], + "operation": "getOrganizationCertificatesAuthorities", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities" + + query_params = [ + "authorityIds", + "sortBy", + "includeChain", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "authorityIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def createOrganizationCertificatesAuthority(self, organizationId: str, featureType: str, **kwargs): + """ + **Create a certificate authority for an organization** + https://developer.cisco.com/meraki/api-v1/#!create-organization-certificates-authority + + - organizationId (string): Organization ID + - featureType (string): Feature this CA serves (e.g., radsec, openroaming, zigbee) + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "certificates", "authorities"], + "operation": "createOrganizationCertificatesAuthority", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities" + + body_params = [ + "featureType", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"createOrganizationCertificatesAuthority: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def updateOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, **kwargs): + """ + **Trust a newly created certificate authority (transition from untrusted to trusted).** + https://developer.cisco.com/meraki/api-v1/#!update-organization-certificates-authorities + + - organizationId (string): Organization ID + - authorityId (string): ID of the certificate authority to trust. The CA must currently be untrusted. + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "certificates", "authorities"], + "operation": "updateOrganizationCertificatesAuthorities", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities" + + body_params = [ + "authorityId", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"updateOrganizationCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def deleteOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, name: str): + """ + **Delete a certificate authority** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-certificates-authorities + + - organizationId (string): Organization ID + - authorityId (string): ID of the certificate authority to delete + - name (string): Certificate authority name + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "certificates", "authorities"], + "operation": "deleteOrganizationCertificatesAuthorities", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities" + + return self._session.delete(metadata, resource) + + def getOrganizationCertificatesAuthoritiesJob(self, organizationId: str, jobId: str): + """ + **Return the status and result of a certificate authority job.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates-authorities-job + + - organizationId (string): Organization ID + - jobId (string): Job ID + """ + + metadata = { + "tags": ["organizations", "configure", "certificates", "authorities", "jobs"], + "operation": "getOrganizationCertificatesAuthoritiesJob", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + jobId = urllib.parse.quote(str(jobId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities/jobs/{jobId}" + + return self._session.get(metadata, resource) + + def revokeOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, **kwargs): + """ + **Revoke a trusted feature certificate authority.** + https://developer.cisco.com/meraki/api-v1/#!revoke-organization-certificates-authorities + + - organizationId (string): Organization ID + - authorityId (string): ID of the feature certificate authority to revoke + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "certificates", "authorities"], + "operation": "revokeOrganizationCertificatesAuthorities", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities/revoke" + + body_params = [ + "authorityId", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"revokeOrganizationCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def getOrganizationCertificatesRevocationLists(self, organizationId: str, **kwargs): + """ + **Return full certificate revocation lists (CRLs) for the organization's certificate authorities** + https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates-revocation-lists + + - organizationId (string): Organization ID + - certificateAuthorityIds (array): Optional filter: feature certificate authority IDs (base-10 integers). Every value must exist for this organization; otherwise the request fails. Omit to return CRLs for all feature CAs in the organization. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "certificates", "revocationLists"], + "operation": "getOrganizationCertificatesRevocationLists", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/revocationLists" + + query_params = [ + "certificateAuthorityIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "certificateAuthorityIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationCertificatesRevocationLists: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + def claimIntoOrganization(self, organizationId: str, **kwargs): """ **Claim a list of devices, licenses, and/or orders into an organization inventory** @@ -3460,6 +3714,64 @@ def getOrganizationDevicesCellularUplinksTowersByDevice( return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationDevicesCertificates(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **List device certificates for the organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-certificates + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - serials (array): Device serial numbers to filter by (exact match; duplicates are ignored) + - featureTypes (array): Feature types these device certificates serve (exact match; e.g., radsec, openroaming, zigbee) + - sortBy (string): Field to sort by (default: authorityId) + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + if "sortBy" in kwargs: + options = ["authorityId", "featureType", "status"] + assert kwargs["sortBy"] in options, ( + f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' + ) + + metadata = { + "tags": ["organizations", "configure", "devices", "certificates"], + "operation": "getOrganizationDevicesCertificates", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/devices/certificates" + + query_params = [ + "serials", + "featureTypes", + "sortBy", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "serials", + "featureTypes", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"getOrganizationDevicesCertificates: ignoring unrecognized kwargs: {invalid}") + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def createOrganizationDevicesControllerMigration(self, organizationId: str, serials: list, target: str, **kwargs): """ **Migrate devices to another controller or management mode** diff --git a/meraki/aio/api/switch.py b/meraki/aio/api/switch.py index 2d31ddf..fa7458b 100644 --- a/meraki/aio/api/switch.py +++ b/meraki/aio/api/switch.py @@ -2160,6 +2160,7 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): - powerExceptions (array): Exceptions on a per switch basis to "useCombinedPower" - uplinkClientSampling (object): Uplink client sampling - macBlocklist (object): MAC blocklist + - clientTracking (object): Client tracking settings. - portChannelFallback (boolean): Port channel fallback - uplinkSelection (object): Settings related to uplink selection on IOS-XE switches. """ @@ -2179,6 +2180,7 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): "powerExceptions", "uplinkClientSampling", "macBlocklist", + "clientTracking", "portChannelFallback", "uplinkSelection", ] diff --git a/meraki/aio/api/wireless.py b/meraki/aio/api/wireless.py index 4eb6e14..1e9a0ed 100644 --- a/meraki/aio/api/wireless.py +++ b/meraki/aio/api/wireless.py @@ -514,7 +514,7 @@ def updateNetworkWirelessAirMarshalRule(self, networkId: str, ruleId: str, **kwa def deleteNetworkWirelessAirMarshalRule(self, networkId: str, ruleId: str): """ - **Delete an Air Marshal rule.** + **Delete an Air Marshal rule** https://developer.cisco.com/meraki/api-v1/#!delete-network-wireless-air-marshal-rule - networkId (string): Network ID @@ -531,16 +531,16 @@ def deleteNetworkWirelessAirMarshalRule(self, networkId: str, ruleId: str): return self._session.delete(metadata, resource) - def updateNetworkWirelessAirMarshalSettings(self, networkId: str, defaultPolicy: str, **kwargs): + def updateNetworkWirelessAirMarshalSettings(self, networkId: str, **kwargs): """ - **Updates Air Marshal settings.** + **Updates Air Marshal settings** https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-air-marshal-settings - networkId (string): Network ID - defaultPolicy (string): Allows clients to access rogue networks. Blocked by default. """ - kwargs = locals() + kwargs.update(locals()) if "defaultPolicy" in kwargs: options = ["allow", "block"] @@ -2345,6 +2345,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 + - dot11k (object): The current setting for 802.11k - 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'. @@ -2355,7 +2356,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - radiusProxyEnabled (boolean): If true, Meraki devices will proxy RADIUS messages through the Meraki cloud to the configured RADIUS auth and accounting servers. - radiusTestingEnabled (boolean): If true, Meraki devices will periodically send Access-Request messages to configured RADIUS servers using identity 'meraki_8021x_test' to ensure that the RADIUS servers are reachable. - radiusCalledStationId (string): The template of the called station identifier to be used for RADIUS (ex. $NODE_MAC$:$VAP_NUM$). - - radiusAuthenticationNasId (string): The NAS identifier to use for RADIUS authentication. With 802.11r enabled or adaptive, custom text is available only to organizations enabled for this feature; otherwise, use only $NODE_MAC$, $VAP_NUM$, and $VAP_NAME$. When this feature is enabled, the complete rendered NAS identifier must be 1–48 bytes. + - radiusAuthenticationNasId (string): The NAS identifier to use for RADIUS authentication. With 802.11r enabled or adaptive, use $NODE_MAC$, $VAP_NUM$, $VAP_NAME$, and/or custom text. The complete rendered NAS identifier must be 1–48 bytes. - radiusServerTimeout (integer): The amount of time for which a RADIUS client waits for a reply from the RADIUS server (must be between 1-10 seconds). - radiusServerAttemptsLimit (integer): The maximum number of transmit attempts after which a RADIUS server is failed over (must be between 1-5). - radiusFallbackEnabled (boolean): Whether or not higher priority RADIUS servers should be retried after 60 seconds. @@ -2497,6 +2498,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): "wpaEncryptionMode", "dot11w", "dot11r", + "dot11k", "splashPage", "splashGuestSponsorDomains", "oauth", @@ -3574,6 +3576,72 @@ def getOrganizationAssuranceImpactedDeviceWirelessByNetwork( return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationAssuranceWirelessExperienceSuccessfulConnectionsByNetwork( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **Summarize wireless connection counts by network** + https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connections-by-network + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - networkIds (array): Filter results by network. + - serials (array): Filter results by device serial. + - ssidNumbers (array): Filter results by SSID number. Valid values are 0-14. + - bands (array): Filter results by wireless band in GHz (2.4, 5, or 6). + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 100. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "monitor", "experience", "successfulConnections", "byNetwork"], + "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectionsByNetwork", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnections/byNetwork" + + query_params = [ + "networkIds", + "serials", + "ssidNumbers", + "bands", + "t0", + "t1", + "timespan", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "serials", + "ssidNumbers", + "bands", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectionsByNetwork: 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** @@ -4257,7 +4325,7 @@ def getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval( def getOrganizationWirelessDevicesEthernetStatuses(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **List the most recent Ethernet link speed, duplex, aggregation and power mode and status information for wireless devices** + **List the most recent Ethernet link speed, duplex, aggregation and power mode and status information for wireless devices.** https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-ethernet-statuses - organizationId (string): Organization ID diff --git a/meraki/api/appliance.py b/meraki/api/appliance.py index c9df03b..20fac6b 100644 --- a/meraki/api/appliance.py +++ b/meraki/api/appliance.py @@ -2519,6 +2519,7 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw - networkId (string): Network ID - custom (array): Custom VPN exclusion rules. Pass an empty array to clear existing rules. - majorApplications (array): Major Application based VPN exclusion rules. Pass an empty array to clear existing rules. + - applicationCategoryMapping (object): Options for mapping configured majorApplications to application categories. """ kwargs.update(locals()) @@ -2533,6 +2534,7 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw body_params = [ "custom", "majorApplications", + "applicationCategoryMapping", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -3147,7 +3149,7 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): def getNetworkApplianceVpnSiteToSiteVpn(self, networkId: str): """ - **Return the site-to-site VPN settings of a network** + **Return the site-to-site VPN settings of an MX network or configuration template.** https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-vpn-site-to-site-vpn - networkId (string): Network ID @@ -3164,13 +3166,15 @@ def getNetworkApplianceVpnSiteToSiteVpn(self, networkId: str): def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kwargs): """ - **Update the site-to-site VPN settings of a network** + **Update the site-to-site VPN settings of an MX network or configuration template in NAT mode** https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-vpn-site-to-site-vpn - networkId (string): Network ID - mode (string): The site-to-site VPN mode. Can be one of 'none', 'spoke' or 'hub' + - confirmed (boolean): Whether to accept the confirmation warnings for these changes. Defaults to true, which accepts confirmation warnings and preserves the existing update behavior. Set to false to opt in to confirmation warnings. Review the warnings returned in confirmations, then retry with confirmed: true to accept them. Fatal errors must be corrected before retrying. + - natTraversal (object): NAT traversal settings. Omit to leave the existing setting unchanged. - hubs (array): The list of VPN hubs, in order of preference. In spoke mode, at least 1 hub is required. - - subnets (array): The list of subnets and their VPN presence. + - subnets (array): The list of local VPN subnets and their VPN presence. VLAN entries include vlanId and subnetting where applicable. When the corresponding NFO is enabled, NAT settings are returned for every VLAN; non-VLAN entries omit vlanId, subnetting, and nat.legacy. - sgt (object): Security Group Tag settings for the VPN peer. - subnet (object): Configuration of subnet features - hostTranslations (array): The list of VPN host translations. Host translations are supported starting from MX firmware version 26.1.2 @@ -3190,7 +3194,9 @@ def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kw resource = f"/networks/{networkId}/appliance/vpn/siteToSiteVpn" body_params = [ + "confirmed", "mode", + "natTraversal", "hubs", "subnets", "sgt", @@ -5674,7 +5680,7 @@ def getOrganizationApplianceVpnStatuses(self, organizationId: str, total_pages=1 def getOrganizationApplianceVpnThirdPartyVPNPeers(self, organizationId: str): """ - **Return the third party VPN peers for an organization** + **Return the configured third-party VPN peers for an organization.** https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-vpn-third-party-v-p-n-peers - organizationId (string): Organization ID diff --git a/meraki/api/batch/appliance.py b/meraki/api/batch/appliance.py index 4f3ba1a..285313a 100644 --- a/meraki/api/batch/appliance.py +++ b/meraki/api/batch/appliance.py @@ -273,6 +273,31 @@ def updateNetworkApplianceFirewallMulticastForwarding(self, networkId: str, rule } return action + def updateNetworkApplianceFirewallSettings(self, networkId: str, **kwargs): + """ + **Update the firewall settings for this network** + https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-firewall-settings + + - networkId (string): Network ID + - spoofingProtection (object): Spoofing protection settings + """ + + kwargs.update(locals()) + + networkId = urllib.parse.quote(str(networkId), safe="") + resource = f"/networks/{networkId}/appliance/firewall/settings" + + body_params = [ + "spoofingProtection", + ] + 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 createNetworkApplianceInterfacesL3(self, networkId: str, ipv4: dict, **kwargs): """ **Create wired L3 interface** @@ -920,6 +945,7 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw - networkId (string): Network ID - custom (array): Custom VPN exclusion rules. Pass an empty array to clear existing rules. - majorApplications (array): Major Application based VPN exclusion rules. Pass an empty array to clear existing rules. + - applicationCategoryMapping (object): Options for mapping configured majorApplications to application categories. """ kwargs.update(locals()) @@ -930,6 +956,7 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw body_params = [ "custom", "majorApplications", + "applicationCategoryMapping", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -1076,7 +1103,7 @@ def updateNetworkApplianceUplinksNat(self, networkId: str, uplinks: list, **kwar payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, - "operation": "settings", + "operation": "update", "body": payload, } return action @@ -1340,13 +1367,15 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kwargs): """ - **Update the site-to-site VPN settings of a network. Only valid for MX networks in NAT mode.** + **Update the site-to-site VPN settings of an MX network or configuration template in NAT mode. Unacknowledged warnings return 400 Bad Request with retry guidance in errors and the warnings in confirmations. Review the warnings returned in confirmations, then retry with confirmed: true to accept them. Fatal errors must be corrected before retrying.** https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-vpn-site-to-site-vpn - networkId (string): Network ID - mode (string): The site-to-site VPN mode. Can be one of 'none', 'spoke' or 'hub' + - confirmed (boolean): Whether to accept the confirmation warnings for these changes. Defaults to true, which accepts confirmation warnings and preserves the existing update behavior. Set to false to opt in to confirmation warnings. Review the warnings returned in confirmations, then retry with confirmed: true to accept them. Fatal errors must be corrected before retrying. + - natTraversal (object): NAT traversal settings. Omit to leave the existing setting unchanged. - hubs (array): The list of VPN hubs, in order of preference. In spoke mode, at least 1 hub is required. - - subnets (array): The list of subnets and their VPN presence. + - subnets (array): The list of local VPN subnets and their VPN presence. VLAN entries include vlanId and subnetting where applicable. When the corresponding NFO is enabled, NAT settings are returned for every VLAN; non-VLAN entries omit vlanId, subnetting, and nat.legacy. - sgt (object): Security Group Tag settings for the VPN peer. - subnet (object): Configuration of subnet features - hostTranslations (array): The list of VPN host translations. Host translations are supported starting from MX firmware version 26.1.2 @@ -1362,7 +1391,9 @@ def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kw resource = f"/networks/{networkId}/appliance/vpn/siteToSiteVpn" body_params = [ + "confirmed", "mode", + "natTraversal", "hubs", "subnets", "sgt", diff --git a/meraki/api/batch/devices.py b/meraki/api/batch/devices.py index b20158e..56dd3df 100644 --- a/meraki/api/batch/devices.py +++ b/meraki/api/batch/devices.py @@ -107,6 +107,50 @@ def createDeviceCellularUplinksBandsMasksUpdate(self, serial: str, slot: str, ty } return action + def revokeDeviceCertificate(self, serial: str, certificateSerial: str, **kwargs): + """ + **Revoke a device certificate. The device and certificate are identified by the path parameters. You may supply a revocation reason in the request body; if omitted, a default reason is applied.** + https://developer.cisco.com/meraki/api-v1/#!revoke-device-certificate + + - serial (string): Serial + - certificateSerial (string): Certificate serial + - reason (string): Revocation reason per RFC 5280; omit to use `unspecified` + """ + + kwargs.update(locals()) + + if "reason" in kwargs: + options = [ + "aACompromise", + "affiliationChanged", + "cACompromise", + "certificateHold", + "cessationOfOperation", + "keyCompromise", + "privilegeWithdrawn", + "removeFromCRL", + "superseded", + "unspecified", + ] + assert kwargs["reason"] in options, ( + f'''"reason" cannot be "{kwargs["reason"]}", & must be set to one of: {options}''' + ) + + serial = urllib.parse.quote(str(serial), safe="") + certificateSerial = urllib.parse.quote(str(certificateSerial), safe="") + resource = f"/devices/{serial}/certificates/{certificateSerial}/revoke" + + body_params = [ + "reason", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "revoke", + "body": payload, + } + return action + def createDeviceLiveToolsLedsBlink(self, serial: str, duration: int, **kwargs): """ **Enqueue a job to blink LEDs on a device. This endpoint has a rate limit of one request every 10 seconds.** @@ -184,6 +228,43 @@ def createDeviceLiveToolsPowerUsage(self, serial: str, **kwargs): } return action + def createDeviceLiveToolsRouteDetail(self, serial: str, type: str, vrf: dict, destination: dict, nextHop: dict, **kwargs): + """ + **Enqueue a live tool job to fetch route details from a device.** + https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-route-detail + + - serial (string): Serial + - type (string): The type of the route provided. The only supported value for now is 'BGP'. + - vrf (object): The route VRF to inspect. + - destination (object): The destination of the route provided + - nextHop (object): The next-hop-IP of the route provided. + - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret + """ + + kwargs.update(locals()) + + if "type" in kwargs: + options = ["BGP"] + assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' + + serial = urllib.parse.quote(str(serial), safe="") + resource = f"/devices/{serial}/liveTools/route/details" + + body_params = [ + "type", + "vrf", + "destination", + "nextHop", + "callback", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "details", + "body": payload, + } + return action + def createDeviceLiveToolsRoutingTableLookup(self, serial: str, **kwargs): """ **Enqueue a job to perform a routing table lookup request for a device. The routing table lookup request fetches a specific set of routes based on filters. Any combination of search filters can be applied. Only Cisco Secure Routers are supported.** diff --git a/meraki/api/batch/organizations.py b/meraki/api/batch/organizations.py index aed6f78..8fc5255 100644 --- a/meraki/api/batch/organizations.py +++ b/meraki/api/batch/organizations.py @@ -667,6 +667,102 @@ def deleteOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId } return action + def createOrganizationCertificatesAuthority(self, organizationId: str, featureType: str, **kwargs): + """ + **Create a certificate authority for an organization. The response includes job information for tracking progress.** + https://developer.cisco.com/meraki/api-v1/#!create-organization-certificates-authority + + - organizationId (string): Organization ID + - featureType (string): Feature this CA serves (e.g., radsec, openroaming, zigbee) + """ + + kwargs = locals() + + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities" + + body_params = [ + "featureType", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "create", + "body": payload, + } + return action + + def updateOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, **kwargs): + """ + **Trust a newly created certificate authority (transition from untrusted to trusted).** + https://developer.cisco.com/meraki/api-v1/#!update-organization-certificates-authorities + + - organizationId (string): Organization ID + - authorityId (string): ID of the certificate authority to trust. The CA must currently be untrusted. + """ + + kwargs = locals() + + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities" + + body_params = [ + "authorityId", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "update", + "body": payload, + } + return action + + def deleteOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, name: str): + """ + **Delete a certificate authority. The feature CA must be untrusted or revoked. Deletion takes effect immediately and the response confirms the deleted authority.** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-certificates-authorities + + - organizationId (string): Organization ID + - authorityId (string): ID of the certificate authority to delete + - name (string): Certificate authority name + """ + + kwargs = locals() + + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities" + + action = { + "resource": resource, + "operation": "delete", + } + return action + + def revokeOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, **kwargs): + """ + **Revoke a trusted feature certificate authority.** + https://developer.cisco.com/meraki/api-v1/#!revoke-organization-certificates-authorities + + - organizationId (string): Organization ID + - authorityId (string): ID of the feature certificate authority to revoke + """ + + kwargs = locals() + + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities/revoke" + + body_params = [ + "authorityId", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "revoke", + "body": payload, + } + return action + def createOrganizationConfigTemplate(self, organizationId: str, name: str, **kwargs): """ **Create a new configuration template** diff --git a/meraki/api/batch/switch.py b/meraki/api/batch/switch.py index eb8d57a..de85b19 100644 --- a/meraki/api/batch/switch.py +++ b/meraki/api/batch/switch.py @@ -1290,6 +1290,7 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): - powerExceptions (array): Exceptions on a per switch basis to "useCombinedPower" - uplinkClientSampling (object): Uplink client sampling - macBlocklist (object): MAC blocklist + - clientTracking (object): Client tracking settings. - portChannelFallback (boolean): Port channel fallback - uplinkSelection (object): Settings related to uplink selection on IOS-XE switches. """ @@ -1305,6 +1306,7 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): "powerExceptions", "uplinkClientSampling", "macBlocklist", + "clientTracking", "portChannelFallback", "uplinkSelection", ] diff --git a/meraki/api/batch/wireless.py b/meraki/api/batch/wireless.py index 40a9efc..d0b8ae6 100644 --- a/meraki/api/batch/wireless.py +++ b/meraki/api/batch/wireless.py @@ -147,7 +147,7 @@ def updateDeviceWirelessRadioSettings(self, serial: str, **kwargs): def createNetworkWirelessAirMarshalRule(self, networkId: str, type: str, match: dict, **kwargs): """ - **Creates a new rule** + **Creates a new rule. In an action batch, mutations execute in the submitted order and commit atomically; a failure rolls back every mutation and configuration update in that batch. Completed or failed batches cannot be executed again. Air Marshal settings updates may be included in the same batch. The created rule ID is returned in the action batch createdResources list. A later action in the same batch cannot reference that generated ID.** https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-air-marshal-rule - networkId (string): Network ID @@ -178,7 +178,7 @@ def createNetworkWirelessAirMarshalRule(self, networkId: str, type: str, match: def updateNetworkWirelessAirMarshalRule(self, networkId: str, ruleId: str, **kwargs): """ - **Update a rule** + **Update a rule. In an action batch, mutations execute in the submitted order and commit atomically; a failure rolls back every mutation and configuration update in that batch. Completed or failed batches cannot be executed again. Air Marshal settings updates may be included in the same batch.** https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-air-marshal-rule - networkId (string): Network ID @@ -211,7 +211,7 @@ def updateNetworkWirelessAirMarshalRule(self, networkId: str, ruleId: str, **kwa def deleteNetworkWirelessAirMarshalRule(self, networkId: str, ruleId: str): """ - **Delete an Air Marshal rule.** + **Delete an Air Marshal rule. In an action batch, mutations execute in the submitted order and commit atomically; a failure rolls back every mutation and configuration update in that batch. Completed or failed batches cannot be executed again. Air Marshal settings updates may be included in the same batch.** https://developer.cisco.com/meraki/api-v1/#!delete-network-wireless-air-marshal-rule - networkId (string): Network ID @@ -228,16 +228,16 @@ def deleteNetworkWirelessAirMarshalRule(self, networkId: str, ruleId: str): } return action - def updateNetworkWirelessAirMarshalSettings(self, networkId: str, defaultPolicy: str, **kwargs): + def updateNetworkWirelessAirMarshalSettings(self, networkId: str, **kwargs): """ - **Updates Air Marshal settings.** + **Updates Air Marshal settings. Omitting an optional setting leaves its saved value unchanged.** https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-air-marshal-settings - networkId (string): Network ID - defaultPolicy (string): Allows clients to access rogue networks. Blocked by default. """ - kwargs = locals() + kwargs.update(locals()) if "defaultPolicy" in kwargs: options = ["allow", "block"] @@ -767,6 +767,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 + - dot11k (object): The current setting for 802.11k - 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'. @@ -777,7 +778,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - radiusProxyEnabled (boolean): If true, Meraki devices will proxy RADIUS messages through the Meraki cloud to the configured RADIUS auth and accounting servers. - radiusTestingEnabled (boolean): If true, Meraki devices will periodically send Access-Request messages to configured RADIUS servers using identity 'meraki_8021x_test' to ensure that the RADIUS servers are reachable. - radiusCalledStationId (string): The template of the called station identifier to be used for RADIUS (ex. $NODE_MAC$:$VAP_NUM$). - - radiusAuthenticationNasId (string): The NAS identifier to use for RADIUS authentication. With 802.11r enabled or adaptive, custom text is available only to organizations enabled for this feature; otherwise, use only $NODE_MAC$, $VAP_NUM$, and $VAP_NAME$. When this feature is enabled, the complete rendered NAS identifier must be 1–48 bytes. + - radiusAuthenticationNasId (string): The NAS identifier to use for RADIUS authentication. With 802.11r enabled or adaptive, use $NODE_MAC$, $VAP_NUM$, $VAP_NAME$, and/or custom text. The complete rendered NAS identifier must be 1–48 bytes. - radiusServerTimeout (integer): The amount of time for which a RADIUS client waits for a reply from the RADIUS server (must be between 1-10 seconds). - radiusServerAttemptsLimit (integer): The maximum number of transmit attempts after which a RADIUS server is failed over (must be between 1-5). - radiusFallbackEnabled (boolean): Whether or not higher priority RADIUS servers should be retried after 60 seconds. @@ -915,6 +916,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): "wpaEncryptionMode", "dot11w", "dot11r", + "dot11k", "splashPage", "splashGuestSponsorDomains", "oauth", diff --git a/meraki/api/devices.py b/meraki/api/devices.py index 1a0d6e2..b98aa80 100644 --- a/meraki/api/devices.py +++ b/meraki/api/devices.py @@ -232,6 +232,56 @@ def createDeviceCellularUplinksBandsMasksUpdate(self, serial: str, slot: str, ty return self._session.post(metadata, resource, payload) + def revokeDeviceCertificate(self, serial: str, certificateSerial: str, **kwargs): + """ + **Revoke a device certificate** + https://developer.cisco.com/meraki/api-v1/#!revoke-device-certificate + + - serial (string): Serial + - certificateSerial (string): Certificate serial + - reason (string): Revocation reason per RFC 5280; omit to use `unspecified` + """ + + kwargs.update(locals()) + + if "reason" in kwargs: + options = [ + "aACompromise", + "affiliationChanged", + "cACompromise", + "certificateHold", + "cessationOfOperation", + "keyCompromise", + "privilegeWithdrawn", + "removeFromCRL", + "superseded", + "unspecified", + ] + assert kwargs["reason"] in options, ( + f'''"reason" cannot be "{kwargs["reason"]}", & must be set to one of: {options}''' + ) + + metadata = { + "tags": ["devices", "configure", "certificates"], + "operation": "revokeDeviceCertificate", + } + serial = urllib.parse.quote(str(serial), safe="") + certificateSerial = urllib.parse.quote(str(certificateSerial), safe="") + resource = f"/devices/{serial}/certificates/{certificateSerial}/revoke" + + body_params = [ + "reason", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"revokeDeviceCertificate: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) + def getDeviceClients(self, serial: str, **kwargs): """ **List the clients of a device, up to a maximum of a month ago** @@ -781,6 +831,68 @@ def getDeviceLiveToolsPowerUsage(self, serial: str, jobId: str): return self._session.get(metadata, resource) + def createDeviceLiveToolsRouteDetail(self, serial: str, type: str, vrf: dict, destination: dict, nextHop: dict, **kwargs): + """ + **Enqueue a live tool job to fetch route details from a device.** + https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-route-detail + + - serial (string): Serial + - type (string): The type of the route provided. The only supported value for now is 'BGP'. + - vrf (object): The route VRF to inspect. + - destination (object): The destination of the route provided + - nextHop (object): The next-hop-IP of the route provided. + - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret + """ + + kwargs.update(locals()) + + if "type" in kwargs: + options = ["BGP"] + assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["devices", "liveTools", "route", "details"], + "operation": "createDeviceLiveToolsRouteDetail", + } + serial = urllib.parse.quote(str(serial), safe="") + resource = f"/devices/{serial}/liveTools/route/details" + + body_params = [ + "type", + "vrf", + "destination", + "nextHop", + "callback", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"createDeviceLiveToolsRouteDetail: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) + + def getDeviceLiveToolsRouteDetail(self, serial: str, jobId: str): + """ + **Return a route details live tool job for a device.** + https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-route-detail + + - serial (string): Serial + - jobId (string): Job ID + """ + + metadata = { + "tags": ["devices", "liveTools", "route", "details"], + "operation": "getDeviceLiveToolsRouteDetail", + } + serial = urllib.parse.quote(str(serial), safe="") + jobId = urllib.parse.quote(str(jobId), safe="") + resource = f"/devices/{serial}/liveTools/route/details/{jobId}" + + return self._session.get(metadata, resource) + def createDeviceLiveToolsRoutingTableLookup(self, serial: str, **kwargs): """ **Enqueue a job to perform a routing table lookup request for a device** diff --git a/meraki/api/organizations.py b/meraki/api/organizations.py index 3e853d3..ba53091 100644 --- a/meraki/api/organizations.py +++ b/meraki/api/organizations.py @@ -180,17 +180,28 @@ def createOrganizationActionBatch(self, organizationId: str, actions: list, **kw return self._session.post(metadata, resource, payload) - def getOrganizationActionBatches(self, organizationId: str, **kwargs): + def getOrganizationActionBatches(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Return the list of action batches in the organization** https://developer.cisco.com/meraki/api-v1/#!get-organization-action-batches - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get 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. + - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'ascending'. - status (string): Filter batches by status. Valid types are pending, completed, and failed. """ kwargs.update(locals()) + if "sortOrder" in kwargs: + options = ["ascending", "descending"] + assert kwargs["sortOrder"] in options, ( + f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' + ) if "status" in kwargs: options = ["completed", "failed", "pending"] assert kwargs["status"] in options, ( @@ -205,6 +216,10 @@ def getOrganizationActionBatches(self, organizationId: str, **kwargs): resource = f"/organizations/{organizationId}/actionBatches" query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "sortOrder", "status", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} @@ -215,7 +230,7 @@ def getOrganizationActionBatches(self, organizationId: str, **kwargs): if invalid and self._session._logger: self._session._logger.warning(f"getOrganizationActionBatches: ignoring unrecognized kwargs: {invalid}") - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) def getOrganizationActionBatch(self, organizationId: str, actionBatchId: str): """ @@ -2286,6 +2301,245 @@ def deleteOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId return self._session.delete(metadata, resource) + def getOrganizationCertificatesAuthorities(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **List certificate authorities for an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates-authorities + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - authorityIds (array): Feature certificate authority IDs to filter by (exact match on each id; duplicates are ignored) + - sortBy (string): Field to sort by (default: authorityId) + - includeChain (boolean): When true, include the certification path from each certificate authority up to the self signed root. Required by validators that cannot anchor trust at a non self signed certificate authority. Defaults to false. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + if "sortBy" in kwargs: + options = ["authorityId", "featureType", "status"] + assert kwargs["sortBy"] in options, ( + f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' + ) + + metadata = { + "tags": ["organizations", "configure", "certificates", "authorities"], + "operation": "getOrganizationCertificatesAuthorities", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities" + + query_params = [ + "authorityIds", + "sortBy", + "includeChain", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "authorityIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def createOrganizationCertificatesAuthority(self, organizationId: str, featureType: str, **kwargs): + """ + **Create a certificate authority for an organization** + https://developer.cisco.com/meraki/api-v1/#!create-organization-certificates-authority + + - organizationId (string): Organization ID + - featureType (string): Feature this CA serves (e.g., radsec, openroaming, zigbee) + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "certificates", "authorities"], + "operation": "createOrganizationCertificatesAuthority", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities" + + body_params = [ + "featureType", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"createOrganizationCertificatesAuthority: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def updateOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, **kwargs): + """ + **Trust a newly created certificate authority (transition from untrusted to trusted).** + https://developer.cisco.com/meraki/api-v1/#!update-organization-certificates-authorities + + - organizationId (string): Organization ID + - authorityId (string): ID of the certificate authority to trust. The CA must currently be untrusted. + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "certificates", "authorities"], + "operation": "updateOrganizationCertificatesAuthorities", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities" + + body_params = [ + "authorityId", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"updateOrganizationCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def deleteOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, name: str): + """ + **Delete a certificate authority** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-certificates-authorities + + - organizationId (string): Organization ID + - authorityId (string): ID of the certificate authority to delete + - name (string): Certificate authority name + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "certificates", "authorities"], + "operation": "deleteOrganizationCertificatesAuthorities", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities" + + return self._session.delete(metadata, resource) + + def getOrganizationCertificatesAuthoritiesJob(self, organizationId: str, jobId: str): + """ + **Return the status and result of a certificate authority job.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates-authorities-job + + - organizationId (string): Organization ID + - jobId (string): Job ID + """ + + metadata = { + "tags": ["organizations", "configure", "certificates", "authorities", "jobs"], + "operation": "getOrganizationCertificatesAuthoritiesJob", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + jobId = urllib.parse.quote(str(jobId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities/jobs/{jobId}" + + return self._session.get(metadata, resource) + + def revokeOrganizationCertificatesAuthorities(self, organizationId: str, authorityId: str, **kwargs): + """ + **Revoke a trusted feature certificate authority.** + https://developer.cisco.com/meraki/api-v1/#!revoke-organization-certificates-authorities + + - organizationId (string): Organization ID + - authorityId (string): ID of the feature certificate authority to revoke + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "certificates", "authorities"], + "operation": "revokeOrganizationCertificatesAuthorities", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/authorities/revoke" + + body_params = [ + "authorityId", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"revokeOrganizationCertificatesAuthorities: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def getOrganizationCertificatesRevocationLists(self, organizationId: str, **kwargs): + """ + **Return full certificate revocation lists (CRLs) for the organization's certificate authorities** + https://developer.cisco.com/meraki/api-v1/#!get-organization-certificates-revocation-lists + + - organizationId (string): Organization ID + - certificateAuthorityIds (array): Optional filter: feature certificate authority IDs (base-10 integers). Every value must exist for this organization; otherwise the request fails. Omit to return CRLs for all feature CAs in the organization. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "certificates", "revocationLists"], + "operation": "getOrganizationCertificatesRevocationLists", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/certificates/revocationLists" + + query_params = [ + "certificateAuthorityIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "certificateAuthorityIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationCertificatesRevocationLists: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + def claimIntoOrganization(self, organizationId: str, **kwargs): """ **Claim a list of devices, licenses, and/or orders into an organization inventory** @@ -3460,6 +3714,64 @@ def getOrganizationDevicesCellularUplinksTowersByDevice( return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationDevicesCertificates(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **List device certificates for the organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-certificates + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - serials (array): Device serial numbers to filter by (exact match; duplicates are ignored) + - featureTypes (array): Feature types these device certificates serve (exact match; e.g., radsec, openroaming, zigbee) + - sortBy (string): Field to sort by (default: authorityId) + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + if "sortBy" in kwargs: + options = ["authorityId", "featureType", "status"] + assert kwargs["sortBy"] in options, ( + f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' + ) + + metadata = { + "tags": ["organizations", "configure", "devices", "certificates"], + "operation": "getOrganizationDevicesCertificates", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/devices/certificates" + + query_params = [ + "serials", + "featureTypes", + "sortBy", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "serials", + "featureTypes", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"getOrganizationDevicesCertificates: ignoring unrecognized kwargs: {invalid}") + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def createOrganizationDevicesControllerMigration(self, organizationId: str, serials: list, target: str, **kwargs): """ **Migrate devices to another controller or management mode** diff --git a/meraki/api/switch.py b/meraki/api/switch.py index fa21963..39e127c 100644 --- a/meraki/api/switch.py +++ b/meraki/api/switch.py @@ -2160,6 +2160,7 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): - powerExceptions (array): Exceptions on a per switch basis to "useCombinedPower" - uplinkClientSampling (object): Uplink client sampling - macBlocklist (object): MAC blocklist + - clientTracking (object): Client tracking settings. - portChannelFallback (boolean): Port channel fallback - uplinkSelection (object): Settings related to uplink selection on IOS-XE switches. """ @@ -2179,6 +2180,7 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): "powerExceptions", "uplinkClientSampling", "macBlocklist", + "clientTracking", "portChannelFallback", "uplinkSelection", ] diff --git a/meraki/api/wireless.py b/meraki/api/wireless.py index e040576..fc14f93 100644 --- a/meraki/api/wireless.py +++ b/meraki/api/wireless.py @@ -514,7 +514,7 @@ def updateNetworkWirelessAirMarshalRule(self, networkId: str, ruleId: str, **kwa def deleteNetworkWirelessAirMarshalRule(self, networkId: str, ruleId: str): """ - **Delete an Air Marshal rule.** + **Delete an Air Marshal rule** https://developer.cisco.com/meraki/api-v1/#!delete-network-wireless-air-marshal-rule - networkId (string): Network ID @@ -531,16 +531,16 @@ def deleteNetworkWirelessAirMarshalRule(self, networkId: str, ruleId: str): return self._session.delete(metadata, resource) - def updateNetworkWirelessAirMarshalSettings(self, networkId: str, defaultPolicy: str, **kwargs): + def updateNetworkWirelessAirMarshalSettings(self, networkId: str, **kwargs): """ - **Updates Air Marshal settings.** + **Updates Air Marshal settings** https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-air-marshal-settings - networkId (string): Network ID - defaultPolicy (string): Allows clients to access rogue networks. Blocked by default. """ - kwargs = locals() + kwargs.update(locals()) if "defaultPolicy" in kwargs: options = ["allow", "block"] @@ -2345,6 +2345,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 + - dot11k (object): The current setting for 802.11k - 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'. @@ -2355,7 +2356,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - radiusProxyEnabled (boolean): If true, Meraki devices will proxy RADIUS messages through the Meraki cloud to the configured RADIUS auth and accounting servers. - radiusTestingEnabled (boolean): If true, Meraki devices will periodically send Access-Request messages to configured RADIUS servers using identity 'meraki_8021x_test' to ensure that the RADIUS servers are reachable. - radiusCalledStationId (string): The template of the called station identifier to be used for RADIUS (ex. $NODE_MAC$:$VAP_NUM$). - - radiusAuthenticationNasId (string): The NAS identifier to use for RADIUS authentication. With 802.11r enabled or adaptive, custom text is available only to organizations enabled for this feature; otherwise, use only $NODE_MAC$, $VAP_NUM$, and $VAP_NAME$. When this feature is enabled, the complete rendered NAS identifier must be 1–48 bytes. + - radiusAuthenticationNasId (string): The NAS identifier to use for RADIUS authentication. With 802.11r enabled or adaptive, use $NODE_MAC$, $VAP_NUM$, $VAP_NAME$, and/or custom text. The complete rendered NAS identifier must be 1–48 bytes. - radiusServerTimeout (integer): The amount of time for which a RADIUS client waits for a reply from the RADIUS server (must be between 1-10 seconds). - radiusServerAttemptsLimit (integer): The maximum number of transmit attempts after which a RADIUS server is failed over (must be between 1-5). - radiusFallbackEnabled (boolean): Whether or not higher priority RADIUS servers should be retried after 60 seconds. @@ -2497,6 +2498,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): "wpaEncryptionMode", "dot11w", "dot11r", + "dot11k", "splashPage", "splashGuestSponsorDomains", "oauth", @@ -3574,6 +3576,72 @@ def getOrganizationAssuranceImpactedDeviceWirelessByNetwork( return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationAssuranceWirelessExperienceSuccessfulConnectionsByNetwork( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **Summarize wireless connection counts by network** + https://developer.cisco.com/meraki/api-v1/#!get-organization-assurance-wireless-experience-successful-connections-by-network + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - networkIds (array): Filter results by network. + - serials (array): Filter results by device serial. + - ssidNumbers (array): Filter results by SSID number. Valid values are 0-14. + - bands (array): Filter results by wireless band in GHz (2.4, 5, or 6). + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 100. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "monitor", "experience", "successfulConnections", "byNetwork"], + "operation": "getOrganizationAssuranceWirelessExperienceSuccessfulConnectionsByNetwork", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/assurance/wireless/experience/successfulConnections/byNetwork" + + query_params = [ + "networkIds", + "serials", + "ssidNumbers", + "bands", + "t0", + "t1", + "timespan", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "serials", + "ssidNumbers", + "bands", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationAssuranceWirelessExperienceSuccessfulConnectionsByNetwork: 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** @@ -4257,7 +4325,7 @@ def getOrganizationWirelessDevicesChannelUtilizationHistoryByNetworkByInterval( def getOrganizationWirelessDevicesEthernetStatuses(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **List the most recent Ethernet link speed, duplex, aggregation and power mode and status information for wireless devices** + **List the most recent Ethernet link speed, duplex, aggregation and power mode and status information for wireless devices.** https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-ethernet-statuses - organizationId (string): Organization ID diff --git a/pyproject.toml b/pyproject.toml index 9b20252..1581a42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "meraki" -version = "4.7.0" +version = "4.8.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 379242e..0c781bd 100644 --- a/uv.lock +++ b/uv.lock @@ -363,7 +363,7 @@ wheels = [ [[package]] name = "meraki" -version = "4.7.0" +version = "4.8.0" source = { editable = "." } dependencies = [ { name = "httpx" },