From c4f15b7c566d62daf9824956374de3a51f524996 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 1 Jul 2026 15:08:45 +0000 Subject: [PATCH] Auto-generated library v3.3.0 for API v1.72.0. --- CHANGELOG.md | 6 + changelog.d/+log-x-request-id-on-5xx.added.md | 1 - docs/generation-report.md | 6 + meraki/__init__.py | 2 +- meraki/_version.py | 2 +- meraki/aio/api/appliance.py | 10 +- meraki/aio/api/devices.py | 4 +- meraki/aio/api/networks.py | 31 +++++ meraki/aio/api/organizations.py | 125 ++++++++++++++++-- meraki/aio/api/switch.py | 35 +++++ meraki/aio/api/wireless.py | 2 + meraki/api/appliance.py | 10 +- meraki/api/batch/appliance.py | 6 +- meraki/api/batch/devices.py | 2 +- meraki/api/batch/networks.py | 25 ++++ meraki/api/batch/organizations.py | 100 ++++++++++++-- meraki/api/batch/switch.py | 31 ++++- meraki/api/batch/wireless.py | 2 + meraki/api/devices.py | 4 +- meraki/api/networks.py | 31 +++++ meraki/api/organizations.py | 125 ++++++++++++++++-- meraki/api/switch.py | 35 +++++ meraki/api/wireless.py | 2 + pyproject.toml | 2 +- uv.lock | 2 +- 25 files changed, 543 insertions(+), 58 deletions(-) delete mode 100644 changelog.d/+log-x-request-id-on-5xx.added.md diff --git a/CHANGELOG.md b/CHANGELOG.md index ef55270a..d9586a94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,3 +7,9 @@ add a news fragment under `changelog.d/` for every user-facing change. See [CONTRIBUTING.md](CONTRIBUTING.md) for the fragment format. + +## 3.3.0 (2026-07-01) + +### Added + +- On 5xx responses, the SDK now logs the Meraki `X-Request-Id` response header so it can be shared with Meraki to look up the request in server-side logs. If the header is absent, `none` is logged in its place. After retries are exhausted, the request ID is also logged at error level. diff --git a/changelog.d/+log-x-request-id-on-5xx.added.md b/changelog.d/+log-x-request-id-on-5xx.added.md deleted file mode 100644 index a242f188..00000000 --- a/changelog.d/+log-x-request-id-on-5xx.added.md +++ /dev/null @@ -1 +0,0 @@ -On 5xx responses, the SDK now logs the Meraki `X-Request-Id` response header so it can be shared with Meraki to look up the request in server-side logs. If the header is absent, `none` is logged in its place. After retries are exhausted, the request ID is also logged at error level. diff --git a/docs/generation-report.md b/docs/generation-report.md index dea19b9e..5f480fc9 100644 --- a/docs/generation-report.md +++ b/docs/generation-report.md @@ -1,5 +1,11 @@ # Generation Report +## 2026-07-01 | Library v3.3.0 | API 1.72.0 + + +No Python keyword parameter conflicts detected. + + ## 2026-06-04 | Library v3.2.0 | API 1.71.0 diff --git a/meraki/__init__.py b/meraki/__init__.py index 9cc2ecae..83fc9508 100644 --- a/meraki/__init__.py +++ b/meraki/__init__.py @@ -52,7 +52,7 @@ from meraki._version import __version__ # noqa: F401 from datetime import datetime -__api_version__ = "1.71.0" +__api_version__ = "1.72.0" __all__ = [ "APIError", diff --git a/meraki/_version.py b/meraki/_version.py index 11731085..88c513ea 100644 --- a/meraki/_version.py +++ b/meraki/_version.py @@ -1 +1 @@ -__version__ = "3.2.0" +__version__ = "3.3.0" diff --git a/meraki/aio/api/appliance.py b/meraki/aio/api/appliance.py index 2c29b70c..09c98051 100644 --- a/meraki/aio/api/appliance.py +++ b/meraki/aio/api/appliance.py @@ -66,7 +66,7 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): def getDeviceAppliancePerformance(self, serial: str, **kwargs): """ - **Return the performance score for a single MX** + **Return the performance score for a single Secure Appliance or Secure Router** https://developer.cisco.com/meraki/api-v1/#!get-device-appliance-performance - serial (string): Serial @@ -2673,7 +2673,7 @@ def getNetworkApplianceUplinksUsageHistory(self, networkId: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-uplinks-usage-history - networkId (string): Network ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 365 days from today. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 10 minutes. - resolution (integer): The time resolution in seconds for returned data. The valid resolutions are: 60, 300, 600, 1800, 3600, 86400. The default is 60. @@ -2747,7 +2747,7 @@ def createNetworkApplianceVlan(self, networkId: str, id: str, name: str, **kwarg - dhcpBootFilename (string): DHCP boot option for boot filename - dhcpOptions (array): The list of DHCP options that will be included in DHCP responses. Each object in the list should have "code", "type", and "value" properties. - sgt (object): Security Group Tag settings for the VLAN. - - vrf (object): VRF configuration on the VLAN + - vrf (object): VRF configuration on the VLAN. - uplinks (array): Per-uplink NAT exception override configuration on the VLAN. Applicable only for networks that support NAT exceptions. """ @@ -2903,7 +2903,7 @@ def updateNetworkApplianceVlan(self, networkId: str, vlanId: str, **kwargs): - ipv6 (object): IPv6 configuration on the VLAN - mandatoryDhcp (object): Mandatory DHCP will enforce that clients connecting to this VLAN must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. Only available on firmware versions 17.0 and above - sgt (object): Security Group Tag settings for the VLAN. - - vrf (object): VRF configuration on the VLAN + - vrf (object): VRF configuration on the VLAN. - uplinks (array): Per-uplink NAT exception override configuration on the VLAN. Applicable only for networks that support NAT exceptions. """ @@ -3011,7 +3011,7 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): - networkId (string): Network ID - enabled (boolean): Boolean value to enable or disable the BGP configuration. When BGP is enabled, the asNumber (ASN) will be autopopulated with the preconfigured ASN at other Hubs or a default value if there is no ASN configured. - - asNumber (integer): An Autonomous System Number (ASN) is required if you are to run BGP and peer with another BGP Speaker outside of the Auto VPN domain. This ASN will be applied to the entire Auto VPN domain. The entire 4-byte ASN range is supported. So, the ASN must be an integer between 1 and 4294967295. When absent, this field is not updated. If no value exists then it defaults to 64512. + - asNumber (integer): An Autonomous System Number (ASN) is required if you are to run BGP and peer with another BGP Speaker outside of the Auto VPN domain. This ASN will be applied to the entire Auto VPN domain and is only configurable for Auto VPN BGP networks. The entire 4-byte ASN range is supported. So, the ASN must be an integer between 1 and 4294967295. When absent, this field is not updated. If no value exists then it defaults to 64512. - ibgpHoldTimer (integer): The iBGP holdtimer in seconds. The iBGP holdtimer must be an integer between 12 and 240. When absent, this field is not updated. If no value exists then it defaults to 240. - routerId (string): The router ID of the appliance - neighbors (array): List of BGP neighbors. This list replaces the existing set of neighbors. When absent, this field is not updated. diff --git a/meraki/aio/api/devices.py b/meraki/aio/api/devices.py index 4925826a..f07f3436 100644 --- a/meraki/aio/api/devices.py +++ b/meraki/aio/api/devices.py @@ -160,7 +160,7 @@ def updateDeviceCellularSims(self, serial: str, **kwargs): - serial (string): Serial - sims (array): List of SIMs. If a SIM was previously configured and not specified in this request, it will remain unchanged. - - simOrdering (array): Specifies the ordering of all SIMs for an MG: primary, secondary, and not-in-use (when applicable). It's required for devices with 3 or more SIMs and can be used in place of 'isPrimary' for dual-SIM devices. To indicate eSIM, use 'sim3'. Sim failover will occur only between primary and secondary sim slots. + - simOrdering (array): Specifies the ordering of all SIMs for an MG: primary, secondary, and not-in-use (when applicable). It's required for devices with 3 or more SIMs and can be used in place of 'isPrimary' for dual-SIM devices. Use the raw eSIM slot value for the device, such as 'sim2' or 'sim3'. Sim failover will occur only between primary and secondary sim slots. - simFailover (object): SIM Failover settings. """ @@ -196,7 +196,7 @@ def createDeviceCellularUplinksBandsMasksUpdate(self, serial: str, slot: str, ty - serial (string): Serial - slot (string): Required parameter for the SIM slot to update the cellular band mask for - type (string): Required parameter for the signal type to update the cellular band mask for - - masked (array): Required parameter for the band identifiers to mask for the given SIM slot and signal type. For LTE use bands identifiers like '30' and for 5G use band identifiers like 'n30'. Maximum 256 bands. + - masked (array): Required parameter for the band identifiers to mask for the given SIM slot and signal type. For LTE use bands identifiers like '30', for 5G use band identifiers like 'n30', or use 'all' to mask all bands for that signal type. Maximum 256 bands. """ kwargs = locals() diff --git a/meraki/aio/api/networks.py b/meraki/aio/api/networks.py index 666028fa..83c085c0 100644 --- a/meraki/aio/api/networks.py +++ b/meraki/aio/api/networks.py @@ -886,6 +886,37 @@ def removeNetworkDevices(self, networkId: str, serial: str, **kwargs): return self._session.post(metadata, resource, payload) + def updateNetworkDevicesSyslogServers(self, networkId: str, servers: list, **kwargs): + """ + **Updates the syslog servers configuration for a network.** + https://developer.cisco.com/meraki/api-v1/#!update-network-devices-syslog-servers + + - networkId (string): Network ID + - servers (array): A list of the syslog servers for this network; suggested maximum array size is 10 + """ + + kwargs = locals() + + metadata = { + "tags": ["networks", "configure", "devices", "syslog", "servers"], + "operation": "updateNetworkDevicesSyslogServers", + } + networkId = urllib.parse.quote(str(networkId), safe="") + resource = f"/networks/{networkId}/devices/syslog/servers" + + body_params = [ + "servers", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"updateNetworkDevicesSyslogServers: ignoring unrecognized kwargs: {invalid}") + + return self._session.put(metadata, resource, payload) + def getNetworkEvents(self, networkId: str, total_pages=1, direction="prev", event_log_end_time=None, **kwargs): """ **List the events for the network** diff --git a/meraki/aio/api/organizations.py b/meraki/aio/api/organizations.py index 1ef07871..8b8edcc3 100644 --- a/meraki/aio/api/organizations.py +++ b/meraki/aio/api/organizations.py @@ -1469,7 +1469,7 @@ def dismissOrganizationAssuranceAlerts(self, organizationId: str, alertIds: list https://developer.cisco.com/meraki/api-v1/#!dismiss-organization-assurance-alerts - organizationId (string): Organization ID - - alertIds (array): Array of alert IDs to dismiss + - alertIds (array): Array of alert IDs in this organization to dismiss. Missing or inaccessible alert IDs return 404. """ kwargs = locals() @@ -1830,7 +1830,7 @@ def restoreOrganizationAssuranceAlerts(self, organizationId: str, alertIds: list https://developer.cisco.com/meraki/api-v1/#!restore-organization-assurance-alerts - organizationId (string): Organization ID - - alertIds (array): Array of alert IDs to restore + - alertIds (array): Array of alert IDs in this organization to restore. Missing or inaccessible alert IDs return 404. """ kwargs = locals() @@ -4192,6 +4192,106 @@ def getOrganizationDevicesStatusesOverview(self, organizationId: str, **kwargs): return self._session.get(metadata, resource, params) + def getOrganizationDevicesSyslogServersByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **Returns syslog servers configured for the networks within an organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-syslog-servers-by-network + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): IDs of the networks for which to fetch syslog servers; suggested maximum array size is 100 + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "devices", "syslog", "servers", "byNetwork"], + "operation": "getOrganizationDevicesSyslogServersByNetwork", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/devices/syslog/servers/byNetwork" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "networkIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationDevicesSyslogServersByNetwork: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationDevicesSyslogServersRolesByNetwork( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **Returns roles that can be assigned to a syslog server for a given network.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-syslog-servers-roles-by-network + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): IDs of the networks for which to fetch valid syslog server roles; suggested maximum array size is 100 + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "devices", "syslog", "servers", "roles", "byNetwork"], + "operation": "getOrganizationDevicesSyslogServersRolesByNetwork", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/devices/syslog/servers/roles/byNetwork" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "networkIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationDevicesSyslogServersRolesByNetwork: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationDevicesSystemMemoryUsageHistoryByInterval( self, organizationId: str, total_pages=1, direction="next", **kwargs ): @@ -6641,22 +6741,26 @@ def getOrganizationPolicyObjects(self, organizationId: str, total_pages=1, direc def createOrganizationPolicyObject(self, organizationId: str, name: str, category: str, type: str, **kwargs): """ - **Creates a new Policy Object.** + **Creates a new Policy Object** https://developer.cisco.com/meraki/api-v1/#!create-organization-policy-object - organizationId (string): Organization ID - name (string): Name of a policy object, unique within the organization (alphanumeric, space, dash, or underscore characters only) - category (string): Category of a policy object (one of: adaptivePolicy, network) - - type (string): Type of a policy object (one of: adaptivePolicyIpv4Cidr, cidr, fqdn, ipAndMask) + - type (string): Type of a policy object (one of: adaptivePolicyIpv4Cidr, cidr, fqdn). DEPRECATED: `ipAndMask` is deprecated and will be removed in a future release. Use `cidr` instead. - cidr (string): CIDR Value of a policy object (e.g. 10.11.12.1/24") - fqdn (string): Fully qualified domain name of policy object (e.g. "example.com") - - mask (string): Mask of a policy object (e.g. "255.255.0.0") - - ip (string): IP Address of a policy object (e.g. "1.2.3.4") + - mask (string): Mask of a policy object (e.g. "255.255.0.0"). Used only with deprecated `type=ipAndMask`. + - ip (string): IP Address of a policy object (e.g. "1.2.3.4"). Used only with deprecated `type=ipAndMask`. - groupIds (array): The IDs of policy object groups the policy object belongs to """ kwargs.update(locals()) + if "type" in kwargs: + options = ["adaptivePolicyIpv4Cidr", "cidr", "fqdn"] + assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' + metadata = { "tags": ["organizations", "configure", "policyObjects"], "operation": "createOrganizationPolicyObject", @@ -6850,7 +6954,7 @@ def getOrganizationPolicyObject(self, organizationId: str, policyObjectId: str): def updateOrganizationPolicyObject(self, organizationId: str, policyObjectId: str, **kwargs): """ - **Updates a Policy Object.** + **Updates a Policy Object** https://developer.cisco.com/meraki/api-v1/#!update-organization-policy-object - organizationId (string): Organization ID @@ -6858,8 +6962,8 @@ def updateOrganizationPolicyObject(self, organizationId: str, policyObjectId: st - name (string): Name of a policy object, unique within the organization (alphanumeric, space, dash, or underscore characters only) - cidr (string): CIDR Value of a policy object (e.g. 10.11.12.1/24") - fqdn (string): Fully qualified domain name of policy object (e.g. "example.com") - - mask (string): Mask of a policy object (e.g. "255.255.0.0") - - ip (string): IP Address of a policy object (e.g. "1.2.3.4") + - mask (string): Mask of a policy object (e.g. "255.255.0.0"). Used only with deprecated `type=ipAndMask`. + - ip (string): IP Address of a policy object (e.g. "1.2.3.4"). Used only with deprecated `type=ipAndMask`. - groupIds (array): The IDs of policy object groups the policy object belongs to """ @@ -7449,7 +7553,6 @@ def attachOrganizationSaseSites(self, organizationId: str, **kwargs): - organizationId (string): Organization ID - items (array): List of Meraki SD-WAN sites with the associated regions to be attached. - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret """ kwargs.update(locals()) @@ -7463,7 +7566,6 @@ def attachOrganizationSaseSites(self, organizationId: str, **kwargs): body_params = [ "items", - "callback", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -7542,7 +7644,6 @@ def detachOrganizationSaseSites(self, organizationId: str, **kwargs): - organizationId (string): Organization ID - items (array): List of Secure Access sites to be detached. - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret """ kwargs.update(locals()) diff --git a/meraki/aio/api/switch.py b/meraki/aio/api/switch.py index b164485f..21dcc763 100644 --- a/meraki/aio/api/switch.py +++ b/meraki/aio/api/switch.py @@ -2225,6 +2225,41 @@ def createNetworkSwitchStack(self, networkId: str, name: str, serials: list, **k return self._session.post(metadata, resource, payload) + def updateNetworkSwitchStack(self, networkId: str, switchStackId: str, **kwargs): + """ + **Update a switch stack** + https://developer.cisco.com/meraki/api-v1/#!update-network-switch-stack + + - networkId (string): Network ID + - switchStackId (string): Switch stack ID + - name (string): The name of the switch stack + - members (array): The complete list of switches that should be in the stack. Minimum 2 and maximum 8 members. Omitting this field leaves stack membership unchanged. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["switch", "configure", "stacks"], + "operation": "updateNetworkSwitchStack", + } + networkId = urllib.parse.quote(str(networkId), safe="") + switchStackId = urllib.parse.quote(str(switchStackId), safe="") + resource = f"/networks/{networkId}/switch/stacks/{switchStackId}" + + body_params = [ + "name", + "members", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"updateNetworkSwitchStack: ignoring unrecognized kwargs: {invalid}") + + return self._session.put(metadata, resource, payload) + def getNetworkSwitchStack(self, networkId: str, switchStackId: str): """ **Show a switch stack** diff --git a/meraki/aio/api/wireless.py b/meraki/aio/api/wireless.py index 8216c1b2..b9ece30d 100644 --- a/meraki/aio/api/wireless.py +++ b/meraki/aio/api/wireless.py @@ -2312,6 +2312,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - dnsRewrite (object): DNS servers rewrite settings - speedBurst (object): The SpeedBurst setting for this SSID' - namedVlans (object): Named VLAN settings. + - security (object): Security settings for the SSID - localAuthFallback (object): The current configuration for Local Authentication Fallback. Enables the Access Point (AP) to store client authentication data for a specified duration that can be adjusted as needed. - radiusAccountingStartDelay (integer): The delay (in seconds) before sending the first RADIUS accounting start message. Must be between 0 and 60 seconds. """ @@ -2463,6 +2464,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): "dnsRewrite", "speedBurst", "namedVlans", + "security", "localAuthFallback", "radiusAccountingStartDelay", ] diff --git a/meraki/api/appliance.py b/meraki/api/appliance.py index 14957aa0..82023191 100644 --- a/meraki/api/appliance.py +++ b/meraki/api/appliance.py @@ -66,7 +66,7 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): def getDeviceAppliancePerformance(self, serial: str, **kwargs): """ - **Return the performance score for a single MX** + **Return the performance score for a single Secure Appliance or Secure Router** https://developer.cisco.com/meraki/api-v1/#!get-device-appliance-performance - serial (string): Serial @@ -2673,7 +2673,7 @@ def getNetworkApplianceUplinksUsageHistory(self, networkId: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-uplinks-usage-history - networkId (string): Network ID - - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 365 days from today. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today. - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0. - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 10 minutes. - resolution (integer): The time resolution in seconds for returned data. The valid resolutions are: 60, 300, 600, 1800, 3600, 86400. The default is 60. @@ -2747,7 +2747,7 @@ def createNetworkApplianceVlan(self, networkId: str, id: str, name: str, **kwarg - dhcpBootFilename (string): DHCP boot option for boot filename - dhcpOptions (array): The list of DHCP options that will be included in DHCP responses. Each object in the list should have "code", "type", and "value" properties. - sgt (object): Security Group Tag settings for the VLAN. - - vrf (object): VRF configuration on the VLAN + - vrf (object): VRF configuration on the VLAN. - uplinks (array): Per-uplink NAT exception override configuration on the VLAN. Applicable only for networks that support NAT exceptions. """ @@ -2903,7 +2903,7 @@ def updateNetworkApplianceVlan(self, networkId: str, vlanId: str, **kwargs): - ipv6 (object): IPv6 configuration on the VLAN - mandatoryDhcp (object): Mandatory DHCP will enforce that clients connecting to this VLAN must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. Only available on firmware versions 17.0 and above - sgt (object): Security Group Tag settings for the VLAN. - - vrf (object): VRF configuration on the VLAN + - vrf (object): VRF configuration on the VLAN. - uplinks (array): Per-uplink NAT exception override configuration on the VLAN. Applicable only for networks that support NAT exceptions. """ @@ -3011,7 +3011,7 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): - networkId (string): Network ID - enabled (boolean): Boolean value to enable or disable the BGP configuration. When BGP is enabled, the asNumber (ASN) will be autopopulated with the preconfigured ASN at other Hubs or a default value if there is no ASN configured. - - asNumber (integer): An Autonomous System Number (ASN) is required if you are to run BGP and peer with another BGP Speaker outside of the Auto VPN domain. This ASN will be applied to the entire Auto VPN domain. The entire 4-byte ASN range is supported. So, the ASN must be an integer between 1 and 4294967295. When absent, this field is not updated. If no value exists then it defaults to 64512. + - asNumber (integer): An Autonomous System Number (ASN) is required if you are to run BGP and peer with another BGP Speaker outside of the Auto VPN domain. This ASN will be applied to the entire Auto VPN domain and is only configurable for Auto VPN BGP networks. The entire 4-byte ASN range is supported. So, the ASN must be an integer between 1 and 4294967295. When absent, this field is not updated. If no value exists then it defaults to 64512. - ibgpHoldTimer (integer): The iBGP holdtimer in seconds. The iBGP holdtimer must be an integer between 12 and 240. When absent, this field is not updated. If no value exists then it defaults to 240. - routerId (string): The router ID of the appliance - neighbors (array): List of BGP neighbors. This list replaces the existing set of neighbors. When absent, this field is not updated. diff --git a/meraki/api/batch/appliance.py b/meraki/api/batch/appliance.py index 93f68389..9202a10e 100644 --- a/meraki/api/batch/appliance.py +++ b/meraki/api/batch/appliance.py @@ -1064,7 +1064,7 @@ def createNetworkApplianceVlan(self, networkId: str, id: str, name: str, **kwarg - dhcpBootFilename (string): DHCP boot option for boot filename - dhcpOptions (array): The list of DHCP options that will be included in DHCP responses. Each object in the list should have "code", "type", and "value" properties. - sgt (object): Security Group Tag settings for the VLAN. - - vrf (object): VRF configuration on the VLAN + - vrf (object): VRF configuration on the VLAN. - uplinks (array): Per-uplink NAT exception override configuration on the VLAN. Applicable only for networks that support NAT exceptions. """ @@ -1172,7 +1172,7 @@ def updateNetworkApplianceVlan(self, networkId: str, vlanId: str, **kwargs): - ipv6 (object): IPv6 configuration on the VLAN - mandatoryDhcp (object): Mandatory DHCP will enforce that clients connecting to this VLAN must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. Only available on firmware versions 17.0 and above - sgt (object): Security Group Tag settings for the VLAN. - - vrf (object): VRF configuration on the VLAN + - vrf (object): VRF configuration on the VLAN. - uplinks (array): Per-uplink NAT exception override configuration on the VLAN. Applicable only for networks that support NAT exceptions. """ @@ -1257,7 +1257,7 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): - networkId (string): Network ID - enabled (boolean): Boolean value to enable or disable the BGP configuration. When BGP is enabled, the asNumber (ASN) will be autopopulated with the preconfigured ASN at other Hubs or a default value if there is no ASN configured. - - asNumber (integer): An Autonomous System Number (ASN) is required if you are to run BGP and peer with another BGP Speaker outside of the Auto VPN domain. This ASN will be applied to the entire Auto VPN domain. The entire 4-byte ASN range is supported. So, the ASN must be an integer between 1 and 4294967295. When absent, this field is not updated. If no value exists then it defaults to 64512. + - asNumber (integer): An Autonomous System Number (ASN) is required if you are to run BGP and peer with another BGP Speaker outside of the Auto VPN domain. This ASN will be applied to the entire Auto VPN domain and is only configurable for Auto VPN BGP networks. The entire 4-byte ASN range is supported. So, the ASN must be an integer between 1 and 4294967295. When absent, this field is not updated. If no value exists then it defaults to 64512. - ibgpHoldTimer (integer): The iBGP holdtimer in seconds. The iBGP holdtimer must be an integer between 12 and 240. When absent, this field is not updated. If no value exists then it defaults to 240. - routerId (string): The router ID of the appliance - neighbors (array): List of BGP neighbors. This list replaces the existing set of neighbors. When absent, this field is not updated. diff --git a/meraki/api/batch/devices.py b/meraki/api/batch/devices.py index 8df0ff15..c970b84e 100644 --- a/meraki/api/batch/devices.py +++ b/meraki/api/batch/devices.py @@ -79,7 +79,7 @@ def createDeviceCellularUplinksBandsMasksUpdate(self, serial: str, slot: str, ty - serial (string): Serial - slot (string): Required parameter for the SIM slot to update the cellular band mask for - type (string): Required parameter for the signal type to update the cellular band mask for - - masked (array): Required parameter for the band identifiers to mask for the given SIM slot and signal type. For LTE use bands identifiers like '30' and for 5G use band identifiers like 'n30'. Maximum 256 bands. + - masked (array): Required parameter for the band identifiers to mask for the given SIM slot and signal type. For LTE use bands identifiers like '30', for 5G use band identifiers like 'n30', or use 'all' to mask all bands for that signal type. Maximum 256 bands. """ kwargs = locals() diff --git a/meraki/api/batch/networks.py b/meraki/api/batch/networks.py index 5fd9dc9f..58672c98 100644 --- a/meraki/api/batch/networks.py +++ b/meraki/api/batch/networks.py @@ -203,6 +203,31 @@ def removeNetworkDevices(self, networkId: str, serial: str, **kwargs): } return action + def updateNetworkDevicesSyslogServers(self, networkId: str, servers: list, **kwargs): + """ + **Updates the syslog servers configuration for a network.** + https://developer.cisco.com/meraki/api-v1/#!update-network-devices-syslog-servers + + - networkId (string): Network ID + - servers (array): A list of the syslog servers for this network; suggested maximum array size is 10 + """ + + kwargs = locals() + + networkId = urllib.parse.quote(networkId, safe="") + resource = f"/networks/{networkId}/devices/syslog/servers" + + body_params = [ + "servers", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "servers", + "body": payload, + } + return action + def updateNetworkFirmwareUpgrades(self, networkId: str, **kwargs): """ **Update firmware upgrade information for a network** diff --git a/meraki/api/batch/organizations.py b/meraki/api/batch/organizations.py index 127df4d9..172a8b98 100644 --- a/meraki/api/batch/organizations.py +++ b/meraki/api/batch/organizations.py @@ -5,6 +5,37 @@ class ActionBatchOrganizations(object): def __init__(self): super(ActionBatchOrganizations, self).__init__() + def updateOrganization(self, organizationId: str, **kwargs): + """ + **Update an organization** + https://developer.cisco.com/meraki/api-v1/#!update-organization + + - organizationId (string): Organization ID + - name (string): The name of the organization + - management (object): Information about the organization's management system + - api (object): API-specific settings + - privacy (object): Privacy-related settings for the organization. + """ + + kwargs.update(locals()) + + organizationId = urllib.parse.quote(organizationId, safe="") + resource = f"/organizations/{organizationId}" + + body_params = [ + "name", + "management", + "api", + "privacy", + ] + 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 createOrganizationAdaptivePolicyAcl(self, organizationId: str, name: str, rules: list, ipVersion: str, **kwargs): """ **Creates new adaptive policy ACL** @@ -1717,22 +1748,26 @@ def deleteOrganizationPoliciesGlobalGroupPolicy(self, organizationId: str, polic def createOrganizationPolicyObject(self, organizationId: str, name: str, category: str, type: str, **kwargs): """ - **Creates a new Policy Object.** + **Creates a new Policy Object. Note: type `ipAndMask` is deprecated; use `cidr`.** https://developer.cisco.com/meraki/api-v1/#!create-organization-policy-object - organizationId (string): Organization ID - name (string): Name of a policy object, unique within the organization (alphanumeric, space, dash, or underscore characters only) - category (string): Category of a policy object (one of: adaptivePolicy, network) - - type (string): Type of a policy object (one of: adaptivePolicyIpv4Cidr, cidr, fqdn, ipAndMask) + - type (string): Type of a policy object (one of: adaptivePolicyIpv4Cidr, cidr, fqdn). DEPRECATED: `ipAndMask` is deprecated and will be removed in a future release. Use `cidr` instead. - cidr (string): CIDR Value of a policy object (e.g. 10.11.12.1/24") - fqdn (string): Fully qualified domain name of policy object (e.g. "example.com") - - mask (string): Mask of a policy object (e.g. "255.255.0.0") - - ip (string): IP Address of a policy object (e.g. "1.2.3.4") + - mask (string): Mask of a policy object (e.g. "255.255.0.0"). Used only with deprecated `type=ipAndMask`. + - ip (string): IP Address of a policy object (e.g. "1.2.3.4"). Used only with deprecated `type=ipAndMask`. - groupIds (array): The IDs of policy object groups the policy object belongs to """ kwargs.update(locals()) + if "type" in kwargs: + options = ["adaptivePolicyIpv4Cidr", "cidr", "fqdn"] + 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}/policyObjects" @@ -1833,7 +1868,7 @@ def deleteOrganizationPolicyObjectsGroup(self, organizationId: str, policyObject def updateOrganizationPolicyObject(self, organizationId: str, policyObjectId: str, **kwargs): """ - **Updates a Policy Object.** + **Updates a Policy Object. Note: type `ipAndMask` is deprecated; use `cidr`.** https://developer.cisco.com/meraki/api-v1/#!update-organization-policy-object - organizationId (string): Organization ID @@ -1841,8 +1876,8 @@ def updateOrganizationPolicyObject(self, organizationId: str, policyObjectId: st - name (string): Name of a policy object, unique within the organization (alphanumeric, space, dash, or underscore characters only) - cidr (string): CIDR Value of a policy object (e.g. 10.11.12.1/24") - fqdn (string): Fully qualified domain name of policy object (e.g. "example.com") - - mask (string): Mask of a policy object (e.g. "255.255.0.0") - - ip (string): IP Address of a policy object (e.g. "1.2.3.4") + - mask (string): Mask of a policy object (e.g. "255.255.0.0"). Used only with deprecated `type=ipAndMask`. + - ip (string): IP Address of a policy object (e.g. "1.2.3.4"). Used only with deprecated `type=ipAndMask`. - groupIds (array): The IDs of policy object groups the policy object belongs to """ @@ -2042,7 +2077,6 @@ def attachOrganizationSaseSites(self, organizationId: str, **kwargs): - organizationId (string): Organization ID - items (array): List of Meraki SD-WAN sites with the associated regions to be attached. - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret """ kwargs.update(locals()) @@ -2052,7 +2086,6 @@ def attachOrganizationSaseSites(self, organizationId: str, **kwargs): body_params = [ "items", - "callback", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -2069,7 +2102,6 @@ def detachOrganizationSaseSites(self, organizationId: str, **kwargs): - organizationId (string): Organization ID - items (array): List of Secure Access sites to be detached. - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret """ kwargs.update(locals()) @@ -2111,6 +2143,54 @@ def updateOrganizationSaseSite(self, organizationId: str, siteId: str, **kwargs) } return action + def updateOrganizationSnmp(self, organizationId: str, **kwargs): + """ + **Update the SNMP settings for an organization** + https://developer.cisco.com/meraki/api-v1/#!update-organization-snmp + + - organizationId (string): Organization ID + - v2cEnabled (boolean): Boolean indicating whether SNMP version 2c is enabled for the organization. + - v3Enabled (boolean): Boolean indicating whether SNMP version 3 is enabled for the organization. + - v3AuthMode (string): The SNMP version 3 authentication mode. Can be either 'MD5' or 'SHA'. + - v3AuthPass (string): The SNMP version 3 authentication password. Must be at least 8 characters if specified. + - v3PrivMode (string): The SNMP version 3 privacy mode. Can be either 'DES' or 'AES128'. + - v3PrivPass (string): The SNMP version 3 privacy password. Must be at least 8 characters if specified. + - peerIps (array): The list of IPv4 addresses that are allowed to access the SNMP server. + """ + + kwargs.update(locals()) + + if "v3AuthMode" in kwargs: + options = ["MD5", "SHA"] + assert kwargs["v3AuthMode"] in options, ( + f'''"v3AuthMode" cannot be "{kwargs["v3AuthMode"]}", & must be set to one of: {options}''' + ) + if "v3PrivMode" in kwargs: + options = ["AES128", "DES"] + assert kwargs["v3PrivMode"] in options, ( + f'''"v3PrivMode" cannot be "{kwargs["v3PrivMode"]}", & must be set to one of: {options}''' + ) + + organizationId = urllib.parse.quote(organizationId, safe="") + resource = f"/organizations/{organizationId}/snmp" + + body_params = [ + "v2cEnabled", + "v3Enabled", + "v3AuthMode", + "v3AuthPass", + "v3PrivMode", + "v3PrivPass", + "peerIps", + ] + 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 deleteOrganizationSplashAsset(self, organizationId: str, id: str): """ **Delete a Splash Theme Asset** diff --git a/meraki/api/batch/switch.py b/meraki/api/batch/switch.py index c469c7ba..092b9a51 100644 --- a/meraki/api/batch/switch.py +++ b/meraki/api/batch/switch.py @@ -1082,7 +1082,7 @@ def updateNetworkSwitchRoutingMulticast(self, networkId: str, **kwargs): payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, - "operation": "update", + "operation": "ms/multicast/actions/update", "body": payload, } return action @@ -1245,6 +1245,35 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): } return action + def updateNetworkSwitchStack(self, networkId: str, switchStackId: str, **kwargs): + """ + **Update a switch stack. At least one of 'name' or 'members' must be provided. If 'members' is provided, it replaces the entire stack membership.** + https://developer.cisco.com/meraki/api-v1/#!update-network-switch-stack + + - networkId (string): Network ID + - switchStackId (string): Switch stack ID + - name (string): The name of the switch stack + - members (array): The complete list of switches that should be in the stack. Minimum 2 and maximum 8 members. Omitting this field leaves stack membership unchanged. + """ + + kwargs.update(locals()) + + networkId = urllib.parse.quote(networkId, safe="") + switchStackId = urllib.parse.quote(switchStackId, safe="") + resource = f"/networks/{networkId}/switch/stacks/{switchStackId}" + + body_params = [ + "name", + "members", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "stacks/actions/update", + "body": payload, + } + return action + def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId: str, name: str, **kwargs): """ **Create a layer 3 interface for a switch stack** diff --git a/meraki/api/batch/wireless.py b/meraki/api/batch/wireless.py index 72ff3912..21684c44 100644 --- a/meraki/api/batch/wireless.py +++ b/meraki/api/batch/wireless.py @@ -763,6 +763,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - dnsRewrite (object): DNS servers rewrite settings - speedBurst (object): The SpeedBurst setting for this SSID' - namedVlans (object): Named VLAN settings. + - security (object): Security settings for the SSID - localAuthFallback (object): The current configuration for Local Authentication Fallback. Enables the Access Point (AP) to store client authentication data for a specified duration that can be adjusted as needed. - radiusAccountingStartDelay (integer): The delay (in seconds) before sending the first RADIUS accounting start message. Must be between 0 and 60 seconds. """ @@ -910,6 +911,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): "dnsRewrite", "speedBurst", "namedVlans", + "security", "localAuthFallback", "radiusAccountingStartDelay", ] diff --git a/meraki/api/devices.py b/meraki/api/devices.py index 79865603..4babf70f 100644 --- a/meraki/api/devices.py +++ b/meraki/api/devices.py @@ -160,7 +160,7 @@ def updateDeviceCellularSims(self, serial: str, **kwargs): - serial (string): Serial - sims (array): List of SIMs. If a SIM was previously configured and not specified in this request, it will remain unchanged. - - simOrdering (array): Specifies the ordering of all SIMs for an MG: primary, secondary, and not-in-use (when applicable). It's required for devices with 3 or more SIMs and can be used in place of 'isPrimary' for dual-SIM devices. To indicate eSIM, use 'sim3'. Sim failover will occur only between primary and secondary sim slots. + - simOrdering (array): Specifies the ordering of all SIMs for an MG: primary, secondary, and not-in-use (when applicable). It's required for devices with 3 or more SIMs and can be used in place of 'isPrimary' for dual-SIM devices. Use the raw eSIM slot value for the device, such as 'sim2' or 'sim3'. Sim failover will occur only between primary and secondary sim slots. - simFailover (object): SIM Failover settings. """ @@ -196,7 +196,7 @@ def createDeviceCellularUplinksBandsMasksUpdate(self, serial: str, slot: str, ty - serial (string): Serial - slot (string): Required parameter for the SIM slot to update the cellular band mask for - type (string): Required parameter for the signal type to update the cellular band mask for - - masked (array): Required parameter for the band identifiers to mask for the given SIM slot and signal type. For LTE use bands identifiers like '30' and for 5G use band identifiers like 'n30'. Maximum 256 bands. + - masked (array): Required parameter for the band identifiers to mask for the given SIM slot and signal type. For LTE use bands identifiers like '30', for 5G use band identifiers like 'n30', or use 'all' to mask all bands for that signal type. Maximum 256 bands. """ kwargs = locals() diff --git a/meraki/api/networks.py b/meraki/api/networks.py index 9acaa98a..c1858a71 100644 --- a/meraki/api/networks.py +++ b/meraki/api/networks.py @@ -886,6 +886,37 @@ def removeNetworkDevices(self, networkId: str, serial: str, **kwargs): return self._session.post(metadata, resource, payload) + def updateNetworkDevicesSyslogServers(self, networkId: str, servers: list, **kwargs): + """ + **Updates the syslog servers configuration for a network.** + https://developer.cisco.com/meraki/api-v1/#!update-network-devices-syslog-servers + + - networkId (string): Network ID + - servers (array): A list of the syslog servers for this network; suggested maximum array size is 10 + """ + + kwargs = locals() + + metadata = { + "tags": ["networks", "configure", "devices", "syslog", "servers"], + "operation": "updateNetworkDevicesSyslogServers", + } + networkId = urllib.parse.quote(str(networkId), safe="") + resource = f"/networks/{networkId}/devices/syslog/servers" + + body_params = [ + "servers", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"updateNetworkDevicesSyslogServers: ignoring unrecognized kwargs: {invalid}") + + return self._session.put(metadata, resource, payload) + def getNetworkEvents(self, networkId: str, total_pages=1, direction="prev", event_log_end_time=None, **kwargs): """ **List the events for the network** diff --git a/meraki/api/organizations.py b/meraki/api/organizations.py index 713c6f39..4331a1ce 100644 --- a/meraki/api/organizations.py +++ b/meraki/api/organizations.py @@ -1469,7 +1469,7 @@ def dismissOrganizationAssuranceAlerts(self, organizationId: str, alertIds: list https://developer.cisco.com/meraki/api-v1/#!dismiss-organization-assurance-alerts - organizationId (string): Organization ID - - alertIds (array): Array of alert IDs to dismiss + - alertIds (array): Array of alert IDs in this organization to dismiss. Missing or inaccessible alert IDs return 404. """ kwargs = locals() @@ -1830,7 +1830,7 @@ def restoreOrganizationAssuranceAlerts(self, organizationId: str, alertIds: list https://developer.cisco.com/meraki/api-v1/#!restore-organization-assurance-alerts - organizationId (string): Organization ID - - alertIds (array): Array of alert IDs to restore + - alertIds (array): Array of alert IDs in this organization to restore. Missing or inaccessible alert IDs return 404. """ kwargs = locals() @@ -4192,6 +4192,106 @@ def getOrganizationDevicesStatusesOverview(self, organizationId: str, **kwargs): return self._session.get(metadata, resource, params) + def getOrganizationDevicesSyslogServersByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **Returns syslog servers configured for the networks within an organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-syslog-servers-by-network + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): IDs of the networks for which to fetch syslog servers; suggested maximum array size is 100 + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "devices", "syslog", "servers", "byNetwork"], + "operation": "getOrganizationDevicesSyslogServersByNetwork", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/devices/syslog/servers/byNetwork" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "networkIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationDevicesSyslogServersByNetwork: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationDevicesSyslogServersRolesByNetwork( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **Returns roles that can be assigned to a syslog server for a given network.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-syslog-servers-roles-by-network + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): IDs of the networks for which to fetch valid syslog server roles; suggested maximum array size is 100 + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "devices", "syslog", "servers", "roles", "byNetwork"], + "operation": "getOrganizationDevicesSyslogServersRolesByNetwork", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/devices/syslog/servers/roles/byNetwork" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "networkIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationDevicesSyslogServersRolesByNetwork: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationDevicesSystemMemoryUsageHistoryByInterval( self, organizationId: str, total_pages=1, direction="next", **kwargs ): @@ -6641,22 +6741,26 @@ def getOrganizationPolicyObjects(self, organizationId: str, total_pages=1, direc def createOrganizationPolicyObject(self, organizationId: str, name: str, category: str, type: str, **kwargs): """ - **Creates a new Policy Object.** + **Creates a new Policy Object** https://developer.cisco.com/meraki/api-v1/#!create-organization-policy-object - organizationId (string): Organization ID - name (string): Name of a policy object, unique within the organization (alphanumeric, space, dash, or underscore characters only) - category (string): Category of a policy object (one of: adaptivePolicy, network) - - type (string): Type of a policy object (one of: adaptivePolicyIpv4Cidr, cidr, fqdn, ipAndMask) + - type (string): Type of a policy object (one of: adaptivePolicyIpv4Cidr, cidr, fqdn). DEPRECATED: `ipAndMask` is deprecated and will be removed in a future release. Use `cidr` instead. - cidr (string): CIDR Value of a policy object (e.g. 10.11.12.1/24") - fqdn (string): Fully qualified domain name of policy object (e.g. "example.com") - - mask (string): Mask of a policy object (e.g. "255.255.0.0") - - ip (string): IP Address of a policy object (e.g. "1.2.3.4") + - mask (string): Mask of a policy object (e.g. "255.255.0.0"). Used only with deprecated `type=ipAndMask`. + - ip (string): IP Address of a policy object (e.g. "1.2.3.4"). Used only with deprecated `type=ipAndMask`. - groupIds (array): The IDs of policy object groups the policy object belongs to """ kwargs.update(locals()) + if "type" in kwargs: + options = ["adaptivePolicyIpv4Cidr", "cidr", "fqdn"] + assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' + metadata = { "tags": ["organizations", "configure", "policyObjects"], "operation": "createOrganizationPolicyObject", @@ -6850,7 +6954,7 @@ def getOrganizationPolicyObject(self, organizationId: str, policyObjectId: str): def updateOrganizationPolicyObject(self, organizationId: str, policyObjectId: str, **kwargs): """ - **Updates a Policy Object.** + **Updates a Policy Object** https://developer.cisco.com/meraki/api-v1/#!update-organization-policy-object - organizationId (string): Organization ID @@ -6858,8 +6962,8 @@ def updateOrganizationPolicyObject(self, organizationId: str, policyObjectId: st - name (string): Name of a policy object, unique within the organization (alphanumeric, space, dash, or underscore characters only) - cidr (string): CIDR Value of a policy object (e.g. 10.11.12.1/24") - fqdn (string): Fully qualified domain name of policy object (e.g. "example.com") - - mask (string): Mask of a policy object (e.g. "255.255.0.0") - - ip (string): IP Address of a policy object (e.g. "1.2.3.4") + - mask (string): Mask of a policy object (e.g. "255.255.0.0"). Used only with deprecated `type=ipAndMask`. + - ip (string): IP Address of a policy object (e.g. "1.2.3.4"). Used only with deprecated `type=ipAndMask`. - groupIds (array): The IDs of policy object groups the policy object belongs to """ @@ -7449,7 +7553,6 @@ def attachOrganizationSaseSites(self, organizationId: str, **kwargs): - organizationId (string): Organization ID - items (array): List of Meraki SD-WAN sites with the associated regions to be attached. - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret """ kwargs.update(locals()) @@ -7463,7 +7566,6 @@ def attachOrganizationSaseSites(self, organizationId: str, **kwargs): body_params = [ "items", - "callback", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -7542,7 +7644,6 @@ def detachOrganizationSaseSites(self, organizationId: str, **kwargs): - organizationId (string): Organization ID - items (array): List of Secure Access sites to be detached. - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret """ kwargs.update(locals()) diff --git a/meraki/api/switch.py b/meraki/api/switch.py index d5cbf2dd..86ac6cc3 100644 --- a/meraki/api/switch.py +++ b/meraki/api/switch.py @@ -2225,6 +2225,41 @@ def createNetworkSwitchStack(self, networkId: str, name: str, serials: list, **k return self._session.post(metadata, resource, payload) + def updateNetworkSwitchStack(self, networkId: str, switchStackId: str, **kwargs): + """ + **Update a switch stack** + https://developer.cisco.com/meraki/api-v1/#!update-network-switch-stack + + - networkId (string): Network ID + - switchStackId (string): Switch stack ID + - name (string): The name of the switch stack + - members (array): The complete list of switches that should be in the stack. Minimum 2 and maximum 8 members. Omitting this field leaves stack membership unchanged. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["switch", "configure", "stacks"], + "operation": "updateNetworkSwitchStack", + } + networkId = urllib.parse.quote(str(networkId), safe="") + switchStackId = urllib.parse.quote(str(switchStackId), safe="") + resource = f"/networks/{networkId}/switch/stacks/{switchStackId}" + + body_params = [ + "name", + "members", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"updateNetworkSwitchStack: ignoring unrecognized kwargs: {invalid}") + + return self._session.put(metadata, resource, payload) + def getNetworkSwitchStack(self, networkId: str, switchStackId: str): """ **Show a switch stack** diff --git a/meraki/api/wireless.py b/meraki/api/wireless.py index 00afe6d7..38af3999 100644 --- a/meraki/api/wireless.py +++ b/meraki/api/wireless.py @@ -2312,6 +2312,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - dnsRewrite (object): DNS servers rewrite settings - speedBurst (object): The SpeedBurst setting for this SSID' - namedVlans (object): Named VLAN settings. + - security (object): Security settings for the SSID - localAuthFallback (object): The current configuration for Local Authentication Fallback. Enables the Access Point (AP) to store client authentication data for a specified duration that can be adjusted as needed. - radiusAccountingStartDelay (integer): The delay (in seconds) before sending the first RADIUS accounting start message. Must be between 0 and 60 seconds. """ @@ -2463,6 +2464,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): "dnsRewrite", "speedBurst", "namedVlans", + "security", "localAuthFallback", "radiusAccountingStartDelay", ] diff --git a/pyproject.toml b/pyproject.toml index 62a237ba..5f5f5a1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "meraki" -version = "3.2.0" +version = "3.3.0" description = "Cisco Meraki Dashboard API library" authors = [ {name = "Cisco Meraki", email = "api-feedback@meraki.net"} diff --git a/uv.lock b/uv.lock index 07eda185..92d1d8f2 100644 --- a/uv.lock +++ b/uv.lock @@ -549,7 +549,7 @@ wheels = [ [[package]] name = "meraki" -version = "3.2.0" +version = "3.3.0" source = { editable = "." } dependencies = [ { name = "aiohttp" },