diff --git a/docs/generation-report.md b/docs/generation-report.md index e6a0240..9ac9cbf 100644 --- a/docs/generation-report.md +++ b/docs/generation-report.md @@ -1,5 +1,11 @@ # Generation Report +## 2026-11-04 | Library v4.7.0b0 | API 1.76.0-beta.0 + + +No Python keyword parameter conflicts detected. + + ## 2026-10-28 | Library v4.6.1b2 | API 1.75.1-beta.2 diff --git a/meraki/__init__.py b/meraki/__init__.py index 9b74397..de4b8ca 100644 --- a/meraki/__init__.py +++ b/meraki/__init__.py @@ -57,7 +57,7 @@ from meraki.exceptions import APIError, APIKeyError, APIResponseError, AsyncAPIError from meraki.rest_session import RestSession -__api_version__ = "1.75.1-beta.2" +__api_version__ = "1.76.0-beta.0" __all__ = [ "APIError", diff --git a/meraki/_version.py b/meraki/_version.py index 213654e..e298ca1 100644 --- a/meraki/_version.py +++ b/meraki/_version.py @@ -1 +1 @@ -__version__ = "4.6.1b2" +__version__ = "4.7.0b0" diff --git a/meraki/aio/api/appliance.py b/meraki/aio/api/appliance.py index 7cb3a28..24cda20 100644 --- a/meraki/aio/api/appliance.py +++ b/meraki/aio/api/appliance.py @@ -328,7 +328,7 @@ def updateNetworkApplianceAlternateManagementInterface(self, networkId: str, **k - enabled (boolean): Whether the alternate management interface is enabled - primary (object): Primary alternate management interface addresses - addressPool (object): Address pool reserved for alternate management interface addresses - - vrf (object): VRF assignment for the alternate management interface. This beta operation currently ignores the requested VRF ID and always uses the default VRF. + - vrf (object): VRF assignment for the alternate management interface. Omit this field to preserve an existing assignment; when enabling AMI without an existing assignment, omission uses the default. Send null or ID 0 to use the default. Non-default VRFs must be supported for this Catalyst Router network. """ kwargs.update(locals()) @@ -2692,6 +2692,7 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw - custom (array): Custom VPN exclusion rules. Pass an empty array to clear existing rules. - majorApplications (array): Major Application based VPN exclusion rules. Pass an empty array to clear existing rules. - applications (array): NBAR application-based VPN exclusion rules. The documented example is a Secure Router NBAR catalog entry. On Secure Router networks, the ID and name must identify the same enabled NBAR application; traffic-shaping application IDs are not interchangeable. Available for networks on firmware >= 19.2. + - applicationCategoryMapping (object): Options for mapping configured majorApplications to application categories. """ kwargs.update(locals()) @@ -2707,6 +2708,7 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw "custom", "majorApplications", "applications", + "applicationCategoryMapping", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -3388,14 +3390,14 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): return self._session.put(metadata, resource, payload) - def updateNetworkApplianceVpnSiteToSiteHubVrfs(self, networkId: str, hubNetworkId: str, _json: list, **kwargs): + def updateNetworkApplianceVpnSiteToSiteHubVrfs(self, networkId: str, hubNetworkId: str, vrfs: list, **kwargs): """ - **Update the VRF mappings for a source network and hub pair.** + **Replace the complete VRF mapping for a source network and hub pair** https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-vpn-site-to-site-hub-vrfs - networkId (string): Network ID - hubNetworkId (string): Hub network ID - - _json (array): The list of VRFs for this source and hub mapping. + - vrfs (array): The list of VRFs for this source and hub mapping. """ kwargs = locals() @@ -3409,7 +3411,7 @@ def updateNetworkApplianceVpnSiteToSiteHubVrfs(self, networkId: str, hubNetworkI resource = f"/networks/{networkId}/appliance/vpn/siteToSite/hubs/{hubNetworkId}/vrfs" body_params = [ - "_json", + "vrfs", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -3425,7 +3427,7 @@ def updateNetworkApplianceVpnSiteToSiteHubVrfs(self, networkId: str, hubNetworkI 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 @@ -3442,15 +3444,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' - - changesConfirmed (boolean): Whether to accept the confirmation warnings for these changes. Defaults to false. + - 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. - peerSgtCapable (boolean): Whether or not Peer SGT is enabled for traffic to this VPN peer. - sgt (object): Security Group Tag settings for the VPN peer. - subnet (object): Configuration of subnet features @@ -3471,7 +3473,7 @@ def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kw resource = f"/networks/{networkId}/appliance/vpn/siteToSiteVpn" body_params = [ - "changesConfirmed", + "confirmed", "mode", "natTraversal", "hubs", diff --git a/meraki/aio/api/assistant.py b/meraki/aio/api/assistant.py index ee85ad7..b88f9a2 100644 --- a/meraki/aio/api/assistant.py +++ b/meraki/aio/api/assistant.py @@ -12,7 +12,7 @@ def createAdministeredAssistantChatCompletion(self, **kwargs): https://developer.cisco.com/meraki/api-v1/#!create-administered-assistant-chat-completion - query (string): Simple text question or instruction to send to the AI assistant. Provide either 'query' for text-only requests or 'content' for multi-modal input. - - content (array): List of multi-modal content blocks. Use instead of 'query' to send text or images. Supports text and image types only; for audio and file support, use the messages endpoint. Maximum 8 parts. + - content (array): List of multi-modal content blocks. Use instead of 'query' to send text or images. Maximum 8 parts and 4 total images. Each image must be at most 10 MiB decoded. - threadId (string): Existing persisted thread ID to continue synchronously. If omitted, the request is handled as a one-off invocation and the response will not include a reusable thread ID. - platform (string): Platform identifier. Defaults to MERAKI when omitted. Values are matched case-insensitively. - language (string): Optional language override. Defaults to the user's preferred language. @@ -248,7 +248,7 @@ def createAdministeredAssistantChatThreadMessage(self, threadId: str, content: l https://developer.cisco.com/meraki/api-v1/#!create-administered-assistant-chat-thread-message - threadId (string): Thread ID - - content (array): List of message content parts. A 'text' part sets 'text'; 'image', 'audio' and 'file' parts set 'source'. Maximum 8 parts. + - content (array): List of message content parts. A 'text' part sets 'text'; an 'image' part sets 'source'. Maximum 8 parts; each image must be at most 10 MiB decoded. There is no separate four-image limit. - platform (string): Platform identifier. Defaults to MERAKI when omitted. Values are matched case-insensitively. """ @@ -326,7 +326,7 @@ def createOrganizationAssistantChatCompletion(self, organizationId: str, **kwarg - organizationId (string): Organization ID - query (string): Simple text question or instruction to send to the AI assistant. Provide either 'query' for text-only requests or 'content' for multi-modal input. - - content (array): List of multi-modal content blocks. Use instead of 'query' to send text or images. Supports text and image types only; for audio and file support, use the messages endpoint. Maximum 8 parts. + - content (array): List of multi-modal content blocks. Use instead of 'query' to send text or images. Maximum 8 parts and 4 total images. Each image must be at most 10 MiB decoded. - threadId (string): Existing persisted thread ID to continue synchronously. If omitted, the request is handled as a one-off invocation and the response will not include a reusable thread ID. - networkId (string): Optional network ID to scope the query to a specific network. Defaults to the user's last visited network. - platform (string): Platform identifier. Defaults to MERAKI when omitted. Values are matched case-insensitively. @@ -580,7 +580,7 @@ def createOrganizationAssistantChatThreadMessage(self, organizationId: str, thre - organizationId (string): Organization ID - threadId (string): Thread ID - - content (array): List of message content parts. A 'text' part sets 'text'; 'image', 'audio' and 'file' parts set 'source'. Maximum 8 parts. + - content (array): List of message content parts. A 'text' part sets 'text'; an 'image' part sets 'source'. Maximum 8 parts; each image must be at most 10 MiB decoded. There is no separate four-image limit. - networkName (string): Name of the target network. - networkId (string): Optional Meraki network ID for thread context. - platform (string): Platform identifier. Defaults to MERAKI when omitted. Values are matched case-insensitively. diff --git a/meraki/aio/api/nac.py b/meraki/aio/api/nac.py index 33719e7..7523b3e 100644 --- a/meraki/aio/api/nac.py +++ b/meraki/aio/api/nac.py @@ -788,6 +788,7 @@ def getOrganizationNacClientsGroups(self, organizationId: str, total_pages=1, di - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - search (string): Optional parameter to fuzzy search on client groups. - groupIds (array): List of ids for specific group retrieval + - clientMac (string): MAC address of a client whose associated groups should be returned - excludeMembers (boolean): When true, omit the items array from each client group's members association while preserving totalCount and nextLink metadata. """ @@ -819,6 +820,7 @@ def getOrganizationNacClientsGroups(self, organizationId: str, total_pages=1, di "endingBefore", "search", "groupIds", + "clientMac", "excludeMembers", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} diff --git a/meraki/aio/api/organizations.py b/meraki/aio/api/organizations.py index ec315ec..e8f2430 100644 --- a/meraki/aio/api/organizations.py +++ b/meraki/aio/api/organizations.py @@ -5614,7 +5614,7 @@ def getOrganizationDevicesBootsOverviewByDevice(self, organizationId: str, **kwa - organizationId (string): Organization ID - networkIds (array): Filter results by network. - - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, campusGateway, and secureConnect. + - productTypes (array): Filter results by product type. Supported types: 'wireless'. - 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. @@ -9823,6 +9823,23 @@ def getMcfOrganization(self, organizationId: str): return self._session.get(metadata, resource) + def deleteMcfOrganization(self, organizationId: str): + """ + **Removes the associated Multicloud Fabric organization from active use while retaining its configuration and related resource records** + https://developer.cisco.com/meraki/api-v1/#!delete-mcf-organization + + - organizationId (string): Organization ID + """ + + metadata = { + "tags": ["organizations", "configure", "mcf"], + "operation": "deleteMcfOrganization", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/mcf" + + return self._session.delete(metadata, resource) + def getAccounts(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Returns account records discovered through cloud integrations for the @@ -9967,6 +9984,37 @@ def listAutovpnEnrollableSites(self, organizationId: str): return self._session.get(metadata, resource) + def offboardAutovpnSpokes(self, organizationId: str, spokes: list, **kwargs): + """ + **Detaches the requested Meraki AutoVPN spokes from their MCF regions.** + https://developer.cisco.com/meraki/api-v1/#!offboard-autovpn-spokes + + - organizationId (string): Organization ID + - spokes (array): Spoke networks to detach. Must name at least one network. + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "mcf", "autovpn", "sites"], + "operation": "offboardAutovpnSpokes", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/mcf/autovpn/sites/offboard" + + body_params = [ + "spokes", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"offboardAutovpnSpokes: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) + def onboardAutovpnSites(self, organizationId: str, **kwargs): """ **Starts asynchronous AutoVPN site-to-cloud onboarding for the requested spoke networks.** @@ -11388,6 +11436,117 @@ def getVpcUsage(self, organizationId: str, vpcId: str, windowSeconds: int, resol return self._session.get(metadata, resource, params) + def listOrganizationSubscriptions(self, organizationId: str): + """ + **Returns the organization's CCW and TRIAL subscriptions whose recorded status is ACTIVE, + ordered by the earliest known start date among each subscription's returned terms, then by + Multicloud Fabric subscription UUID, both ascending** + https://developer.cisco.com/meraki/api-v1/#!list-organization-subscriptions + + - organizationId (string): Organization ID + """ + + metadata = { + "tags": ["organizations", "configure", "mcf", "subscriptions"], + "operation": "listOrganizationSubscriptions", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/mcf/subscriptions" + + return self._session.get(metadata, resource) + + def claimOrganizationSubscription( + self, organizationId: str, type: str, ccwWebOrderSubscriptionRefIdPair: dict, termsAcceptance: dict, **kwargs + ): + """ + **Claims a CCW subscription using its original Web Order ID and subscription reference ID** + https://developer.cisco.com/meraki/api-v1/#!claim-organization-subscription + + - organizationId (string): Organization ID + - type (string): `ccw_web_order_subscription_ref_id_pair` selects a claim using the CCW Web Order ID and subscription reference ID. + - ccwWebOrderSubscriptionRefIdPair (object): Original identifiers for the same CCW purchase. Values must match exactly, including capitalization and spaces. + - termsAcceptance (object): Acceptance of a displayed agreement version. + """ + + kwargs = locals() + + if "type" in kwargs: + options = ["ccw_web_order_subscription_ref_id_pair"] + assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["organizations", "configure", "mcf", "subscriptions", "claim"], + "operation": "claimOrganizationSubscription", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/mcf/subscriptions/claim" + + body_params = [ + "type", + "ccwWebOrderSubscriptionRefIdPair", + "termsAcceptance", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"claimOrganizationSubscription: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) + + def createOrganizationTrialSubscription(self, organizationId: str, termsAcceptance: dict, **kwargs): + """ + **Starts a Multicloud Fabric trial for an organization that has not enabled Multicloud Fabric** + https://developer.cisco.com/meraki/api-v1/#!create-organization-trial-subscription + + - organizationId (string): Organization ID + - termsAcceptance (object): Acceptance of a displayed agreement version. + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "mcf", "subscriptions", "trial"], + "operation": "createOrganizationTrialSubscription", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/mcf/subscriptions/trial" + + body_params = [ + "termsAcceptance", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"createOrganizationTrialSubscription: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) + + def getOrganizationSubscription(self, organizationId: str, subscriptionId: str): + """ + **Returns the requested organization subscription and every current or future term, using the + same term-date and ordering rules as the subscription list** + https://developer.cisco.com/meraki/api-v1/#!get-organization-subscription + + - organizationId (string): Organization ID + - subscriptionId (string): Subscription ID + """ + + metadata = { + "tags": ["organizations", "configure", "mcf", "subscriptions"], + "operation": "getOrganizationSubscription", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + subscriptionId = urllib.parse.quote(str(subscriptionId), safe="") + resource = f"/organizations/{organizationId}/mcf/subscriptions/{subscriptionId}" + + return self._session.get(metadata, resource) + def getSummary(self, organizationId: str): """ **Returns organization connection, VPC, Site, and region counts derived from Zero Trust Routing and tunnel health.** @@ -11539,6 +11698,88 @@ def getTag(self, organizationId: str, tagId: str): return self._session.get(metadata, resource) + def acceptOrganizationTerms(self, organizationId: str, type: str, version: int, accepted: bool, **kwargs): + """ + **Records acceptance of a terms type and version for an existing Multicloud Fabric organization** + https://developer.cisco.com/meraki/api-v1/#!accept-organization-terms + + - organizationId (string): Organization ID + - type (string): Type of terms to review or accept. + + - `CCW_SUBSCRIPTION`: Terms for a CCW subscription. + - `TRIAL_SUBSCRIPTION`: Terms for a free trial. + + Each type has its own versions and acceptance records. + - version (integer): Latest published version shown to the user. Version `0` is valid. + - accepted (boolean): `true` confirms acceptance of this version. `false` is rejected. + """ + + kwargs = locals() + + if "type" in kwargs: + options = ["CCW_SUBSCRIPTION", "TRIAL_SUBSCRIPTION"] + assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["organizations", "configure", "mcf", "termsAndConditions", "accept"], + "operation": "acceptOrganizationTerms", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/mcf/termsAndConditions/accept" + + body_params = [ + "type", + "version", + "accepted", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"acceptOrganizationTerms: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) + + def getOrganizationTermsFile(self, organizationId: str, type: str, **kwargs): + """ + **Returns the PDF for the selected terms type and version** + https://developer.cisco.com/meraki/api-v1/#!get-organization-terms-file + + - organizationId (string): Organization ID + - type (string): Type of terms to download. Supply one supported value; empty, unknown, or repeated values are rejected. + - accept (string): May specify `application/pdf`. A successful response is a PDF; errors are returned as JSON. + - version (integer): Version of the terms to download, from `0` through `2147483647`. Omit it to download the latest version. Supply at most one value; empty, `null`, noninteger, and out-of-range values are rejected. + """ + + kwargs.update(locals()) + + if "type" in kwargs: + options = ["CCW_SUBSCRIPTION", "TRIAL_SUBSCRIPTION"] + assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["organizations", "configure", "mcf", "termsAndConditions", "file"], + "operation": "getOrganizationTermsFile", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/mcf/termsAndConditions/file" + + query_params = [ + "type", + "version", + ] + 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"getOrganizationTermsFile: ignoring unrecognized kwargs: {invalid}") + + return self._session.get(metadata, resource, params) + def getTunnelStatus(self, organizationId: str, **kwargs): """ **Returns aligned aggregate and member tunnel-health series for onboarded diff --git a/meraki/aio/api/wireless.py b/meraki/aio/api/wireless.py index 3db16a4..e06e6fd 100644 --- a/meraki/aio/api/wireless.py +++ b/meraki/aio/api/wireless.py @@ -667,16 +667,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"] @@ -5901,8 +5901,8 @@ def getOrganizationAssuranceWirelessExperienceSuccessfulConnectionsByNetwork( - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. + - 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. @@ -8143,7 +8143,7 @@ def getOrganizationWirelessDevicesAntennasExternalByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **List last-known external antenna detections by device and radio for outdoor CW9163E and CW9177E access points** + **List detected and Dashboard-configured external antennas by device and radio for applicable outdoor access points** https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-antennas-external-by-device - organizationId (string): Organization ID @@ -8151,7 +8151,7 @@ def getOrganizationWirelessDevicesAntennasExternalByDevice( - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Optional exact-match network IDs. Values match with OR; different filters combine with AND. An omitted or empty array does not restrict results. Applied before pagination and counts; inaccessible devices and networks are excluded. Use repeated bracket keys, for example networkIds[]=N_1234. Maximum 100 items. - serials (array): Optional exact-match device serials. Values match with OR; different filters combine with AND. An omitted or empty array does not restrict results. Applied before pagination and counts; inaccessible devices and networks are excluded. Use repeated bracket keys, for example serials[]=Q2XX-XXXX-XXXX. Maximum 100 items. - - models (array): Optional exact-match Dashboard model identifiers (CW9163E, CW9177E). Values match with OR; different filters combine with AND. An omitted or empty array does not restrict results. Applied before pagination and counts; inaccessible devices and networks are excluded. Use repeated bracket keys, for example models[]=CW9163E. Maximum 100 items. + - models (array): Optional exact-match Dashboard model identifiers, such as MR76, MR86, CW9163E or CW9177E; omit hardware suffixes such as -HW. Values match with OR; different filters combine with AND. An omitted or empty array does not restrict results. Applied before pagination and counts; inaccessible devices and networks are excluded. Use repeated bracket keys, for example models[]=CW9163E. Maximum 100 items. - 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. @@ -8513,7 +8513,7 @@ def getOrganizationWirelessDevicesDataRateByClient(self, organizationId: str, to 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 @@ -9940,6 +9940,243 @@ def getOrganizationWirelessIotRolesByNetwork(self, organizationId: str, total_pa return self._session.get_pages(metadata, resource, params, total_pages, direction) + def createOrganizationWirelessLiveToolsRebootBatch(self, organizationId: str, serials: list, mode: str, **kwargs): + """ + **Create an asynchronous reboot batch for selected access points in an organization** + https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-live-tools-reboot-batch + + - organizationId (string): Organization ID + - serials (array): AP serials to reboot. All must belong to one network. Maximum 5000. + - mode (string): 'now' dispatches as soon as possible; 'scheduled' waits for scheduledAt. + - scheduledAt (string): ISO 8601 UTC timestamp. Required when mode is 'scheduled'; must be within 30 days. + """ + + kwargs.update(locals()) + + if "mode" in kwargs: + options = ["now", "scheduled"] + assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["wireless", "liveTools", "reboot", "batches"], + "operation": "createOrganizationWirelessLiveToolsRebootBatch", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/liveTools/reboot/batches" + + body_params = [ + "serials", + "mode", + "scheduledAt", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"createOrganizationWirelessLiveToolsRebootBatch: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def getOrganizationWirelessLiveToolsRebootBatches(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **List reboot batches for an organization, newest first** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-live-tools-reboot-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 + - status (string): Filter batches by lifecycle status. + - networkIds (array): Filter batches by network. + - 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 'descending'. + """ + + kwargs.update(locals()) + + if "status" in kwargs: + options = ["cancelled", "complete", "failed", "new", "running", "scheduled"] + assert kwargs["status"] in options, ( + f'''"status" cannot be "{kwargs["status"]}", & must be set to one of: {options}''' + ) + if "sortOrder" in kwargs: + options = ["ascending", "descending"] + assert kwargs["sortOrder"] in options, ( + f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' + ) + + metadata = { + "tags": ["wireless", "liveTools", "reboot", "batches"], + "operation": "getOrganizationWirelessLiveToolsRebootBatches", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/liveTools/reboot/batches" + + query_params = [ + "status", + "networkIds", + "perPage", + "startingAfter", + "endingBefore", + "sortOrder", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationWirelessLiveToolsRebootBatches: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationWirelessLiveToolsRebootBatch(self, organizationId: str, batchId: str): + """ + **Return a batch overview: lifecycle status and per-status counts.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-live-tools-reboot-batch + + - organizationId (string): Organization ID + - batchId (string): Batch ID + """ + + metadata = { + "tags": ["wireless", "liveTools", "reboot", "batches"], + "operation": "getOrganizationWirelessLiveToolsRebootBatch", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + batchId = urllib.parse.quote(str(batchId), safe="") + resource = f"/organizations/{organizationId}/wireless/liveTools/reboot/batches/{batchId}" + + return self._session.get(metadata, resource) + + def cancelOrganizationWirelessLiveToolsRebootBatch(self, organizationId: str, batchId: str, **kwargs): + """ + **Cancel scheduled reboots in a batch** + https://developer.cisco.com/meraki/api-v1/#!cancel-organization-wireless-live-tools-reboot-batch + + - organizationId (string): Organization ID + - batchId (string): Batch ID + - serials (array): AP serials in this batch to cancel. Must be non-empty and unique. Omit to cancel the whole batch. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "liveTools", "reboot", "batches"], + "operation": "cancelOrganizationWirelessLiveToolsRebootBatch", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + batchId = urllib.parse.quote(str(batchId), safe="") + resource = f"/organizations/{organizationId}/wireless/liveTools/reboot/batches/{batchId}/cancel" + + body_params = [ + "serials", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"cancelOrganizationWirelessLiveToolsRebootBatch: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def getOrganizationWirelessLiveToolsRebootStatusesByDevice( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List per-device reboot statuses across the organization's wireless networks, newest first.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-live-tools-reboot-statuses-by-device + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - status (string): Filter by per-device reboot status. + - reason (string): Filter failed jobs by reason (e.g. offline). Use status=failed&reason=offline for unreachable APs. + - batchId (string): Filter to one reboot batch. + - networkIds (array): Filter by network. + - serials (array): Filter by device serial. + - 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 'descending'. + """ + + kwargs.update(locals()) + + if "status" in kwargs: + options = ["cancelled", "complete", "failed", "new", "ready", "running", "scheduled"] + assert kwargs["status"] in options, ( + f'''"status" cannot be "{kwargs["status"]}", & must be set to one of: {options}''' + ) + if "reason" in kwargs: + options = ["offline", "other", "rejected", "timeout", "unsupported"] + assert kwargs["reason"] in options, ( + f'''"reason" cannot be "{kwargs["reason"]}", & must be set to one of: {options}''' + ) + if "sortOrder" in kwargs: + options = ["ascending", "descending"] + assert kwargs["sortOrder"] in options, ( + f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' + ) + + metadata = { + "tags": ["wireless", "liveTools", "reboot", "statuses", "byDevice"], + "operation": "getOrganizationWirelessLiveToolsRebootStatusesByDevice", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/liveTools/reboot/statuses/byDevice" + + query_params = [ + "status", + "reason", + "batchId", + "networkIds", + "serials", + "perPage", + "startingAfter", + "endingBefore", + "sortOrder", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "serials", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationWirelessLiveToolsRebootStatusesByDevice: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationWirelessLocationAssetTrackingFloorPlans( self, organizationId: str, total_pages=1, direction="next", **kwargs ): diff --git a/meraki/api/appliance.py b/meraki/api/appliance.py index 497a141..0bb5001 100644 --- a/meraki/api/appliance.py +++ b/meraki/api/appliance.py @@ -328,7 +328,7 @@ def updateNetworkApplianceAlternateManagementInterface(self, networkId: str, **k - enabled (boolean): Whether the alternate management interface is enabled - primary (object): Primary alternate management interface addresses - addressPool (object): Address pool reserved for alternate management interface addresses - - vrf (object): VRF assignment for the alternate management interface. This beta operation currently ignores the requested VRF ID and always uses the default VRF. + - vrf (object): VRF assignment for the alternate management interface. Omit this field to preserve an existing assignment; when enabling AMI without an existing assignment, omission uses the default. Send null or ID 0 to use the default. Non-default VRFs must be supported for this Catalyst Router network. """ kwargs.update(locals()) @@ -2692,6 +2692,7 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw - custom (array): Custom VPN exclusion rules. Pass an empty array to clear existing rules. - majorApplications (array): Major Application based VPN exclusion rules. Pass an empty array to clear existing rules. - applications (array): NBAR application-based VPN exclusion rules. The documented example is a Secure Router NBAR catalog entry. On Secure Router networks, the ID and name must identify the same enabled NBAR application; traffic-shaping application IDs are not interchangeable. Available for networks on firmware >= 19.2. + - applicationCategoryMapping (object): Options for mapping configured majorApplications to application categories. """ kwargs.update(locals()) @@ -2707,6 +2708,7 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw "custom", "majorApplications", "applications", + "applicationCategoryMapping", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -3388,14 +3390,14 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): return self._session.put(metadata, resource, payload) - def updateNetworkApplianceVpnSiteToSiteHubVrfs(self, networkId: str, hubNetworkId: str, _json: list, **kwargs): + def updateNetworkApplianceVpnSiteToSiteHubVrfs(self, networkId: str, hubNetworkId: str, vrfs: list, **kwargs): """ - **Update the VRF mappings for a source network and hub pair.** + **Replace the complete VRF mapping for a source network and hub pair** https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-vpn-site-to-site-hub-vrfs - networkId (string): Network ID - hubNetworkId (string): Hub network ID - - _json (array): The list of VRFs for this source and hub mapping. + - vrfs (array): The list of VRFs for this source and hub mapping. """ kwargs = locals() @@ -3409,7 +3411,7 @@ def updateNetworkApplianceVpnSiteToSiteHubVrfs(self, networkId: str, hubNetworkI resource = f"/networks/{networkId}/appliance/vpn/siteToSite/hubs/{hubNetworkId}/vrfs" body_params = [ - "_json", + "vrfs", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -3425,7 +3427,7 @@ def updateNetworkApplianceVpnSiteToSiteHubVrfs(self, networkId: str, hubNetworkI 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 @@ -3442,15 +3444,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' - - changesConfirmed (boolean): Whether to accept the confirmation warnings for these changes. Defaults to false. + - 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. - peerSgtCapable (boolean): Whether or not Peer SGT is enabled for traffic to this VPN peer. - sgt (object): Security Group Tag settings for the VPN peer. - subnet (object): Configuration of subnet features @@ -3471,7 +3473,7 @@ def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kw resource = f"/networks/{networkId}/appliance/vpn/siteToSiteVpn" body_params = [ - "changesConfirmed", + "confirmed", "mode", "natTraversal", "hubs", diff --git a/meraki/api/assistant.py b/meraki/api/assistant.py index dc1f5a6..b005c65 100644 --- a/meraki/api/assistant.py +++ b/meraki/api/assistant.py @@ -12,7 +12,7 @@ def createAdministeredAssistantChatCompletion(self, **kwargs): https://developer.cisco.com/meraki/api-v1/#!create-administered-assistant-chat-completion - query (string): Simple text question or instruction to send to the AI assistant. Provide either 'query' for text-only requests or 'content' for multi-modal input. - - content (array): List of multi-modal content blocks. Use instead of 'query' to send text or images. Supports text and image types only; for audio and file support, use the messages endpoint. Maximum 8 parts. + - content (array): List of multi-modal content blocks. Use instead of 'query' to send text or images. Maximum 8 parts and 4 total images. Each image must be at most 10 MiB decoded. - threadId (string): Existing persisted thread ID to continue synchronously. If omitted, the request is handled as a one-off invocation and the response will not include a reusable thread ID. - platform (string): Platform identifier. Defaults to MERAKI when omitted. Values are matched case-insensitively. - language (string): Optional language override. Defaults to the user's preferred language. @@ -248,7 +248,7 @@ def createAdministeredAssistantChatThreadMessage(self, threadId: str, content: l https://developer.cisco.com/meraki/api-v1/#!create-administered-assistant-chat-thread-message - threadId (string): Thread ID - - content (array): List of message content parts. A 'text' part sets 'text'; 'image', 'audio' and 'file' parts set 'source'. Maximum 8 parts. + - content (array): List of message content parts. A 'text' part sets 'text'; an 'image' part sets 'source'. Maximum 8 parts; each image must be at most 10 MiB decoded. There is no separate four-image limit. - platform (string): Platform identifier. Defaults to MERAKI when omitted. Values are matched case-insensitively. """ @@ -326,7 +326,7 @@ def createOrganizationAssistantChatCompletion(self, organizationId: str, **kwarg - organizationId (string): Organization ID - query (string): Simple text question or instruction to send to the AI assistant. Provide either 'query' for text-only requests or 'content' for multi-modal input. - - content (array): List of multi-modal content blocks. Use instead of 'query' to send text or images. Supports text and image types only; for audio and file support, use the messages endpoint. Maximum 8 parts. + - content (array): List of multi-modal content blocks. Use instead of 'query' to send text or images. Maximum 8 parts and 4 total images. Each image must be at most 10 MiB decoded. - threadId (string): Existing persisted thread ID to continue synchronously. If omitted, the request is handled as a one-off invocation and the response will not include a reusable thread ID. - networkId (string): Optional network ID to scope the query to a specific network. Defaults to the user's last visited network. - platform (string): Platform identifier. Defaults to MERAKI when omitted. Values are matched case-insensitively. @@ -580,7 +580,7 @@ def createOrganizationAssistantChatThreadMessage(self, organizationId: str, thre - organizationId (string): Organization ID - threadId (string): Thread ID - - content (array): List of message content parts. A 'text' part sets 'text'; 'image', 'audio' and 'file' parts set 'source'. Maximum 8 parts. + - content (array): List of message content parts. A 'text' part sets 'text'; an 'image' part sets 'source'. Maximum 8 parts; each image must be at most 10 MiB decoded. There is no separate four-image limit. - networkName (string): Name of the target network. - networkId (string): Optional Meraki network ID for thread context. - platform (string): Platform identifier. Defaults to MERAKI when omitted. Values are matched case-insensitively. diff --git a/meraki/api/batch/appliance.py b/meraki/api/batch/appliance.py index 300554d..836c5ca 100644 --- a/meraki/api/batch/appliance.py +++ b/meraki/api/batch/appliance.py @@ -174,14 +174,14 @@ def createDeviceApplianceVmxAuthenticationToken(self, serial: str): def updateNetworkApplianceAlternateManagementInterface(self, networkId: str, **kwargs): """ - **Update Secure Router alternate management interface settings for a network. Omitted properties remain unchanged. The request contains only editable properties; the response includes network identity and resolved VRF name. This beta operation is available only to organizations with beta API access and may change before GA.** + **Update Secure Router alternate management interface settings for a network. Omitted properties remain unchanged. Omit VRF to preserve an existing assignment; send null or ID 0 to use the default. When enabling AMI without an existing assignment, an omitted VRF uses the default. Provided non-default VRFs must be supported for the Catalyst Router network. The request contains only editable properties; the response includes network identity and resolved VRF name. This beta operation is available only to organizations with beta API access and may change before GA.** https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-alternate-management-interface - networkId (string): Network ID - enabled (boolean): Whether the alternate management interface is enabled - primary (object): Primary alternate management interface addresses - addressPool (object): Address pool reserved for alternate management interface addresses - - vrf (object): VRF assignment for the alternate management interface. This beta operation currently ignores the requested VRF ID and always uses the default VRF. + - vrf (object): VRF assignment for the alternate management interface. Omit this field to preserve an existing assignment; when enabling AMI without an existing assignment, omission uses the default. Send null or ID 0 to use the default. Non-default VRFs must be supported for this Catalyst Router network. """ kwargs.update(locals()) @@ -330,6 +330,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(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** @@ -1069,6 +1094,7 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw - custom (array): Custom VPN exclusion rules. Pass an empty array to clear existing rules. - majorApplications (array): Major Application based VPN exclusion rules. Pass an empty array to clear existing rules. - applications (array): NBAR application-based VPN exclusion rules. The documented example is a Secure Router NBAR catalog entry. On Secure Router networks, the ID and name must identify the same enabled NBAR application; traffic-shaping application IDs are not interchangeable. Available for networks on firmware >= 19.2. + - applicationCategoryMapping (object): Options for mapping configured majorApplications to application categories. """ kwargs.update(locals()) @@ -1080,6 +1106,7 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw "custom", "majorApplications", "applications", + "applicationCategoryMapping", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -1551,14 +1578,14 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): } return action - def updateNetworkApplianceVpnSiteToSiteHubVrfs(self, networkId: str, hubNetworkId: str, _json: list, **kwargs): + def updateNetworkApplianceVpnSiteToSiteHubVrfs(self, networkId: str, hubNetworkId: str, vrfs: list, **kwargs): """ - **Update the VRF mappings for a source network and hub pair.** + **Replace the complete VRF mapping for a source network and hub pair. The required 'vrfs' array replaces the current VRF selection. An omitted array returns a 400 response and does not change the mapping. For a spoke source, an empty array selects only the default VRF. For a hub source, the array must contain at least one item. In a non-empty array, use VRF ID '0' to select the default VRF, either alone or alongside non-default VRFs.** https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-vpn-site-to-site-hub-vrfs - networkId (string): Network ID - hubNetworkId (string): Hub network ID - - _json (array): The list of VRFs for this source and hub mapping. + - vrfs (array): The list of VRFs for this source and hub mapping. """ kwargs = locals() @@ -1568,7 +1595,7 @@ def updateNetworkApplianceVpnSiteToSiteHubVrfs(self, networkId: str, hubNetworkI resource = f"/networks/{networkId}/appliance/vpn/siteToSite/hubs/{hubNetworkId}/vrfs" body_params = [ - "_json", + "vrfs", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -1580,15 +1607,15 @@ def updateNetworkApplianceVpnSiteToSiteHubVrfs(self, networkId: str, hubNetworkI 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' - - changesConfirmed (boolean): Whether to accept the confirmation warnings for these changes. Defaults to false. + - 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. - peerSgtCapable (boolean): Whether or not Peer SGT is enabled for traffic to this VPN peer. - sgt (object): Security Group Tag settings for the VPN peer. - subnet (object): Configuration of subnet features @@ -1605,7 +1632,7 @@ def updateNetworkApplianceVpnSiteToSiteVpn(self, networkId: str, mode: str, **kw resource = f"/networks/{networkId}/appliance/vpn/siteToSiteVpn" body_params = [ - "changesConfirmed", + "confirmed", "mode", "natTraversal", "hubs", diff --git a/meraki/api/batch/organizations.py b/meraki/api/batch/organizations.py index f9c1be2..f7e530e 100644 --- a/meraki/api/batch/organizations.py +++ b/meraki/api/batch/organizations.py @@ -2072,6 +2072,23 @@ def updateOrganizationLoginSecurity(self, organizationId: str, **kwargs): } return action + def deleteMcfOrganization(self, organizationId: str): + """ + **Removes the associated Multicloud Fabric organization from active use while retaining its configuration and related resource records. All onboarded VPCs and Sites must be removed first. A successful removal allows the same Meraki Dashboard organization to onboard again as a new Multicloud Fabric organization. Repeating removal before onboarding again returns 404.** + https://developer.cisco.com/meraki/api-v1/#!delete-mcf-organization + + - organizationId (string): Organization ID + """ + + organizationId = urllib.parse.quote(organizationId, safe="") + resource = f"/organizations/{organizationId}/mcf" + + action = { + "resource": resource, + "operation": "batch", + } + return action + def syncAutovpnConnectors(self, organizationId: str): """ **Starts asynchronous reconciliation of MCF AutoVPN connectors and available regions.** @@ -2106,6 +2123,31 @@ def disableAutovpnSiteToCloud(self, organizationId: str): } return action + def offboardAutovpnSpokes(self, organizationId: str, spokes: list, **kwargs): + """ + **Detaches the requested Meraki AutoVPN spokes from their MCF regions.** + https://developer.cisco.com/meraki/api-v1/#!offboard-autovpn-spokes + + - organizationId (string): Organization ID + - spokes (array): Spoke networks to detach. Must name at least one network. + """ + + kwargs = locals() + + organizationId = urllib.parse.quote(organizationId, safe="") + resource = f"/organizations/{organizationId}/mcf/autovpn/sites/offboard" + + body_params = [ + "spokes", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "batch", + "body": payload, + } + return action + def onboardAutovpnSites(self, organizationId: str, **kwargs): """ **Starts asynchronous AutoVPN site-to-cloud onboarding for the requested spoke networks.** @@ -2479,6 +2521,66 @@ def confirmRemovedResource(self, organizationId: str, resourceType: str, resourc } return action + def claimOrganizationSubscription( + self, organizationId: str, type: str, ccwWebOrderSubscriptionRefIdPair: dict, termsAcceptance: dict, **kwargs + ): + """ + **Claims a CCW subscription using its original Web Order ID and subscription reference ID. Creates the Multicloud Fabric organization if needed and records acceptance of the current commercial terms. An already claimed purchase returns a conflict, including when requested by its owner. When the organization has no `ACTIVE` CCW subscriptions, the purchase's coverage must have started by the current UTC day. Otherwise, it must start on the UTC day immediately after the latest term of the organization's `ACTIVE` CCW subscriptions ends; that start may be in the future. Only `ACTIVE` CCW subscriptions establish this coverage boundary; `PENDING`, `CANCELLED`, and `EXPIRED` purchases do not. Gaps and overlaps with active coverage are rejected. An organization can claim only one future paid subscription at a time: another claim is rejected when it already has two or more `ACTIVE` CCW subscriptions. Each subscription counts once regardless of its number of terms. When one `ACTIVE` CCW subscription exists, turn off its auto-renewal in Cisco Commerce Workspace (CCW) before claiming another purchase. Trial, cancelled, and expired subscriptions do not count toward this limit. Claiming a CCW purchase cancels an existing active trial and closes its open term at the claim time, preserving trial history and usage. When the claim creates an organization, the optional `MCF-Shell` header records its creation source: `meraki` (Meraki Dashboard) or `ccc` (Cisco Cloud Control). Only one exact, case-sensitive value is recognized. Missing or invalid values, including repeated headers, leave the source unknown without causing a request error. The source is not returned in the response. Existing organizations retain their original source, including an unknown source.** + https://developer.cisco.com/meraki/api-v1/#!claim-organization-subscription + + - organizationId (string): Organization ID + - type (string): `ccw_web_order_subscription_ref_id_pair` selects a claim using the CCW Web Order ID and subscription reference ID. + - ccwWebOrderSubscriptionRefIdPair (object): Original identifiers for the same CCW purchase. Values must match exactly, including capitalization and spaces. + - termsAcceptance (object): Acceptance of a displayed agreement version. + """ + + kwargs = locals() + + if "type" in kwargs: + options = ["ccw_web_order_subscription_ref_id_pair"] + assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' + + organizationId = urllib.parse.quote(organizationId, safe="") + resource = f"/organizations/{organizationId}/mcf/subscriptions/claim" + + body_params = [ + "type", + "ccwWebOrderSubscriptionRefIdPair", + "termsAcceptance", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "batch", + "body": payload, + } + return action + + def createOrganizationTrialSubscription(self, organizationId: str, termsAcceptance: dict, **kwargs): + """ + **Starts a Multicloud Fabric trial for an organization that has not enabled Multicloud Fabric. An organization that already has Multicloud Fabric enabled cannot start a trial. The optional `MCF-Shell` header records the new organization's creation source: `meraki` (Meraki Dashboard) or `ccc` (Cisco Cloud Control). Only one exact, case-sensitive value is recognized. Missing or invalid values, including repeated headers, leave the source unknown without causing a request error. The source is not returned in the response.** + https://developer.cisco.com/meraki/api-v1/#!create-organization-trial-subscription + + - organizationId (string): Organization ID + - termsAcceptance (object): Acceptance of a displayed agreement version. + """ + + kwargs = locals() + + organizationId = urllib.parse.quote(organizationId, safe="") + resource = f"/organizations/{organizationId}/mcf/subscriptions/trial" + + body_params = [ + "termsAcceptance", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "batch", + "body": payload, + } + return action + def createTag(self, organizationId: str, key: str, value: str, type: str, **kwargs): """ **Finds or creates the canonical tag identity for the exact organization, @@ -2519,6 +2621,44 @@ def createTag(self, organizationId: str, key: str, value: str, type: str, **kwar } return action + def acceptOrganizationTerms(self, organizationId: str, type: str, version: int, accepted: bool, **kwargs): + """ + **Records acceptance of a terms type and version for an existing Multicloud Fabric organization** + https://developer.cisco.com/meraki/api-v1/#!accept-organization-terms + + - organizationId (string): Organization ID + - type (string): Type of terms to review or accept. + + - `CCW_SUBSCRIPTION`: Terms for a CCW subscription. + - `TRIAL_SUBSCRIPTION`: Terms for a free trial. + + Each type has its own versions and acceptance records. + - version (integer): Latest published version shown to the user. Version `0` is valid. + - accepted (boolean): `true` confirms acceptance of this version. `false` is rejected. + """ + + kwargs = locals() + + if "type" in kwargs: + options = ["CCW_SUBSCRIPTION", "TRIAL_SUBSCRIPTION"] + assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' + + organizationId = urllib.parse.quote(organizationId, safe="") + resource = f"/organizations/{organizationId}/mcf/termsAndConditions/accept" + + body_params = [ + "type", + "version", + "accepted", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "batch", + "body": payload, + } + return action + def offboardVpcs(self, organizationId: str, vpcs: list, **kwargs): """ **Validates 1–50 distinct organization-owned VPC IDs and attempts to offboard each VPC. The entire request is rejected before batch creation when its shape or identifiers are invalid, a VPC is missing, or any requested VPC belongs to an active onboarding or offboarding batch. An existing VPC with no onboarding record is instead returned as a response-only rejection; it is not added to the batch tracker and does not prevent other VPCs from being processed. A successful item means Multicloud Fabric either completed immediate cleanup for a failed onboarding with no recorded provider resources or started asynchronous teardown. The batch reports terminal outcomes only for accepted VPCs; onboarding state history reports asynchronous teardown.** diff --git a/meraki/api/batch/wireless.py b/meraki/api/batch/wireless.py index 88dd7be..74eabca 100644 --- a/meraki/api/batch/wireless.py +++ b/meraki/api/batch/wireless.py @@ -282,16 +282,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"] diff --git a/meraki/api/nac.py b/meraki/api/nac.py index 93a10af..5308afc 100644 --- a/meraki/api/nac.py +++ b/meraki/api/nac.py @@ -788,6 +788,7 @@ def getOrganizationNacClientsGroups(self, organizationId: str, total_pages=1, di - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - search (string): Optional parameter to fuzzy search on client groups. - groupIds (array): List of ids for specific group retrieval + - clientMac (string): MAC address of a client whose associated groups should be returned - excludeMembers (boolean): When true, omit the items array from each client group's members association while preserving totalCount and nextLink metadata. """ @@ -819,6 +820,7 @@ def getOrganizationNacClientsGroups(self, organizationId: str, total_pages=1, di "endingBefore", "search", "groupIds", + "clientMac", "excludeMembers", ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} diff --git a/meraki/api/organizations.py b/meraki/api/organizations.py index 502dc7d..b29046d 100644 --- a/meraki/api/organizations.py +++ b/meraki/api/organizations.py @@ -5614,7 +5614,7 @@ def getOrganizationDevicesBootsOverviewByDevice(self, organizationId: str, **kwa - organizationId (string): Organization ID - networkIds (array): Filter results by network. - - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, campusGateway, and secureConnect. + - productTypes (array): Filter results by product type. Supported types: 'wireless'. - 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. @@ -9823,6 +9823,23 @@ def getMcfOrganization(self, organizationId: str): return self._session.get(metadata, resource) + def deleteMcfOrganization(self, organizationId: str): + """ + **Removes the associated Multicloud Fabric organization from active use while retaining its configuration and related resource records** + https://developer.cisco.com/meraki/api-v1/#!delete-mcf-organization + + - organizationId (string): Organization ID + """ + + metadata = { + "tags": ["organizations", "configure", "mcf"], + "operation": "deleteMcfOrganization", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/mcf" + + return self._session.delete(metadata, resource) + def getAccounts(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Returns account records discovered through cloud integrations for the @@ -9967,6 +9984,37 @@ def listAutovpnEnrollableSites(self, organizationId: str): return self._session.get(metadata, resource) + def offboardAutovpnSpokes(self, organizationId: str, spokes: list, **kwargs): + """ + **Detaches the requested Meraki AutoVPN spokes from their MCF regions.** + https://developer.cisco.com/meraki/api-v1/#!offboard-autovpn-spokes + + - organizationId (string): Organization ID + - spokes (array): Spoke networks to detach. Must name at least one network. + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "mcf", "autovpn", "sites"], + "operation": "offboardAutovpnSpokes", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/mcf/autovpn/sites/offboard" + + body_params = [ + "spokes", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"offboardAutovpnSpokes: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) + def onboardAutovpnSites(self, organizationId: str, **kwargs): """ **Starts asynchronous AutoVPN site-to-cloud onboarding for the requested spoke networks.** @@ -11388,6 +11436,117 @@ def getVpcUsage(self, organizationId: str, vpcId: str, windowSeconds: int, resol return self._session.get(metadata, resource, params) + def listOrganizationSubscriptions(self, organizationId: str): + """ + **Returns the organization's CCW and TRIAL subscriptions whose recorded status is ACTIVE, + ordered by the earliest known start date among each subscription's returned terms, then by + Multicloud Fabric subscription UUID, both ascending** + https://developer.cisco.com/meraki/api-v1/#!list-organization-subscriptions + + - organizationId (string): Organization ID + """ + + metadata = { + "tags": ["organizations", "configure", "mcf", "subscriptions"], + "operation": "listOrganizationSubscriptions", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/mcf/subscriptions" + + return self._session.get(metadata, resource) + + def claimOrganizationSubscription( + self, organizationId: str, type: str, ccwWebOrderSubscriptionRefIdPair: dict, termsAcceptance: dict, **kwargs + ): + """ + **Claims a CCW subscription using its original Web Order ID and subscription reference ID** + https://developer.cisco.com/meraki/api-v1/#!claim-organization-subscription + + - organizationId (string): Organization ID + - type (string): `ccw_web_order_subscription_ref_id_pair` selects a claim using the CCW Web Order ID and subscription reference ID. + - ccwWebOrderSubscriptionRefIdPair (object): Original identifiers for the same CCW purchase. Values must match exactly, including capitalization and spaces. + - termsAcceptance (object): Acceptance of a displayed agreement version. + """ + + kwargs = locals() + + if "type" in kwargs: + options = ["ccw_web_order_subscription_ref_id_pair"] + assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["organizations", "configure", "mcf", "subscriptions", "claim"], + "operation": "claimOrganizationSubscription", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/mcf/subscriptions/claim" + + body_params = [ + "type", + "ccwWebOrderSubscriptionRefIdPair", + "termsAcceptance", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"claimOrganizationSubscription: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) + + def createOrganizationTrialSubscription(self, organizationId: str, termsAcceptance: dict, **kwargs): + """ + **Starts a Multicloud Fabric trial for an organization that has not enabled Multicloud Fabric** + https://developer.cisco.com/meraki/api-v1/#!create-organization-trial-subscription + + - organizationId (string): Organization ID + - termsAcceptance (object): Acceptance of a displayed agreement version. + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "mcf", "subscriptions", "trial"], + "operation": "createOrganizationTrialSubscription", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/mcf/subscriptions/trial" + + body_params = [ + "termsAcceptance", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"createOrganizationTrialSubscription: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) + + def getOrganizationSubscription(self, organizationId: str, subscriptionId: str): + """ + **Returns the requested organization subscription and every current or future term, using the + same term-date and ordering rules as the subscription list** + https://developer.cisco.com/meraki/api-v1/#!get-organization-subscription + + - organizationId (string): Organization ID + - subscriptionId (string): Subscription ID + """ + + metadata = { + "tags": ["organizations", "configure", "mcf", "subscriptions"], + "operation": "getOrganizationSubscription", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + subscriptionId = urllib.parse.quote(str(subscriptionId), safe="") + resource = f"/organizations/{organizationId}/mcf/subscriptions/{subscriptionId}" + + return self._session.get(metadata, resource) + def getSummary(self, organizationId: str): """ **Returns organization connection, VPC, Site, and region counts derived from Zero Trust Routing and tunnel health.** @@ -11539,6 +11698,88 @@ def getTag(self, organizationId: str, tagId: str): return self._session.get(metadata, resource) + def acceptOrganizationTerms(self, organizationId: str, type: str, version: int, accepted: bool, **kwargs): + """ + **Records acceptance of a terms type and version for an existing Multicloud Fabric organization** + https://developer.cisco.com/meraki/api-v1/#!accept-organization-terms + + - organizationId (string): Organization ID + - type (string): Type of terms to review or accept. + + - `CCW_SUBSCRIPTION`: Terms for a CCW subscription. + - `TRIAL_SUBSCRIPTION`: Terms for a free trial. + + Each type has its own versions and acceptance records. + - version (integer): Latest published version shown to the user. Version `0` is valid. + - accepted (boolean): `true` confirms acceptance of this version. `false` is rejected. + """ + + kwargs = locals() + + if "type" in kwargs: + options = ["CCW_SUBSCRIPTION", "TRIAL_SUBSCRIPTION"] + assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["organizations", "configure", "mcf", "termsAndConditions", "accept"], + "operation": "acceptOrganizationTerms", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/mcf/termsAndConditions/accept" + + body_params = [ + "type", + "version", + "accepted", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"acceptOrganizationTerms: ignoring unrecognized kwargs: {invalid}") + + return self._session.post(metadata, resource, payload) + + def getOrganizationTermsFile(self, organizationId: str, type: str, **kwargs): + """ + **Returns the PDF for the selected terms type and version** + https://developer.cisco.com/meraki/api-v1/#!get-organization-terms-file + + - organizationId (string): Organization ID + - type (string): Type of terms to download. Supply one supported value; empty, unknown, or repeated values are rejected. + - accept (string): May specify `application/pdf`. A successful response is a PDF; errors are returned as JSON. + - version (integer): Version of the terms to download, from `0` through `2147483647`. Omit it to download the latest version. Supply at most one value; empty, `null`, noninteger, and out-of-range values are rejected. + """ + + kwargs.update(locals()) + + if "type" in kwargs: + options = ["CCW_SUBSCRIPTION", "TRIAL_SUBSCRIPTION"] + assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["organizations", "configure", "mcf", "termsAndConditions", "file"], + "operation": "getOrganizationTermsFile", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/mcf/termsAndConditions/file" + + query_params = [ + "type", + "version", + ] + 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"getOrganizationTermsFile: ignoring unrecognized kwargs: {invalid}") + + return self._session.get(metadata, resource, params) + def getTunnelStatus(self, organizationId: str, **kwargs): """ **Returns aligned aggregate and member tunnel-health series for onboarded diff --git a/meraki/api/wireless.py b/meraki/api/wireless.py index e55f8a7..c419aa7 100644 --- a/meraki/api/wireless.py +++ b/meraki/api/wireless.py @@ -667,16 +667,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"] @@ -5901,8 +5901,8 @@ def getOrganizationAssuranceWirelessExperienceSuccessfulConnectionsByNetwork( - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Filter results by network. - serials (array): Filter results by device serial. - - ssidNumbers (array): Filter results by SSID number. - - bands (array): Filter results by band. + - 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. @@ -8143,7 +8143,7 @@ def getOrganizationWirelessDevicesAntennasExternalByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): """ - **List last-known external antenna detections by device and radio for outdoor CW9163E and CW9177E access points** + **List detected and Dashboard-configured external antennas by device and radio for applicable outdoor access points** https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-antennas-external-by-device - organizationId (string): Organization ID @@ -8151,7 +8151,7 @@ def getOrganizationWirelessDevicesAntennasExternalByDevice( - direction (string): direction to paginate, either "next" (default) or "prev" page - networkIds (array): Optional exact-match network IDs. Values match with OR; different filters combine with AND. An omitted or empty array does not restrict results. Applied before pagination and counts; inaccessible devices and networks are excluded. Use repeated bracket keys, for example networkIds[]=N_1234. Maximum 100 items. - serials (array): Optional exact-match device serials. Values match with OR; different filters combine with AND. An omitted or empty array does not restrict results. Applied before pagination and counts; inaccessible devices and networks are excluded. Use repeated bracket keys, for example serials[]=Q2XX-XXXX-XXXX. Maximum 100 items. - - models (array): Optional exact-match Dashboard model identifiers (CW9163E, CW9177E). Values match with OR; different filters combine with AND. An omitted or empty array does not restrict results. Applied before pagination and counts; inaccessible devices and networks are excluded. Use repeated bracket keys, for example models[]=CW9163E. Maximum 100 items. + - models (array): Optional exact-match Dashboard model identifiers, such as MR76, MR86, CW9163E or CW9177E; omit hardware suffixes such as -HW. Values match with OR; different filters combine with AND. An omitted or empty array does not restrict results. Applied before pagination and counts; inaccessible devices and networks are excluded. Use repeated bracket keys, for example models[]=CW9163E. Maximum 100 items. - 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. @@ -8513,7 +8513,7 @@ def getOrganizationWirelessDevicesDataRateByClient(self, organizationId: str, to 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 @@ -9940,6 +9940,243 @@ def getOrganizationWirelessIotRolesByNetwork(self, organizationId: str, total_pa return self._session.get_pages(metadata, resource, params, total_pages, direction) + def createOrganizationWirelessLiveToolsRebootBatch(self, organizationId: str, serials: list, mode: str, **kwargs): + """ + **Create an asynchronous reboot batch for selected access points in an organization** + https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-live-tools-reboot-batch + + - organizationId (string): Organization ID + - serials (array): AP serials to reboot. All must belong to one network. Maximum 5000. + - mode (string): 'now' dispatches as soon as possible; 'scheduled' waits for scheduledAt. + - scheduledAt (string): ISO 8601 UTC timestamp. Required when mode is 'scheduled'; must be within 30 days. + """ + + kwargs.update(locals()) + + if "mode" in kwargs: + options = ["now", "scheduled"] + assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["wireless", "liveTools", "reboot", "batches"], + "operation": "createOrganizationWirelessLiveToolsRebootBatch", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/liveTools/reboot/batches" + + body_params = [ + "serials", + "mode", + "scheduledAt", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"createOrganizationWirelessLiveToolsRebootBatch: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def getOrganizationWirelessLiveToolsRebootBatches(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **List reboot batches for an organization, newest first** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-live-tools-reboot-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 + - status (string): Filter batches by lifecycle status. + - networkIds (array): Filter batches by network. + - 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 'descending'. + """ + + kwargs.update(locals()) + + if "status" in kwargs: + options = ["cancelled", "complete", "failed", "new", "running", "scheduled"] + assert kwargs["status"] in options, ( + f'''"status" cannot be "{kwargs["status"]}", & must be set to one of: {options}''' + ) + if "sortOrder" in kwargs: + options = ["ascending", "descending"] + assert kwargs["sortOrder"] in options, ( + f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' + ) + + metadata = { + "tags": ["wireless", "liveTools", "reboot", "batches"], + "operation": "getOrganizationWirelessLiveToolsRebootBatches", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/liveTools/reboot/batches" + + query_params = [ + "status", + "networkIds", + "perPage", + "startingAfter", + "endingBefore", + "sortOrder", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationWirelessLiveToolsRebootBatches: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationWirelessLiveToolsRebootBatch(self, organizationId: str, batchId: str): + """ + **Return a batch overview: lifecycle status and per-status counts.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-live-tools-reboot-batch + + - organizationId (string): Organization ID + - batchId (string): Batch ID + """ + + metadata = { + "tags": ["wireless", "liveTools", "reboot", "batches"], + "operation": "getOrganizationWirelessLiveToolsRebootBatch", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + batchId = urllib.parse.quote(str(batchId), safe="") + resource = f"/organizations/{organizationId}/wireless/liveTools/reboot/batches/{batchId}" + + return self._session.get(metadata, resource) + + def cancelOrganizationWirelessLiveToolsRebootBatch(self, organizationId: str, batchId: str, **kwargs): + """ + **Cancel scheduled reboots in a batch** + https://developer.cisco.com/meraki/api-v1/#!cancel-organization-wireless-live-tools-reboot-batch + + - organizationId (string): Organization ID + - batchId (string): Batch ID + - serials (array): AP serials in this batch to cancel. Must be non-empty and unique. Omit to cancel the whole batch. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "liveTools", "reboot", "batches"], + "operation": "cancelOrganizationWirelessLiveToolsRebootBatch", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + batchId = urllib.parse.quote(str(batchId), safe="") + resource = f"/organizations/{organizationId}/wireless/liveTools/reboot/batches/{batchId}/cancel" + + body_params = [ + "serials", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"cancelOrganizationWirelessLiveToolsRebootBatch: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def getOrganizationWirelessLiveToolsRebootStatusesByDevice( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List per-device reboot statuses across the organization's wireless networks, newest first.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-live-tools-reboot-statuses-by-device + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - status (string): Filter by per-device reboot status. + - reason (string): Filter failed jobs by reason (e.g. offline). Use status=failed&reason=offline for unreachable APs. + - batchId (string): Filter to one reboot batch. + - networkIds (array): Filter by network. + - serials (array): Filter by device serial. + - 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 'descending'. + """ + + kwargs.update(locals()) + + if "status" in kwargs: + options = ["cancelled", "complete", "failed", "new", "ready", "running", "scheduled"] + assert kwargs["status"] in options, ( + f'''"status" cannot be "{kwargs["status"]}", & must be set to one of: {options}''' + ) + if "reason" in kwargs: + options = ["offline", "other", "rejected", "timeout", "unsupported"] + assert kwargs["reason"] in options, ( + f'''"reason" cannot be "{kwargs["reason"]}", & must be set to one of: {options}''' + ) + if "sortOrder" in kwargs: + options = ["ascending", "descending"] + assert kwargs["sortOrder"] in options, ( + f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' + ) + + metadata = { + "tags": ["wireless", "liveTools", "reboot", "statuses", "byDevice"], + "operation": "getOrganizationWirelessLiveToolsRebootStatusesByDevice", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/liveTools/reboot/statuses/byDevice" + + query_params = [ + "status", + "reason", + "batchId", + "networkIds", + "serials", + "perPage", + "startingAfter", + "endingBefore", + "sortOrder", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "serials", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationWirelessLiveToolsRebootStatusesByDevice: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationWirelessLocationAssetTrackingFloorPlans( self, organizationId: str, total_pages=1, direction="next", **kwargs ): diff --git a/pyproject.toml b/pyproject.toml index 4ad0e45..cce4b5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "meraki" -version = "4.6.1b2" +version = "4.7.0b0" description = "Cisco Meraki Dashboard API library" authors = [ {name = "Cisco Meraki", email = "api-feedback@meraki.net"} diff --git a/uv.lock b/uv.lock index a7d0a88..4231bee 100644 --- a/uv.lock +++ b/uv.lock @@ -591,7 +591,7 @@ wheels = [ [[package]] name = "meraki" -version = "4.6.1b2" +version = "4.7.0b0" source = { editable = "." } dependencies = [ { name = "aiohttp" },