From 054263225947e3beea79fc63694d44578beefcf4 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 7 Oct 2026 14:22:08 +0000 Subject: [PATCH] Auto-generated library v4.6.0 for API v1.75.0. --- docs/generation-report.md | 6 + meraki/__init__.py | 2 +- meraki/_version.py | 2 +- meraki/aio/api/appliance.py | 880 +++++++++++++++++++++++++++++- meraki/aio/api/campusGateway.py | 58 ++ meraki/aio/api/networks.py | 8 +- meraki/aio/api/organizations.py | 518 +++++++++++++++++- meraki/aio/api/switch.py | 24 +- meraki/aio/api/wireless.py | 148 ++++- meraki/api/appliance.py | 880 +++++++++++++++++++++++++++++- meraki/api/batch/appliance.py | 396 +++++++++++++- meraki/api/batch/networks.py | 4 +- meraki/api/batch/organizations.py | 120 +++- meraki/api/batch/switch.py | 45 +- meraki/api/batch/wireless.py | 54 +- meraki/api/campusGateway.py | 58 ++ meraki/api/networks.py | 8 +- meraki/api/organizations.py | 518 +++++++++++++++++- meraki/api/switch.py | 24 +- meraki/api/wireless.py | 148 ++++- pyproject.toml | 2 +- uv.lock | 4 +- 22 files changed, 3815 insertions(+), 92 deletions(-) diff --git a/docs/generation-report.md b/docs/generation-report.md index 7dca83e..320845e 100644 --- a/docs/generation-report.md +++ b/docs/generation-report.md @@ -1,5 +1,11 @@ # Generation Report +## 2026-10-07 | Library v4.6.0 | API 1.75.0 + + +No Python keyword parameter conflicts detected. + + ## 2026-09-02 | Library v4.5.0 | API 1.74.0 diff --git a/meraki/__init__.py b/meraki/__init__.py index b3ef9b4..a6708c3 100644 --- a/meraki/__init__.py +++ b/meraki/__init__.py @@ -60,7 +60,7 @@ from meraki._version import __version__ # noqa: F401 from datetime import datetime -__api_version__ = "1.74.0" +__api_version__ = "1.75.0" __all__ = [ "APIError", diff --git a/meraki/_version.py b/meraki/_version.py index 9faa2c2..db01fb2 100644 --- a/meraki/_version.py +++ b/meraki/_version.py @@ -1 +1 @@ -__version__ = "4.5.0" +__version__ = "4.6.0" diff --git a/meraki/aio/api/appliance.py b/meraki/aio/api/appliance.py index f9954ac..74f0477 100644 --- a/meraki/aio/api/appliance.py +++ b/meraki/aio/api/appliance.py @@ -34,6 +34,7 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): - personality (object): Describes the port's configurability - uplink (object): The port's settings when in WAN mode - downlink (object): The port's VLAN settings when in LAN mode + - profile (object): The optional LAN port's profile which it inherits from """ kwargs.update(locals()) @@ -51,6 +52,7 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): "personality", "uplink", "downlink", + "profile", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -64,6 +66,47 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): return self._session.post(metadata, resource, payload) + def updateDeviceApplianceInterfacesPort(self, serial: str, number: str, **kwargs): + """ + **Update configurations for an appliance's specified port** + https://developer.cisco.com/meraki/api-v1/#!update-device-appliance-interfaces-port + + - serial (string): Serial + - number (string): Number + - enabled (boolean): Indicates whether the port is enabled + - personality (object): Describes the port's configurability + - uplink (object): The port's settings when in WAN mode + - downlink (object): The port's VLAN settings when in LAN mode + - profile (object): The optional LAN port's profile which it inherits from + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "interfaces", "ports"], + "operation": "updateDeviceApplianceInterfacesPort", + } + serial = urllib.parse.quote(str(serial), safe="") + number = urllib.parse.quote(str(number), safe="") + resource = f"/devices/{serial}/appliance/interfaces/ports/{number}" + + body_params = [ + "enabled", + "personality", + "uplink", + "downlink", + "profile", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"updateDeviceApplianceInterfacesPort: ignoring unrecognized kwargs: {invalid}") + + return self._session.put(metadata, resource, payload) + def getDeviceAppliancePerformance(self, serial: str, **kwargs): """ **Return the performance score for a single Secure Appliance or Secure Router** @@ -1618,6 +1661,7 @@ def updateNetworkApplianceSecurityIntrusion(self, networkId: str, **kwargs): - networkId (string): Network ID - mode (string): Set mode to 'disabled'/'detection'/'prevention' (optional - omitting will leave current config unchanged) - idsRulesets (string): Set the detection ruleset 'connectivity'/'balanced'/'security' (optional - omitting will leave current config unchanged). Default value is 'balanced' if none currently saved + - policy (object): Set a custom intrusion policy by id (optional - omitting will leave current config unchanged) - protectedNetworks (object): Set the included/excluded networks from the intrusion engine (optional - omitting will leave current config unchanged). This is available only in 'passthrough' mode """ @@ -1642,6 +1686,7 @@ def updateNetworkApplianceSecurityIntrusion(self, networkId: str, **kwargs): body_params = [ "mode", "idsRulesets", + "policy", "protectedNetworks", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1966,6 +2011,7 @@ def createNetworkApplianceStaticRoute(self, networkId: str, name: str, subnet: s - gatewayIp (string): Gateway IP address (next hop) - gatewayVlanId (integer): Gateway VLAN ID - enabled (boolean): Enable/disable the static route + - vrf (object): VRF settings for the static route. """ kwargs.update(locals()) @@ -1983,6 +2029,7 @@ def createNetworkApplianceStaticRoute(self, networkId: str, name: str, subnet: s "gatewayIp", "gatewayVlanId", "enabled", + "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2027,6 +2074,7 @@ def updateNetworkApplianceStaticRoute(self, networkId: str, staticRouteId: str, - enabled (boolean): Whether the route should be enabled or not - fixedIpAssignments (object): Fixed DHCP IP assignments on the route - reservedIpRanges (array): DHCP reserved IP ranges + - vrf (object): VRF settings for the static route. """ kwargs.update(locals()) @@ -2047,6 +2095,7 @@ def updateNetworkApplianceStaticRoute(self, networkId: str, staticRouteId: str, "enabled", "fixedIpAssignments", "reservedIpRanges", + "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2264,7 +2313,7 @@ def deleteNetworkApplianceTrafficShapingCustomPerformanceClass(self, networkId: def updateNetworkApplianceTrafficShapingRules(self, networkId: str, **kwargs): """ - **Update the traffic shaping settings rules for an MX network** + **Update the traffic shaping settings rules for a Security Appliance or Secure Router network** https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-traffic-shaping-rules - networkId (string): Network ID @@ -2302,7 +2351,7 @@ def updateNetworkApplianceTrafficShapingRules(self, networkId: str, **kwargs): def getNetworkApplianceTrafficShapingRules(self, networkId: str): """ - **Display the traffic shaping settings rules for an MX network** + **Display the traffic shaping settings rules for a Security Appliance or Secure Router network** https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-traffic-shaping-rules - networkId (string): Network ID @@ -3017,12 +3066,22 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): - enabled (boolean): Boolean value to enable or disable the BGP configuration. When BGP is enabled, the asNumber (ASN) will be autopopulated with the preconfigured ASN at other Hubs or a default value if there is no ASN configured. - asNumber (integer): An Autonomous System Number (ASN) is required if you are to run BGP and peer with another BGP Speaker outside of the Auto VPN domain. This ASN will be applied to the entire Auto VPN domain and is only configurable for Auto VPN BGP networks. The entire 4-byte ASN range is supported. So, the ASN must be an integer between 1 and 4294967295. When absent, this field is not updated. If no value exists then it defaults to 64512. - ibgpHoldTimer (integer): The iBGP holdtimer in seconds. The iBGP holdtimer must be an integer between 12 and 240. When absent, this field is not updated. If no value exists then it defaults to 240. + - ipv6 (object): Settings for IPv6 configurations on the organization. + - tunnelDownTermination (object): Settings for tunnel down termination on the organization. + - localAsNumber (integer): Network-specific local Autonomous System Number (ASN) to which the appliance belongs. This field is only configurable for Independent BGP networks. + - priorityRoute (string): Sets the priority route between eBGP and Auto VPN. - routerId (string): The router ID of the appliance - neighbors (array): List of BGP neighbors. This list replaces the existing set of neighbors. When absent, this field is not updated. """ kwargs.update(locals()) + if "priorityRoute" in kwargs: + options = ["Auto VPN", "eBGP"] + assert kwargs["priorityRoute"] in options, ( + f'''"priorityRoute" cannot be "{kwargs["priorityRoute"]}", & must be set to one of: {options}''' + ) + metadata = { "tags": ["appliance", "configure", "vpn", "bgp"], "operation": "updateNetworkApplianceVpnBgp", @@ -3034,6 +3093,10 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): "enabled", "asNumber", "ibgpHoldTimer", + "ipv6", + "tunnelDownTermination", + "localAsNumber", + "priorityRoute", "routerId", "neighbors", ] @@ -3280,6 +3343,57 @@ def getOrganizationApplianceDevicesInterfacesPortsByDevice(self, organizationId: return self._session.get(metadata, resource, params) + def getOrganizationApplianceDevicesInterfacesPortsProfilesAssignments( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **Returns MX port profile assignments** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-devices-interfaces-ports-profiles-assignments + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - serials (array): Optional device serials to filter by. Results include assignments whose device serial is an exact match for any provided serial. If some requested serials are inaccessible, only accessible matches are returned. Maximum: 50 serials per request. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "devices", "interfaces", "ports", "profiles", "assignments"], + "operation": "getOrganizationApplianceDevicesInterfacesPortsProfilesAssignments", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/devices/interfaces/ports/profiles/assignments" + + query_params = [ + "serials", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "serials", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceDevicesInterfacesPortsProfilesAssignments: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationApplianceDevicesPortsTransceiversReadingsHistoryByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): @@ -4274,6 +4388,766 @@ def updateOrganizationApplianceSecurityIntrusion(self, organizationId: str, allo return self._session.put(metadata, resource, payload) + def getOrganizationApplianceSecurityIntrusionPolicies( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List the intrusion policies configured for an organization along with base policies.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-policies + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - mode (string): Controls which policy set is returned. + - policyIds (array): Identifiers of policies to filter + - search (string): Filter policies by case-insensitive partial match on name or description. + """ + + kwargs.update(locals()) + + if "mode" in kwargs: + options = ["base", "intrusion"] + assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies"], + "operation": "getOrganizationApplianceSecurityIntrusionPolicies", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "mode", + "policyIds", + "search", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceSecurityIntrusionPolicies: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def createOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, **kwargs): + """ + **Create a new intrusion policy for the organization.** + https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy + + - organizationId (string): Organization ID + - policy (object): Attributes for the intrusion policy + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies"], + "operation": "createOrganizationApplianceSecurityIntrusionPolicy", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies" + + body_params = [ + "policy", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"createOrganizationApplianceSecurityIntrusionPolicy: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def getOrganizationApplianceSecurityIntrusionPoliciesOverviews( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List counts for the intrusion and base policies configured for an organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-policies-overviews + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - policyIds (array): Identifiers of policies to filter + - search (string): Filter policy overviews by case-insensitive partial match on policy name or description. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies", "overviews"], + "operation": "getOrganizationApplianceSecurityIntrusionPoliciesOverviews", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/overviews" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "policyIds", + "search", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceSecurityIntrusionPoliciesOverviews: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def updateOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, policyId: str, policy: dict, **kwargs): + """ + **Update a single intrusion policy for the organization.** + https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - policy (object): Attributes for the intrusion policy + """ + + kwargs = locals() + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies"], + "operation": "updateOrganizationApplianceSecurityIntrusionPolicy", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}" + + body_params = [ + "policy", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"updateOrganizationApplianceSecurityIntrusionPolicy: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def deleteOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, policyId: str): + """ + **Delete a single intrusion policy for the organization.** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-policy + + - organizationId (string): Organization ID + - policyId (string): Policy ID + """ + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies"], + "operation": "deleteOrganizationApplianceSecurityIntrusionPolicy", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}" + + return self._session.delete(metadata, resource) + + def declareOrganizationApplianceSecurityIntrusionPolicyRuleGroupsOverrides( + self, organizationId: str, policyId: str, items: list, **kwargs + ): + """ + **Declare the desired rule group overrides for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!declare-organization-appliance-security-intrusion-policy-rule-groups-overrides + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - items (array): Desired overrides state + - mode (string): Controls how the configuration payload in the request body is applied to the resource. This parameter dictates the declarative mode: + + * **`complete`**: The request body represents the entire desired configuration for this resource. Any existing configurations that are not included in the payload will be removed. + * **`partial` (default)**: The request body contains only the configurations to be created or modified. Existing configurations that are not specified in the payload will be preserved. + + - recursive (boolean): Controls how the configuration payload in the request body applies to the rule group hierarchy. When true, the API applies each declared override to the rule group itself and its descendants unless the payload explicitly sets a descendant override. When false (default), the API applies overrides only to the rule groups listed in the payload. + + """ + + kwargs.update(locals()) + + if "mode" in kwargs: + options = ["complete", "partial"] + assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies", "ruleGroups", "overrides"], + "operation": "declareOrganizationApplianceSecurityIntrusionPolicyRuleGroupsOverrides", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + resource = ( + f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/overrides/declare" + ) + + body_params = [ + "mode", + "recursive", + "items", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"declareOrganizationApplianceSecurityIntrusionPolicyRuleGroupsOverrides: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def createOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride( + self, organizationId: str, policyId: str, ruleGroupId: str, override: dict, **kwargs + ): + """ + **Create a rule group override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy-rule-group-override + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - ruleGroupId (string): Rule group ID + - override (object): Attributes for the override for a rule group in a intrusion policy + """ + + kwargs = locals() + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies", "ruleGroups", "override"], + "operation": "createOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + ruleGroupId = urllib.parse.quote(str(ruleGroupId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/{ruleGroupId}/override" + + body_params = [ + "override", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"createOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def updateOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride( + self, organizationId: str, policyId: str, ruleGroupId: str, override: dict, **kwargs + ): + """ + **Update a rule group override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy-rule-group-override + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - ruleGroupId (string): Rule group ID + - override (object): Attributes for the override for a rule group in a intrusion policy + """ + + kwargs = locals() + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies", "ruleGroups", "override"], + "operation": "updateOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + ruleGroupId = urllib.parse.quote(str(ruleGroupId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/{ruleGroupId}/override" + + body_params = [ + "override", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"updateOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def declareOrganizationApplianceSecurityIntrusionPolicyRulesOverrides( + self, organizationId: str, policyId: str, items: list, **kwargs + ): + """ + **Declare the desired rule overrides for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!declare-organization-appliance-security-intrusion-policy-rules-overrides + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - items (array): Desired overrides state + - mode (string): Controls how the configuration payload in the request body is applied to the resource. This parameter dictates the declarative mode: + + * **`complete`**: The request body represents the entire desired configuration for this resource. Any existing configurations that are not included in the payload will be removed. This effectively performs a full replacement or overwrite of the resource's configuration. + * **`partial` (default)**: The request body contains only the configurations to be created or modified. Existing configurations that are not specified in the payload will be preserved. This performs a merge or partial update, applying only the changes specified. + + """ + + kwargs.update(locals()) + + if "mode" in kwargs: + options = ["complete", "partial"] + assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies", "rules", "overrides"], + "operation": "declareOrganizationApplianceSecurityIntrusionPolicyRulesOverrides", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/overrides/declare" + + body_params = [ + "mode", + "items", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"declareOrganizationApplianceSecurityIntrusionPolicyRulesOverrides: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def createOrganizationApplianceSecurityIntrusionPolicyRuleOverride( + self, organizationId: str, policyId: str, ruleId: str, override: dict, **kwargs + ): + """ + **Create a rule override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy-rule-override + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - ruleId (string): Rule ID + - override (object): Rule override to create + """ + + kwargs = locals() + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies", "rules", "override"], + "operation": "createOrganizationApplianceSecurityIntrusionPolicyRuleOverride", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + ruleId = urllib.parse.quote(str(ruleId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/{ruleId}/override" + + body_params = [ + "override", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"createOrganizationApplianceSecurityIntrusionPolicyRuleOverride: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def updateOrganizationApplianceSecurityIntrusionPolicyRuleOverride( + self, organizationId: str, policyId: str, ruleId: str, override: dict, **kwargs + ): + """ + **Update a rule override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy-rule-override + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - ruleId (string): Rule ID + - override (object): Override attributes + """ + + kwargs = locals() + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies", "rules", "override"], + "operation": "updateOrganizationApplianceSecurityIntrusionPolicyRuleOverride", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + ruleId = urllib.parse.quote(str(ruleId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/{ruleId}/override" + + body_params = [ + "override", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"updateOrganizationApplianceSecurityIntrusionPolicyRuleOverride: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def getOrganizationApplianceSecurityIntrusionRuleGroups( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List the rule groups that belong to a security policy.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rule-groups + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 500. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - policyIds (array): Collection of base or intrusion policy identifiers to filter results by + - parentRuleGroupIds (array): Filter results to rule groups whose parent matches any of the provided identifiers + - search (string): Case-insensitive text filter applied to rule group name and description + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups"], + "operation": "getOrganizationApplianceSecurityIntrusionRuleGroups", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "policyIds", + "parentRuleGroupIds", + "search", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + "parentRuleGroupIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceSecurityIntrusionRuleGroups: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationApplianceSecurityIntrusionRuleGroupsOverrides( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List the rule group overrides configured for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rule-groups-overrides + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - policyIds (array): Collection of intrusion policy identifiers to filter the overrides by. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups", "overrides"], + "operation": "getOrganizationApplianceSecurityIntrusionRuleGroupsOverrides", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups/overrides" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "policyIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceSecurityIntrusionRuleGroupsOverrides: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def deleteOrganizationApplianceSecurityIntrusionRuleGroupsOverride(self, organizationId: str, overrideId: str): + """ + **Delete a rule group override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-rule-groups-override + + - organizationId (string): Organization ID + - overrideId (string): Override ID + """ + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups", "overrides"], + "operation": "deleteOrganizationApplianceSecurityIntrusionRuleGroupsOverride", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + overrideId = urllib.parse.quote(str(overrideId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups/overrides/{overrideId}" + + return self._session.delete(metadata, resource) + + def getOrganizationApplianceSecurityIntrusionRuleGroupsOverviews( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List counts for the child rule groups and rules for each rule group in a security policy.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rule-groups-overviews + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 500. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - policyIds (array): Collection of base or intrusion policy identifiers to filter results by + - parentRuleGroupIds (array): Filter results to rule groups whose parent matches any of the provided identifiers + - search (string): Case-insensitive text filter applied to rule group name and description + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups", "overviews"], + "operation": "getOrganizationApplianceSecurityIntrusionRuleGroupsOverviews", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups/overviews" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "policyIds", + "parentRuleGroupIds", + "search", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + "parentRuleGroupIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceSecurityIntrusionRuleGroupsOverviews: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationApplianceSecurityIntrusionRules(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **List the rules that belong to a security policy.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rules + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 500. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - policyIds (array): Identifiers of the base or intrusion policies to query + - parentRuleGroupIds (array): Filter results to rules that belong to any of the specified rule groups + - search (string): Case-insensitive text filter applied to rule name and description + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "rules"], + "operation": "getOrganizationApplianceSecurityIntrusionRules", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/rules" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "policyIds", + "parentRuleGroupIds", + "search", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + "parentRuleGroupIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceSecurityIntrusionRules: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationApplianceSecurityIntrusionRulesOverrides( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List the rule overrides configured for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rules-overrides + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - policyIds (array): Identifiers of intrusion policies to filter + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "rules", "overrides"], + "operation": "getOrganizationApplianceSecurityIntrusionRulesOverrides", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/rules/overrides" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "policyIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceSecurityIntrusionRulesOverrides: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def deleteOrganizationApplianceSecurityIntrusionRulesOverride(self, organizationId: str, overrideId: str): + """ + **Delete a rule override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-rules-override + + - organizationId (string): Organization ID + - overrideId (string): Override ID + """ + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "rules", "overrides"], + "operation": "deleteOrganizationApplianceSecurityIntrusionRulesOverride", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + overrideId = urllib.parse.quote(str(overrideId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/rules/overrides/{overrideId}" + + return self._session.delete(metadata, resource) + def getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork( self, organizationId: str, total_pages=1, direction="next", **kwargs ): @@ -4327,7 +5201,7 @@ def getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork( def getOrganizationApplianceUplinkStatuses(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **List the uplink status of every Meraki MX and Z series appliances in the organization** + **List the uplink status of every Meraki MX appliance, Z series appliance, and Secure Router in the organization** https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-uplink-statuses - organizationId (string): Organization ID diff --git a/meraki/aio/api/campusGateway.py b/meraki/aio/api/campusGateway.py index e7ccac9..edfa405 100644 --- a/meraki/aio/api/campusGateway.py +++ b/meraki/aio/api/campusGateway.py @@ -740,6 +740,7 @@ def getOrganizationCampusGatewayConnections(self, organizationId: str, total_pag - campusGatewaySerials (array): Optional parameter to filter connections(APs) by MCG serials. This filter uses multiple exact matches. - campusGatewayClusterIds (array): Optional parameter to filter connections(APs) by MCG cluster IDs. This filter uses multiple exact matches. - campusGatewayTunnelStatuses (array): Optional parameter to filter connections(APs) by tunnel statuses. This filter uses multiple exact matches. + - campusGatewayPriorities (array): Optional parameter to filter connections(APs) by Campus Gateway tunnel priority. Use 0 for primary or 1 for backup. This filter uses multiple exact matches. - search (string): Optional parameter to filter connections(APs) on AP name, serial, MAC address, network name, or interface IP address. This filter uses partial string matching (ILIKE). - models (array): Optional parameter to filter connections(APs) by device model names. This filter uses multiple exact matches. - dataEncryptionStatuses (array): Optional parameter to filter connections(APs) by data encryption status. This filter uses multiple exact matches. @@ -776,6 +777,7 @@ def getOrganizationCampusGatewayConnections(self, organizationId: str, total_pag "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "search", "models", "dataEncryptionStatuses", @@ -793,6 +795,7 @@ def getOrganizationCampusGatewayConnections(self, organizationId: str, total_pag "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "models", "dataEncryptionStatuses", ] @@ -822,6 +825,7 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * - campusGatewaySerials (array): Optional parameter to filter connections(APs) by Campus Gateway serials. This filter uses multiple exact matches. - campusGatewayClusterIds (array): Optional parameter to filter connections(APs) by Campus Gateway cluster IDs. This filter uses multiple exact matches. - campusGatewayTunnelStatuses (array): Optional parameter to filter connections(APs) by tunnel statuses. This filter uses multiple exact matches. + - campusGatewayPriorities (array): Optional parameter to filter connections(APs) by Campus Gateway tunnel priority. Use 0 for primary or 1 for backup. This filter uses multiple exact matches. - search (string): Optional setting that lets you filter access points (APs) by name, serial number, MAC address, network name, or interface IP address. The filter matches partial text, not just exact values (uses ILIKE matching). - models (array): Optional parameter to filter connections(APs) by device model names. This filter uses multiple exact matches. - dataEncryptionStatuses (array): Optional parameter to filter connections(APs) by data encryption status. This filter uses multiple exact matches. @@ -842,6 +846,7 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "search", "models", "dataEncryptionStatuses", @@ -854,6 +859,7 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "models", "dataEncryptionStatuses", ] @@ -872,6 +878,58 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * return self._session.get(metadata, resource, params) + def getOrganizationCampusGatewayDevicesSystemCpuLoad(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **Return the latest CPU load averages reported by Campus Gateway devices.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-devices-system-cpu-load + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - networkIds (array): Optional exact-match network filters. Accepts both node group (N_) and locale (L_) network IDs. + - serials (array): Optional exact-match Campus Gateway serial filters. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["campusGateway", "monitor", "devices", "system", "cpu", "load"], + "operation": "getOrganizationCampusGatewayDevicesSystemCpuLoad", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/campusGateway/devices/system/cpu/load" + + query_params = [ + "networkIds", + "serials", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "serials", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationCampusGatewayDevicesSystemCpuLoad: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationCampusGatewayDevicesUplinksLocalOverridesByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): diff --git a/meraki/aio/api/networks.py b/meraki/aio/api/networks.py index 0ab1278..bb3fd5d 100644 --- a/meraki/aio/api/networks.py +++ b/meraki/aio/api/networks.py @@ -3050,9 +3050,10 @@ def createNetworkVlanProfile(self, networkId: str, name: str, vlanNames: list, v - vlanNames (array): An array of named VLANs - vlanGroups (array): An array of VLAN groups - iname (string): IName of the profile + - activeVlans (string): The active VLANs for the VLAN profile. Only applicable to trunk ports. The given range must be inclusive of all named VLANs. """ - kwargs = locals() + kwargs.update(locals()) metadata = { "tags": ["networks", "configure", "vlanProfiles"], @@ -3063,6 +3064,7 @@ def createNetworkVlanProfile(self, networkId: str, name: str, vlanNames: list, v body_params = [ "name", + "activeVlans", "vlanNames", "vlanGroups", "iname", @@ -3198,9 +3200,10 @@ def updateNetworkVlanProfile(self, networkId: str, iname: str, name: str, vlanNa - name (string): Name of the profile, string length must be from 1 to 255 characters - vlanNames (array): An array of named VLANs - vlanGroups (array): An array of VLAN groups + - activeVlans (string): The active VLANs for the VLAN profile. Only applicable to trunk ports. The given range must be inclusive of all named VLANs. """ - kwargs = locals() + kwargs.update(locals()) metadata = { "tags": ["networks", "configure", "vlanProfiles"], @@ -3212,6 +3215,7 @@ def updateNetworkVlanProfile(self, networkId: str, iname: str, name: str, vlanNa body_params = [ "name", + "activeVlans", "vlanNames", "vlanGroups", ] diff --git a/meraki/aio/api/organizations.py b/meraki/aio/api/organizations.py index 5c6bd5e..b0e328f 100644 --- a/meraki/aio/api/organizations.py +++ b/meraki/aio/api/organizations.py @@ -1083,6 +1083,62 @@ def deleteOrganizationAlertsProfile(self, organizationId: str, alertConfigId: st return self._session.delete(metadata, resource) + def getOrganizationApiRestProvisioningPipelines(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **List pipelines with operation and status metadata, sorted by pipeline ID** + https://developer.cisco.com/meraki/api-v1/#!get-organization-api-rest-provisioning-pipelines + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'descending'. + - status (string): If provided, filters pipelines by status. If omitted, pipelines of all statuses are returned. `pending` pipelines have not started, `active` pipelines have started but not finished, `success` pipelines completed successfully, and `error` pipelines failed. + - timespan (integer): Created-at lookback for matching pipelines, in seconds. Defaults to 7200 seconds. The maximum is 30 days. + """ + + kwargs.update(locals()) + + if "sortOrder" in kwargs: + options = ["ascending", "descending"] + assert kwargs["sortOrder"] in options, ( + f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' + ) + if "status" in kwargs: + options = ["active", "error", "pending", "success"] + assert kwargs["status"] in options, ( + f'''"status" cannot be "{kwargs["status"]}", & must be set to one of: {options}''' + ) + + metadata = { + "tags": ["organizations", "configure", "api", "rest", "provisioning", "pipelines"], + "operation": "getOrganizationApiRestProvisioningPipelines", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/api/rest/provisioning/pipelines" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "sortOrder", + "status", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApiRestProvisioningPipelines: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationApiRestProvisioningPipelinesJobs(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **List pipeline jobs, with optional status filtering** @@ -2057,6 +2113,7 @@ def createOrganizationBrandingPolicy(self, organizationId: str, name: str, **kwa - organizationId (string): Organization ID - name (string): Name of the Dashboard branding policy. - enabled (boolean): Boolean indicating whether this policy is enabled. + - appearance (object): Dashboard appearance settings. - adminSettings (object): Settings for describing which kinds of admins this policy applies to. - helpSettings (object): Settings for describing the modifications to various Help page features. Each property in this object accepts one of 'default or inherit' (do not modify functionality), 'hide' (remove the section from Dashboard), or 'show' (always show @@ -2078,6 +2135,7 @@ def createOrganizationBrandingPolicy(self, organizationId: str, name: str, **kwa body_params = [ "name", "enabled", + "appearance", "adminSettings", "helpSettings", "customLogo", @@ -2171,6 +2229,7 @@ def updateOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId - brandingPolicyId (string): Branding policy ID - name (string): Name of the Dashboard branding policy. - enabled (boolean): Boolean indicating whether this policy is enabled. + - appearance (object): Dashboard appearance settings. - adminSettings (object): Settings for describing which kinds of admins this policy applies to. - helpSettings (object): Settings for describing the modifications to various Help page features. Each property in this object accepts one of 'default or inherit' (do not modify functionality), 'hide' (remove the section from Dashboard), or 'show' (always show @@ -2193,6 +2252,7 @@ def updateOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId body_params = [ "name", "enabled", + "appearance", "adminSettings", "helpSettings", "customLogo", @@ -2308,7 +2368,7 @@ def getOrganizationClientsBandwidthUsageHistory(self, organizationId: str, **kwa def getOrganizationClientsOverview(self, organizationId: str, **kwargs): """ - **Return summary information around client data usage (in kb) across the given organization.** + **Return summary information around client data usage in MiB across the given organization.** https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-overview - organizationId (string): Organization ID @@ -5884,6 +5944,7 @@ def getOrganizationNetworksGroups(self, organizationId: str, total_pages=1, dire - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - groupIds (array): Optional parameter to filter network groups by ID + - search (string): Optional parameter to filter network groups by a case-insensitive partial group name match - 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. @@ -5900,6 +5961,7 @@ def getOrganizationNetworksGroups(self, organizationId: str, total_pages=1, dire query_params = [ "groupIds", + "search", "perPage", "startingAfter", "endingBefore", @@ -6923,6 +6985,7 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( - rulesetId (string): ID of the ruleset to assign - policyId (string): ID of the policy to assign the ruleset to - priority (integer): Priority of the ruleset assignment (lower numbers = higher priority) + - staged (boolean): Stage an assignment without applying it immediately to the policy """ kwargs.update(locals()) @@ -6938,6 +7001,7 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( "rulesetId", "policyId", "priority", + "staged", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -6951,6 +7015,41 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( return self._session.post(metadata, resource, payload) + def commitOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments( + self, organizationId: str, policy: dict, **kwargs + ): + """ + **Commit staged Organization-Wide Policy Ruleset Assignments** + https://developer.cisco.com/meraki/api-v1/#!commit-organization-policies-global-group-policies-firewall-rulesets-assignments + + - organizationId (string): Organization ID + - policy (object): Policy in which all staged rulesets will be committed + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "policies", "global", "group", "firewall", "rulesets", "assignments"], + "operation": "commitOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/policies/global/group/policies/firewall/rulesets/assignments/commit" + + body_params = [ + "policy", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"commitOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + def updateOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( self, organizationId: str, assignmentId: str, **kwargs ): @@ -7015,6 +7114,199 @@ def deleteOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment(self return self._session.delete(metadata, resource) + def getOrganizationPoliciesGlobalGroupPoliciesNetworks( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List all available Network Enforcement Targets for an Organization and their associated Organization-Wide Policies if applicable** + https://developer.cisco.com/meraki/api-v1/#!get-organization-policies-global-group-policies-networks + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - policyIds (array): Filter network enforcement targets by policy IDs + - networkIds (array): Filter network enforcement targets by network IDs + - firewallTypes (array): Filter network enforcement targets by firewall enforcement types for a network + - name (string): Filter network enforcement targets by network name with support for partial matches. Case insensitive. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 100. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "policies", "global", "group", "networks"], + "operation": "getOrganizationPoliciesGlobalGroupPoliciesNetworks", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/policies/global/group/policies/networks" + + query_params = [ + "policyIds", + "networkIds", + "firewallTypes", + "name", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + "networkIds", + "firewallTypes", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationPoliciesGlobalGroupPoliciesNetworks: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationPoliciesGlobalGroupPoliciesNetworksAssignments( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List Network Enforcement Target Assignments for Organization-Wide policies for the specified organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-policies-global-group-policies-networks-assignments + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - assignmentIds (array): Filter network enforcement target assignments by assignment IDs + - policyIds (array): Filter network enforcement target assignments by policy IDs + - networkIds (array): Filter network enforcement target assignments by network IDs + - firewallTypes (array): Filter network enforcement target assignments by firewall enforcement types for a network + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 100. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "policies", "global", "group", "networks", "assignments"], + "operation": "getOrganizationPoliciesGlobalGroupPoliciesNetworksAssignments", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/policies/global/group/policies/networks/assignments" + + query_params = [ + "assignmentIds", + "policyIds", + "networkIds", + "firewallTypes", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "assignmentIds", + "policyIds", + "networkIds", + "firewallTypes", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationPoliciesGlobalGroupPoliciesNetworksAssignments: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def bulkOrganizationPoliciesGlobalGroupPoliciesNetworksAssignmentsAssign( + self, organizationId: str, policy: dict, targets: list, **kwargs + ): + """ + **Assign Network Enforcement Targets to an Organization-Wide Policy** + https://developer.cisco.com/meraki/api-v1/#!bulk-organization-policies-global-group-policies-networks-assignments-assign + + - organizationId (string): Organization ID + - policy (object): Policy to assign network enforcement targets to + - targets (array): Network enforcement targets to assign to the specified policy. Maximum 1000 per request. + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "policies", "global", "group", "networks", "assignments"], + "operation": "bulkOrganizationPoliciesGlobalGroupPoliciesNetworksAssignmentsAssign", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/policies/global/group/policies/networks/assignments/bulkAssign" + + body_params = [ + "policy", + "targets", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"bulkOrganizationPoliciesGlobalGroupPoliciesNetworksAssignmentsAssign: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def bulkOrganizationPoliciesGlobalGroupPoliciesNetworksAssignmentsDelete( + self, organizationId: str, policy: dict, targets: list, **kwargs + ): + """ + **Remove Network Enforcement Targets from an Organization-Wide Policy** + https://developer.cisco.com/meraki/api-v1/#!bulk-organization-policies-global-group-policies-networks-assignments-delete + + - organizationId (string): Organization ID + - policy (object): Policy to remove network enforcement targets from + - targets (array): Network enforcement targets to remove for the specified policy. Maximum 1000 per request. + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "policies", "global", "group", "networks", "assignments"], + "operation": "bulkOrganizationPoliciesGlobalGroupPoliciesNetworksAssignmentsDelete", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/policies/global/group/policies/networks/assignments/bulkDelete" + + body_params = [ + "policy", + "targets", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"bulkOrganizationPoliciesGlobalGroupPoliciesNetworksAssignmentsDelete: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + def updateOrganizationPoliciesGlobalGroupPolicy(self, organizationId: str, policyId: str, **kwargs): """ **Update an Organization-Wide Policy** @@ -8096,7 +8388,7 @@ def updateOrganizationSnmp(self, organizationId: str, **kwargs): - 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'. + - v3AuthMode (string): The SNMP version 3 authentication mode. Can be one of 'SHA', 'MD5', 'SHA256', 'SHA384', or 'SHA512'. MD5 is not supported in the Cisco Meraki US Government Region. - 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. @@ -8106,7 +8398,7 @@ def updateOrganizationSnmp(self, organizationId: str, **kwargs): kwargs.update(locals()) if "v3AuthMode" in kwargs: - options = ["MD5", "SHA"] + options = ["MD5", "SHA", "SHA256", "SHA384", "SHA512"] assert kwargs["v3AuthMode"] in options, ( f'''"v3AuthMode" cannot be "{kwargs["v3AuthMode"]}", & must be set to one of: {options}''' ) @@ -8284,6 +8576,226 @@ def createOrganizationSplashThemeAsset(self, organizationId: str, themeIdentifie return self._session.post(metadata, resource, payload) + def getOrganizationSummarySustainabilityDailyConsumerMetricsNetworks(self, organizationId: str, **kwargs): + """ + **Lists daily consumer metrics for networks.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-daily-consumer-metrics-networks + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for 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 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "dailyConsumerMetrics", "networks"], + "operation": "getOrganizationSummarySustainabilityDailyConsumerMetricsNetworks", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/dailyConsumerMetrics/networks" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilityDailyConsumerMetricsNetworks: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategories(self, organizationId: str): + """ + **Lists available device categories for sustainability metrics with their corresponding device types.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-device-categories + + - organizationId (string): Organization ID + """ + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "summaryConsumerMetrics", "deviceCategories"], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategories", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/deviceCategories" + + return self._session.get(metadata, resource) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategoriesAggregated( + self, organizationId: str, **kwargs + ): + """ + **Lists summary consumer metrics aggregated by device category.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-device-categories-aggregated + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for 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 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": [ + "organizations", + "configure", + "summary", + "sustainability", + "summaryConsumerMetrics", + "deviceCategories", + "aggregated", + ], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategoriesAggregated", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/deviceCategories/aggregated" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategoriesAggregated: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsDevices(self, organizationId: str, **kwargs): + """ + **Lists summary consumer metrics for devices.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-devices + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for 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 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "summaryConsumerMetrics", "devices"], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsDevices", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/devices" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsDevices: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworks(self, organizationId: str, **kwargs): + """ + **Lists summary consumer metrics for networks.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-networks + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for 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 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "summaryConsumerMetrics", "networks"], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworks", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/networks" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworks: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworksAggregated(self, organizationId: str, **kwargs): + """ + **Returns aggregated consumer metrics for all networks in the organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-networks-aggregated + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for 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 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": [ + "organizations", + "configure", + "summary", + "sustainability", + "summaryConsumerMetrics", + "networks", + "aggregated", + ], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworksAggregated", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/networks/aggregated" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworksAggregated: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, **kwargs): """ **Return the top 10 appliances sorted by utilization over given time range.** diff --git a/meraki/aio/api/switch.py b/meraki/aio/api/switch.py index 918913b..2d31ddf 100644 --- a/meraki/aio/api/switch.py +++ b/meraki/aio/api/switch.py @@ -146,7 +146,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - serial (string): Serial - portId (string): Port ID - - name (string): The name of the switch port. + - name (string): The name of the switch port. Dashboard displays this value as the port description. For Cisco Catalyst switches running IOS XE, it corresponds to the configured interface description. - tags (array): The list of tags of the switch port. - enabled (boolean): The status of the switch port. - poeEnabled (boolean): The PoE status of the switch port. @@ -311,6 +311,7 @@ def createDeviceSwitchRoutingInterface(self, serial: str, name: str, **kwargs): - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher - loopback (object): The loopback settings of the interface. + - bidirectionalForwardingDetection (object): BFD configuration for the L3 interface. """ kwargs.update(locals()) @@ -345,6 +346,7 @@ def createDeviceSwitchRoutingInterface(self, serial: str, name: str, **kwargs): "ipv6", "vrf", "loopback", + "bidirectionalForwardingDetection", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -394,6 +396,7 @@ def updateDeviceSwitchRoutingInterface(self, serial: str, interfaceId: str, **kw - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher - loopback (object): The loopback settings of the interface. + - bidirectionalForwardingDetection (object): BFD configuration for the L3 interface. """ kwargs.update(locals()) @@ -425,6 +428,7 @@ def updateDeviceSwitchRoutingInterface(self, serial: str, interfaceId: str, **kw "ipv6", "vrf", "loopback", + "bidirectionalForwardingDetection", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -497,6 +501,8 @@ def updateDeviceSwitchRoutingInterfaceDhcp(self, serial: str, interfaceId: str, - dhcpOptions (array): Array of DHCP options consisting of code, type and value for the DHCP server running on the switch interface - reservedIpRanges (array): Array of DHCP reserved IP assignments for the DHCP server running on the switch interface - fixedIpAssignments (array): Array of DHCP fixed IP assignments for the DHCP server running on the switch interface + - dhcpDefaultRouterIps (string): The DHCP default router IPs for the DHCP server running on the switch interface + - dhcpDomainName (string): The DHCP domain name for the DHCP server running on the switch interface """ kwargs.update(locals()) @@ -537,6 +543,8 @@ def updateDeviceSwitchRoutingInterfaceDhcp(self, serial: str, interfaceId: str, "dhcpOptions", "reservedIpRanges", "fixedIpAssignments", + "dhcpDefaultRouterIps", + "dhcpDomainName", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2439,6 +2447,7 @@ def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher - loopback (object): The loopback settings of the interface. + - bidirectionalForwardingDetection (object): BFD configuration for the L3 interface. """ kwargs.update(locals()) @@ -2474,6 +2483,7 @@ def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId "ipv6", "vrf", "loopback", + "bidirectionalForwardingDetection", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2528,6 +2538,7 @@ def updateNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher - loopback (object): The loopback settings of the interface. + - bidirectionalForwardingDetection (object): BFD configuration for the L3 interface. """ kwargs.update(locals()) @@ -2560,6 +2571,7 @@ def updateNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId "ipv6", "vrf", "loopback", + "bidirectionalForwardingDetection", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2640,6 +2652,8 @@ def updateNetworkSwitchStackRoutingInterfaceDhcp(self, networkId: str, switchSta switch stack interface - reservedIpRanges (array): Array of DHCP reserved IP assignments for the DHCP server running on the switch stack interface - fixedIpAssignments (array): Array of DHCP fixed IP assignments for the DHCP server running on the switch stack interface + - dhcpDefaultRouterIps (string): The DHCP default router IPs for the DHCP server running on the switch stack interface + - dhcpDomainName (string): The DHCP domain name for the DHCP server running on the switch stack interface """ kwargs.update(locals()) @@ -2681,6 +2695,8 @@ def updateNetworkSwitchStackRoutingInterfaceDhcp(self, networkId: str, switchSta "dhcpOptions", "reservedIpRanges", "fixedIpAssignments", + "dhcpDefaultRouterIps", + "dhcpDomainName", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -3033,10 +3049,12 @@ def updateOrganizationConfigTemplateSwitchProfilePort( - configTemplateId (string): Config template ID - profileId (string): Profile ID - portId (string): Port ID - - name (string): The name of the switch template port. + - name (string): The name of the switch template port. Dashboard displays this value as the port description. For Cisco Catalyst switches running IOS XE, it corresponds to the configured interface description. - tags (array): The list of tags of the switch template port. - enabled (boolean): The status of the switch template port. - poeEnabled (boolean): The PoE status of the switch template port. + - perpetualPoe (object): Perpetual PoE settings for the switch template port. + - fastPoe (object): Fast PoE settings for the switch template port. - type (string): The type of the switch template port ('access', 'trunk', 'stack', 'routed', 'svl' or 'dad'). - vlan (integer): The VLAN of the switch template port. For a trunk port, this is the native VLAN. A null value will clear the value set for trunk ports. - voiceVlan (integer): The voice VLAN of the switch template port. Only applicable to access ports. @@ -3099,6 +3117,8 @@ def updateOrganizationConfigTemplateSwitchProfilePort( "tags", "enabled", "poeEnabled", + "perpetualPoe", + "fastPoe", "type", "vlan", "voiceVlan", diff --git a/meraki/aio/api/wireless.py b/meraki/aio/api/wireless.py index af0b69f..3313468 100644 --- a/meraki/aio/api/wireless.py +++ b/meraki/aio/api/wireless.py @@ -167,7 +167,7 @@ def updateDeviceWirelessElectronicShelfLabel(self, serial: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-electronic-shelf-label - serial (string): Serial - - channel (string): Desired ESL channel for the device, or 'Auto' (case insensitive) to use the recommended channel + - channel (string): Desired ESL channel for the device. Only configurable for devices assigned the High frequency ESL or sepioo IIoT role. Use 'Auto' (case insensitive) to use the recommended channel - enabled (boolean): Turn ESL features on and off for this device """ @@ -2278,6 +2278,37 @@ def getNetworkWirelessSsids(self, networkId: str): return self._session.get(metadata, resource) + def updateNetworkWirelessSsidsOwe(self, networkId: str, transitions: list, **kwargs): + """ + **Update the OWE transition pairs for a network** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ssids-owe + + - networkId (string): Network ID + - transitions (array): Array of OWE transition pairs + """ + + kwargs = locals() + + metadata = { + "tags": ["wireless", "configure", "ssids", "owe"], + "operation": "updateNetworkWirelessSsidsOwe", + } + networkId = urllib.parse.quote(str(networkId), safe="") + resource = f"/networks/{networkId}/wireless/ssids/owe" + + body_params = [ + "transitions", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"updateNetworkWirelessSsidsOwe: ignoring unrecognized kwargs: {invalid}") + + return self._session.put(metadata, resource, payload) + def getNetworkWirelessSsid(self, networkId: str, number: str): """ **Return a single MR SSID** @@ -3072,6 +3103,58 @@ def updateNetworkWirelessSsidOpenRoaming(self, networkId: str, number: str, **kw return self._session.put(metadata, resource, payload) + def getNetworkWirelessSsidOverrides(self, networkId: str, number: str): + """ + **Display the overrides for this SSID** + https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-ssid-overrides + + - networkId (string): Network ID + - number (string): Number + """ + + metadata = { + "tags": ["wireless", "configure", "ssids", "overrides"], + "operation": "getNetworkWirelessSsidOverrides", + } + networkId = urllib.parse.quote(str(networkId), safe="") + number = urllib.parse.quote(str(number), safe="") + resource = f"/networks/{networkId}/wireless/ssids/{number}/overrides" + + return self._session.get(metadata, resource) + + def updateNetworkWirelessSsidOverrides(self, networkId: str, number: str, **kwargs): + """ + **Update the overrides for this SSID** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ssid-overrides + + - networkId (string): Network ID + - number (string): Number + - ccxNameIeEnabled (boolean): When true, enables CCX name IE, which allows the AP to broadcast its device name as part of its beacon (as defined by the network admin in the Dashboard). + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "configure", "ssids", "overrides"], + "operation": "updateNetworkWirelessSsidOverrides", + } + networkId = urllib.parse.quote(str(networkId), safe="") + number = urllib.parse.quote(str(number), safe="") + resource = f"/networks/{networkId}/wireless/ssids/{number}/overrides" + + body_params = [ + "ccxNameIeEnabled", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"updateNetworkWirelessSsidOverrides: ignoring unrecognized kwargs: {invalid}") + + return self._session.put(metadata, resource, payload) + def getNetworkWirelessSsidSchedules(self, networkId: str, number: str): """ **List the outage schedule for the SSID** @@ -5619,6 +5702,55 @@ def getOrganizationWirelessSsidsOpenRoamingByNetwork(self, organizationId: str, return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationWirelessSsidsOweByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **Returns an array of objects, each containing OWE transition pairs for the corresponding network** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-owe-by-network + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Optional parameter to filter OWE transition configuration by Network Id. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "configure", "ssids", "owe", "byNetwork"], + "operation": "getOrganizationWirelessSsidsOweByNetwork", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/ssids/owe/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"getOrganizationWirelessSsidsOweByNetwork: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationWirelessSsidsProfiles(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Returns the SSID profiles for an organization** @@ -5921,9 +6053,12 @@ def getOrganizationWirelessSsidsProfilesOverviews(self, organizationId: str, tot - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - name (string): (Optional) Filter results by name. Case insensitive substring match. - - sortBy (string): Column to sort results by. Default is `name`. - - sortOrder (string): Direction to sort results by. Default is `asc`. + - sortBy (string): Sort by `name` or `attached`. Default is `name`. For `attached`, provide `networkIds` and `ssidNumbers`. With `sortOrder=asc`, attached profile is first. With `sortOrder=desc`, it is last. + - sortOrder (string): Sort direction for either `sortBy` mode. Default is `asc`. - profileIds (array): (Optional) Filter results by a list of SSID profile IDs. + - networkIds (array): (Optional) Network ID for the selected SSID. Provide one value. Required when `attachable` is true. + - ssidNumbers (array): (Optional) SSID number (0-14) for the selected SSID. Provide one value. Required when `attachable` is true. + - attachable (boolean): (Optional) When true, returns profiles not assigned to another SSID in the selected network. Includes the currently attached profile. Requires `networkIds` and `ssidNumbers`. - 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. @@ -5932,7 +6067,7 @@ def getOrganizationWirelessSsidsProfilesOverviews(self, organizationId: str, tot kwargs.update(locals()) if "sortBy" in kwargs: - options = ["name"] + options = ["attached", "name"] assert kwargs["sortBy"] in options, ( f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' ) @@ -5954,6 +6089,9 @@ def getOrganizationWirelessSsidsProfilesOverviews(self, organizationId: str, tot "sortBy", "sortOrder", "profileIds", + "networkIds", + "ssidNumbers", + "attachable", "perPage", "startingAfter", "endingBefore", @@ -5962,6 +6100,8 @@ def getOrganizationWirelessSsidsProfilesOverviews(self, organizationId: str, tot array_params = [ "profileIds", + "networkIds", + "ssidNumbers", ] for k, v in kwargs.items(): if k.strip() in array_params: diff --git a/meraki/api/appliance.py b/meraki/api/appliance.py index 248e6d3..443d93e 100644 --- a/meraki/api/appliance.py +++ b/meraki/api/appliance.py @@ -34,6 +34,7 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): - personality (object): Describes the port's configurability - uplink (object): The port's settings when in WAN mode - downlink (object): The port's VLAN settings when in LAN mode + - profile (object): The optional LAN port's profile which it inherits from """ kwargs.update(locals()) @@ -51,6 +52,7 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): "personality", "uplink", "downlink", + "profile", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -64,6 +66,47 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): return self._session.post(metadata, resource, payload) + def updateDeviceApplianceInterfacesPort(self, serial: str, number: str, **kwargs): + """ + **Update configurations for an appliance's specified port** + https://developer.cisco.com/meraki/api-v1/#!update-device-appliance-interfaces-port + + - serial (string): Serial + - number (string): Number + - enabled (boolean): Indicates whether the port is enabled + - personality (object): Describes the port's configurability + - uplink (object): The port's settings when in WAN mode + - downlink (object): The port's VLAN settings when in LAN mode + - profile (object): The optional LAN port's profile which it inherits from + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "interfaces", "ports"], + "operation": "updateDeviceApplianceInterfacesPort", + } + serial = urllib.parse.quote(str(serial), safe="") + number = urllib.parse.quote(str(number), safe="") + resource = f"/devices/{serial}/appliance/interfaces/ports/{number}" + + body_params = [ + "enabled", + "personality", + "uplink", + "downlink", + "profile", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"updateDeviceApplianceInterfacesPort: ignoring unrecognized kwargs: {invalid}") + + return self._session.put(metadata, resource, payload) + def getDeviceAppliancePerformance(self, serial: str, **kwargs): """ **Return the performance score for a single Secure Appliance or Secure Router** @@ -1618,6 +1661,7 @@ def updateNetworkApplianceSecurityIntrusion(self, networkId: str, **kwargs): - networkId (string): Network ID - mode (string): Set mode to 'disabled'/'detection'/'prevention' (optional - omitting will leave current config unchanged) - idsRulesets (string): Set the detection ruleset 'connectivity'/'balanced'/'security' (optional - omitting will leave current config unchanged). Default value is 'balanced' if none currently saved + - policy (object): Set a custom intrusion policy by id (optional - omitting will leave current config unchanged) - protectedNetworks (object): Set the included/excluded networks from the intrusion engine (optional - omitting will leave current config unchanged). This is available only in 'passthrough' mode """ @@ -1642,6 +1686,7 @@ def updateNetworkApplianceSecurityIntrusion(self, networkId: str, **kwargs): body_params = [ "mode", "idsRulesets", + "policy", "protectedNetworks", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1966,6 +2011,7 @@ def createNetworkApplianceStaticRoute(self, networkId: str, name: str, subnet: s - gatewayIp (string): Gateway IP address (next hop) - gatewayVlanId (integer): Gateway VLAN ID - enabled (boolean): Enable/disable the static route + - vrf (object): VRF settings for the static route. """ kwargs.update(locals()) @@ -1983,6 +2029,7 @@ def createNetworkApplianceStaticRoute(self, networkId: str, name: str, subnet: s "gatewayIp", "gatewayVlanId", "enabled", + "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2027,6 +2074,7 @@ def updateNetworkApplianceStaticRoute(self, networkId: str, staticRouteId: str, - enabled (boolean): Whether the route should be enabled or not - fixedIpAssignments (object): Fixed DHCP IP assignments on the route - reservedIpRanges (array): DHCP reserved IP ranges + - vrf (object): VRF settings for the static route. """ kwargs.update(locals()) @@ -2047,6 +2095,7 @@ def updateNetworkApplianceStaticRoute(self, networkId: str, staticRouteId: str, "enabled", "fixedIpAssignments", "reservedIpRanges", + "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2264,7 +2313,7 @@ def deleteNetworkApplianceTrafficShapingCustomPerformanceClass(self, networkId: def updateNetworkApplianceTrafficShapingRules(self, networkId: str, **kwargs): """ - **Update the traffic shaping settings rules for an MX network** + **Update the traffic shaping settings rules for a Security Appliance or Secure Router network** https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-traffic-shaping-rules - networkId (string): Network ID @@ -2302,7 +2351,7 @@ def updateNetworkApplianceTrafficShapingRules(self, networkId: str, **kwargs): def getNetworkApplianceTrafficShapingRules(self, networkId: str): """ - **Display the traffic shaping settings rules for an MX network** + **Display the traffic shaping settings rules for a Security Appliance or Secure Router network** https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-traffic-shaping-rules - networkId (string): Network ID @@ -3017,12 +3066,22 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): - enabled (boolean): Boolean value to enable or disable the BGP configuration. When BGP is enabled, the asNumber (ASN) will be autopopulated with the preconfigured ASN at other Hubs or a default value if there is no ASN configured. - asNumber (integer): An Autonomous System Number (ASN) is required if you are to run BGP and peer with another BGP Speaker outside of the Auto VPN domain. This ASN will be applied to the entire Auto VPN domain and is only configurable for Auto VPN BGP networks. The entire 4-byte ASN range is supported. So, the ASN must be an integer between 1 and 4294967295. When absent, this field is not updated. If no value exists then it defaults to 64512. - ibgpHoldTimer (integer): The iBGP holdtimer in seconds. The iBGP holdtimer must be an integer between 12 and 240. When absent, this field is not updated. If no value exists then it defaults to 240. + - ipv6 (object): Settings for IPv6 configurations on the organization. + - tunnelDownTermination (object): Settings for tunnel down termination on the organization. + - localAsNumber (integer): Network-specific local Autonomous System Number (ASN) to which the appliance belongs. This field is only configurable for Independent BGP networks. + - priorityRoute (string): Sets the priority route between eBGP and Auto VPN. - routerId (string): The router ID of the appliance - neighbors (array): List of BGP neighbors. This list replaces the existing set of neighbors. When absent, this field is not updated. """ kwargs.update(locals()) + if "priorityRoute" in kwargs: + options = ["Auto VPN", "eBGP"] + assert kwargs["priorityRoute"] in options, ( + f'''"priorityRoute" cannot be "{kwargs["priorityRoute"]}", & must be set to one of: {options}''' + ) + metadata = { "tags": ["appliance", "configure", "vpn", "bgp"], "operation": "updateNetworkApplianceVpnBgp", @@ -3034,6 +3093,10 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): "enabled", "asNumber", "ibgpHoldTimer", + "ipv6", + "tunnelDownTermination", + "localAsNumber", + "priorityRoute", "routerId", "neighbors", ] @@ -3280,6 +3343,57 @@ def getOrganizationApplianceDevicesInterfacesPortsByDevice(self, organizationId: return self._session.get(metadata, resource, params) + def getOrganizationApplianceDevicesInterfacesPortsProfilesAssignments( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **Returns MX port profile assignments** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-devices-interfaces-ports-profiles-assignments + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - serials (array): Optional device serials to filter by. Results include assignments whose device serial is an exact match for any provided serial. If some requested serials are inaccessible, only accessible matches are returned. Maximum: 50 serials per request. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "devices", "interfaces", "ports", "profiles", "assignments"], + "operation": "getOrganizationApplianceDevicesInterfacesPortsProfilesAssignments", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/devices/interfaces/ports/profiles/assignments" + + query_params = [ + "serials", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "serials", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceDevicesInterfacesPortsProfilesAssignments: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationApplianceDevicesPortsTransceiversReadingsHistoryByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): @@ -4274,6 +4388,766 @@ def updateOrganizationApplianceSecurityIntrusion(self, organizationId: str, allo return self._session.put(metadata, resource, payload) + def getOrganizationApplianceSecurityIntrusionPolicies( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List the intrusion policies configured for an organization along with base policies.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-policies + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - mode (string): Controls which policy set is returned. + - policyIds (array): Identifiers of policies to filter + - search (string): Filter policies by case-insensitive partial match on name or description. + """ + + kwargs.update(locals()) + + if "mode" in kwargs: + options = ["base", "intrusion"] + assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies"], + "operation": "getOrganizationApplianceSecurityIntrusionPolicies", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "mode", + "policyIds", + "search", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceSecurityIntrusionPolicies: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def createOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, **kwargs): + """ + **Create a new intrusion policy for the organization.** + https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy + + - organizationId (string): Organization ID + - policy (object): Attributes for the intrusion policy + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies"], + "operation": "createOrganizationApplianceSecurityIntrusionPolicy", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies" + + body_params = [ + "policy", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"createOrganizationApplianceSecurityIntrusionPolicy: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def getOrganizationApplianceSecurityIntrusionPoliciesOverviews( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List counts for the intrusion and base policies configured for an organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-policies-overviews + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - policyIds (array): Identifiers of policies to filter + - search (string): Filter policy overviews by case-insensitive partial match on policy name or description. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies", "overviews"], + "operation": "getOrganizationApplianceSecurityIntrusionPoliciesOverviews", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/overviews" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "policyIds", + "search", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceSecurityIntrusionPoliciesOverviews: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def updateOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, policyId: str, policy: dict, **kwargs): + """ + **Update a single intrusion policy for the organization.** + https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - policy (object): Attributes for the intrusion policy + """ + + kwargs = locals() + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies"], + "operation": "updateOrganizationApplianceSecurityIntrusionPolicy", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}" + + body_params = [ + "policy", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"updateOrganizationApplianceSecurityIntrusionPolicy: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def deleteOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, policyId: str): + """ + **Delete a single intrusion policy for the organization.** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-policy + + - organizationId (string): Organization ID + - policyId (string): Policy ID + """ + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies"], + "operation": "deleteOrganizationApplianceSecurityIntrusionPolicy", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}" + + return self._session.delete(metadata, resource) + + def declareOrganizationApplianceSecurityIntrusionPolicyRuleGroupsOverrides( + self, organizationId: str, policyId: str, items: list, **kwargs + ): + """ + **Declare the desired rule group overrides for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!declare-organization-appliance-security-intrusion-policy-rule-groups-overrides + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - items (array): Desired overrides state + - mode (string): Controls how the configuration payload in the request body is applied to the resource. This parameter dictates the declarative mode: + + * **`complete`**: The request body represents the entire desired configuration for this resource. Any existing configurations that are not included in the payload will be removed. + * **`partial` (default)**: The request body contains only the configurations to be created or modified. Existing configurations that are not specified in the payload will be preserved. + + - recursive (boolean): Controls how the configuration payload in the request body applies to the rule group hierarchy. When true, the API applies each declared override to the rule group itself and its descendants unless the payload explicitly sets a descendant override. When false (default), the API applies overrides only to the rule groups listed in the payload. + + """ + + kwargs.update(locals()) + + if "mode" in kwargs: + options = ["complete", "partial"] + assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies", "ruleGroups", "overrides"], + "operation": "declareOrganizationApplianceSecurityIntrusionPolicyRuleGroupsOverrides", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + resource = ( + f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/overrides/declare" + ) + + body_params = [ + "mode", + "recursive", + "items", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"declareOrganizationApplianceSecurityIntrusionPolicyRuleGroupsOverrides: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def createOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride( + self, organizationId: str, policyId: str, ruleGroupId: str, override: dict, **kwargs + ): + """ + **Create a rule group override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy-rule-group-override + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - ruleGroupId (string): Rule group ID + - override (object): Attributes for the override for a rule group in a intrusion policy + """ + + kwargs = locals() + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies", "ruleGroups", "override"], + "operation": "createOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + ruleGroupId = urllib.parse.quote(str(ruleGroupId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/{ruleGroupId}/override" + + body_params = [ + "override", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"createOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def updateOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride( + self, organizationId: str, policyId: str, ruleGroupId: str, override: dict, **kwargs + ): + """ + **Update a rule group override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy-rule-group-override + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - ruleGroupId (string): Rule group ID + - override (object): Attributes for the override for a rule group in a intrusion policy + """ + + kwargs = locals() + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies", "ruleGroups", "override"], + "operation": "updateOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + ruleGroupId = urllib.parse.quote(str(ruleGroupId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/{ruleGroupId}/override" + + body_params = [ + "override", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"updateOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def declareOrganizationApplianceSecurityIntrusionPolicyRulesOverrides( + self, organizationId: str, policyId: str, items: list, **kwargs + ): + """ + **Declare the desired rule overrides for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!declare-organization-appliance-security-intrusion-policy-rules-overrides + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - items (array): Desired overrides state + - mode (string): Controls how the configuration payload in the request body is applied to the resource. This parameter dictates the declarative mode: + + * **`complete`**: The request body represents the entire desired configuration for this resource. Any existing configurations that are not included in the payload will be removed. This effectively performs a full replacement or overwrite of the resource's configuration. + * **`partial` (default)**: The request body contains only the configurations to be created or modified. Existing configurations that are not specified in the payload will be preserved. This performs a merge or partial update, applying only the changes specified. + + """ + + kwargs.update(locals()) + + if "mode" in kwargs: + options = ["complete", "partial"] + assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies", "rules", "overrides"], + "operation": "declareOrganizationApplianceSecurityIntrusionPolicyRulesOverrides", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/overrides/declare" + + body_params = [ + "mode", + "items", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"declareOrganizationApplianceSecurityIntrusionPolicyRulesOverrides: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def createOrganizationApplianceSecurityIntrusionPolicyRuleOverride( + self, organizationId: str, policyId: str, ruleId: str, override: dict, **kwargs + ): + """ + **Create a rule override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy-rule-override + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - ruleId (string): Rule ID + - override (object): Rule override to create + """ + + kwargs = locals() + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies", "rules", "override"], + "operation": "createOrganizationApplianceSecurityIntrusionPolicyRuleOverride", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + ruleId = urllib.parse.quote(str(ruleId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/{ruleId}/override" + + body_params = [ + "override", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"createOrganizationApplianceSecurityIntrusionPolicyRuleOverride: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def updateOrganizationApplianceSecurityIntrusionPolicyRuleOverride( + self, organizationId: str, policyId: str, ruleId: str, override: dict, **kwargs + ): + """ + **Update a rule override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy-rule-override + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - ruleId (string): Rule ID + - override (object): Override attributes + """ + + kwargs = locals() + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "policies", "rules", "override"], + "operation": "updateOrganizationApplianceSecurityIntrusionPolicyRuleOverride", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + ruleId = urllib.parse.quote(str(ruleId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/{ruleId}/override" + + body_params = [ + "override", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"updateOrganizationApplianceSecurityIntrusionPolicyRuleOverride: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def getOrganizationApplianceSecurityIntrusionRuleGroups( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List the rule groups that belong to a security policy.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rule-groups + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 500. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - policyIds (array): Collection of base or intrusion policy identifiers to filter results by + - parentRuleGroupIds (array): Filter results to rule groups whose parent matches any of the provided identifiers + - search (string): Case-insensitive text filter applied to rule group name and description + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups"], + "operation": "getOrganizationApplianceSecurityIntrusionRuleGroups", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "policyIds", + "parentRuleGroupIds", + "search", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + "parentRuleGroupIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceSecurityIntrusionRuleGroups: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationApplianceSecurityIntrusionRuleGroupsOverrides( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List the rule group overrides configured for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rule-groups-overrides + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - policyIds (array): Collection of intrusion policy identifiers to filter the overrides by. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups", "overrides"], + "operation": "getOrganizationApplianceSecurityIntrusionRuleGroupsOverrides", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups/overrides" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "policyIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceSecurityIntrusionRuleGroupsOverrides: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def deleteOrganizationApplianceSecurityIntrusionRuleGroupsOverride(self, organizationId: str, overrideId: str): + """ + **Delete a rule group override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-rule-groups-override + + - organizationId (string): Organization ID + - overrideId (string): Override ID + """ + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups", "overrides"], + "operation": "deleteOrganizationApplianceSecurityIntrusionRuleGroupsOverride", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + overrideId = urllib.parse.quote(str(overrideId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups/overrides/{overrideId}" + + return self._session.delete(metadata, resource) + + def getOrganizationApplianceSecurityIntrusionRuleGroupsOverviews( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List counts for the child rule groups and rules for each rule group in a security policy.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rule-groups-overviews + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 500. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - policyIds (array): Collection of base or intrusion policy identifiers to filter results by + - parentRuleGroupIds (array): Filter results to rule groups whose parent matches any of the provided identifiers + - search (string): Case-insensitive text filter applied to rule group name and description + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "ruleGroups", "overviews"], + "operation": "getOrganizationApplianceSecurityIntrusionRuleGroupsOverviews", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups/overviews" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "policyIds", + "parentRuleGroupIds", + "search", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + "parentRuleGroupIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceSecurityIntrusionRuleGroupsOverviews: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationApplianceSecurityIntrusionRules(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **List the rules that belong to a security policy.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rules + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 500. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - policyIds (array): Identifiers of the base or intrusion policies to query + - parentRuleGroupIds (array): Filter results to rules that belong to any of the specified rule groups + - search (string): Case-insensitive text filter applied to rule name and description + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "rules"], + "operation": "getOrganizationApplianceSecurityIntrusionRules", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/rules" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "policyIds", + "parentRuleGroupIds", + "search", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + "parentRuleGroupIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceSecurityIntrusionRules: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationApplianceSecurityIntrusionRulesOverrides( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List the rule overrides configured for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-security-intrusion-rules-overrides + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 25. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - policyIds (array): Identifiers of intrusion policies to filter + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "rules", "overrides"], + "operation": "getOrganizationApplianceSecurityIntrusionRulesOverrides", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/rules/overrides" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "policyIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApplianceSecurityIntrusionRulesOverrides: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def deleteOrganizationApplianceSecurityIntrusionRulesOverride(self, organizationId: str, overrideId: str): + """ + **Delete a rule override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-rules-override + + - organizationId (string): Organization ID + - overrideId (string): Override ID + """ + + metadata = { + "tags": ["appliance", "configure", "security", "intrusion", "rules", "overrides"], + "operation": "deleteOrganizationApplianceSecurityIntrusionRulesOverride", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + overrideId = urllib.parse.quote(str(overrideId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/rules/overrides/{overrideId}" + + return self._session.delete(metadata, resource) + def getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork( self, organizationId: str, total_pages=1, direction="next", **kwargs ): @@ -4327,7 +5201,7 @@ def getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork( def getOrganizationApplianceUplinkStatuses(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **List the uplink status of every Meraki MX and Z series appliances in the organization** + **List the uplink status of every Meraki MX appliance, Z series appliance, and Secure Router in the organization** https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-uplink-statuses - organizationId (string): Organization ID diff --git a/meraki/api/batch/appliance.py b/meraki/api/batch/appliance.py index 04a9548..451a824 100644 --- a/meraki/api/batch/appliance.py +++ b/meraki/api/batch/appliance.py @@ -16,6 +16,7 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): - personality (object): Describes the port's configurability - uplink (object): The port's settings when in WAN mode - downlink (object): The port's VLAN settings when in LAN mode + - profile (object): The optional LAN port's profile which it inherits from """ kwargs.update(locals()) @@ -29,6 +30,42 @@ def createDeviceApplianceInterfacesPortsUpdate(self, serial: str, **kwargs): "personality", "uplink", "downlink", + "profile", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "update", + "body": payload, + } + return action + + def updateDeviceApplianceInterfacesPort(self, serial: str, number: str, **kwargs): + """ + **Update configurations for an appliance's specified port** + https://developer.cisco.com/meraki/api-v1/#!update-device-appliance-interfaces-port + + - serial (string): Serial + - number (string): Number + - enabled (boolean): Indicates whether the port is enabled + - personality (object): Describes the port's configurability + - uplink (object): The port's settings when in WAN mode + - downlink (object): The port's VLAN settings when in LAN mode + - profile (object): The optional LAN port's profile which it inherits from + """ + + kwargs.update(locals()) + + serial = urllib.parse.quote(str(serial), safe="") + number = urllib.parse.quote(str(number), safe="") + resource = f"/devices/{serial}/appliance/interfaces/ports/{number}" + + body_params = [ + "enabled", + "personality", + "uplink", + "downlink", + "profile", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -760,7 +797,7 @@ def deleteNetworkApplianceTrafficShapingCustomPerformanceClass(self, networkId: def updateNetworkApplianceTrafficShapingRules(self, networkId: str, **kwargs): """ - **Update the traffic shaping settings rules for an MX network** + **Update the traffic shaping settings rules for a Security Appliance or Secure Router network** https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-traffic-shaping-rules - networkId (string): Network ID @@ -875,31 +912,6 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw } return action - def connectNetworkApplianceUmbrellaAccount(self, networkId: str, api: dict, **kwargs): - """ - **Connect a Cisco Umbrella account to this network** - https://developer.cisco.com/meraki/api-v1/#!connect-network-appliance-umbrella-account - - - networkId (string): Network ID - - api (object): Umbrella API credentials - """ - - kwargs = locals() - - networkId = urllib.parse.quote(str(networkId), safe="") - resource = f"/networks/{networkId}/appliance/umbrella/account/connect" - - body_params = [ - "api", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "action", - "body": payload, - } - return action - def disconnectNetworkApplianceUmbrellaAccount(self, networkId: str): """ **Disconnect Umbrella account from this network** @@ -1012,7 +1024,7 @@ def protectionNetworkApplianceUmbrella(self, networkId: str, enabled: bool, **kw payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, - "operation": "action", + "operation": "update", "body": payload, } return action @@ -1261,12 +1273,22 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): - enabled (boolean): Boolean value to enable or disable the BGP configuration. When BGP is enabled, the asNumber (ASN) will be autopopulated with the preconfigured ASN at other Hubs or a default value if there is no ASN configured. - asNumber (integer): An Autonomous System Number (ASN) is required if you are to run BGP and peer with another BGP Speaker outside of the Auto VPN domain. This ASN will be applied to the entire Auto VPN domain and is only configurable for Auto VPN BGP networks. The entire 4-byte ASN range is supported. So, the ASN must be an integer between 1 and 4294967295. When absent, this field is not updated. If no value exists then it defaults to 64512. - ibgpHoldTimer (integer): The iBGP holdtimer in seconds. The iBGP holdtimer must be an integer between 12 and 240. When absent, this field is not updated. If no value exists then it defaults to 240. + - ipv6 (object): Settings for IPv6 configurations on the organization. + - tunnelDownTermination (object): Settings for tunnel down termination on the organization. + - localAsNumber (integer): Network-specific local Autonomous System Number (ASN) to which the appliance belongs. This field is only configurable for Independent BGP networks. + - priorityRoute (string): Sets the priority route between eBGP and Auto VPN. - routerId (string): The router ID of the appliance - neighbors (array): List of BGP neighbors. This list replaces the existing set of neighbors. When absent, this field is not updated. """ kwargs.update(locals()) + if "priorityRoute" in kwargs: + options = ["Auto VPN", "eBGP"] + assert kwargs["priorityRoute"] in options, ( + f'''"priorityRoute" cannot be "{kwargs["priorityRoute"]}", & must be set to one of: {options}''' + ) + networkId = urllib.parse.quote(str(networkId), safe="") resource = f"/networks/{networkId}/appliance/vpn/bgp" @@ -1274,6 +1296,10 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): "enabled", "asNumber", "ibgpHoldTimer", + "ipv6", + "tunnelDownTermination", + "localAsNumber", + "priorityRoute", "routerId", "neighbors", ] @@ -1732,6 +1758,322 @@ def updateOrganizationApplianceRoutingVrfsSettings(self, organizationId: str, en } return action + def createOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, **kwargs): + """ + **Create a new intrusion policy for the organization.** + https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy + + - organizationId (string): Organization ID + - policy (object): Attributes for the intrusion policy + """ + + kwargs.update(locals()) + + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies" + + body_params = [ + "policy", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "create", + "body": payload, + } + return action + + def updateOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, policyId: str, policy: dict, **kwargs): + """ + **Update a single intrusion policy for the organization.** + https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - policy (object): Attributes for the intrusion policy + """ + + kwargs = locals() + + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}" + + body_params = [ + "policy", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "update", + "body": payload, + } + return action + + def deleteOrganizationApplianceSecurityIntrusionPolicy(self, organizationId: str, policyId: str): + """ + **Delete a single intrusion policy for the organization.** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-policy + + - organizationId (string): Organization ID + - policyId (string): Policy ID + """ + + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}" + + action = { + "resource": resource, + "operation": "destroy", + } + return action + + def declareOrganizationApplianceSecurityIntrusionPolicyRuleGroupsOverrides( + self, organizationId: str, policyId: str, items: list, **kwargs + ): + """ + **Declare the desired rule group overrides for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!declare-organization-appliance-security-intrusion-policy-rule-groups-overrides + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - items (array): Desired overrides state + - mode (string): Controls how the configuration payload in the request body is applied to the resource. This parameter dictates the declarative mode: + + * **`complete`**: The request body represents the entire desired configuration for this resource. Any existing configurations that are not included in the payload will be removed. + * **`partial` (default)**: The request body contains only the configurations to be created or modified. Existing configurations that are not specified in the payload will be preserved. + + - recursive (boolean): Controls how the configuration payload in the request body applies to the rule group hierarchy. When true, the API applies each declared override to the rule group itself and its descendants unless the payload explicitly sets a descendant override. When false (default), the API applies overrides only to the rule groups listed in the payload. + + """ + + kwargs.update(locals()) + + if "mode" in kwargs: + options = ["complete", "partial"] + assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' + + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + resource = ( + f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/overrides/declare" + ) + + body_params = [ + "mode", + "recursive", + "items", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "declare", + "body": payload, + } + return action + + def createOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride( + self, organizationId: str, policyId: str, ruleGroupId: str, override: dict, **kwargs + ): + """ + **Create a rule group override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy-rule-group-override + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - ruleGroupId (string): Rule group ID + - override (object): Attributes for the override for a rule group in a intrusion policy + """ + + kwargs = locals() + + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + ruleGroupId = urllib.parse.quote(str(ruleGroupId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/{ruleGroupId}/override" + + body_params = [ + "override", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "create", + "body": payload, + } + return action + + def updateOrganizationApplianceSecurityIntrusionPolicyRuleGroupOverride( + self, organizationId: str, policyId: str, ruleGroupId: str, override: dict, **kwargs + ): + """ + **Update a rule group override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy-rule-group-override + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - ruleGroupId (string): Rule group ID + - override (object): Attributes for the override for a rule group in a intrusion policy + """ + + kwargs = locals() + + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + ruleGroupId = urllib.parse.quote(str(ruleGroupId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/ruleGroups/{ruleGroupId}/override" + + body_params = [ + "override", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "update", + "body": payload, + } + return action + + def declareOrganizationApplianceSecurityIntrusionPolicyRulesOverrides( + self, organizationId: str, policyId: str, items: list, **kwargs + ): + """ + **Declare the desired rule overrides for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!declare-organization-appliance-security-intrusion-policy-rules-overrides + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - items (array): Desired overrides state + - mode (string): Controls how the configuration payload in the request body is applied to the resource. This parameter dictates the declarative mode: + + * **`complete`**: The request body represents the entire desired configuration for this resource. Any existing configurations that are not included in the payload will be removed. This effectively performs a full replacement or overwrite of the resource's configuration. + * **`partial` (default)**: The request body contains only the configurations to be created or modified. Existing configurations that are not specified in the payload will be preserved. This performs a merge or partial update, applying only the changes specified. + + """ + + kwargs.update(locals()) + + if "mode" in kwargs: + options = ["complete", "partial"] + assert kwargs["mode"] in options, f'''"mode" cannot be "{kwargs["mode"]}", & must be set to one of: {options}''' + + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/overrides/declare" + + body_params = [ + "mode", + "items", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "declare", + "body": payload, + } + return action + + def createOrganizationApplianceSecurityIntrusionPolicyRuleOverride( + self, organizationId: str, policyId: str, ruleId: str, override: dict, **kwargs + ): + """ + **Create a rule override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!create-organization-appliance-security-intrusion-policy-rule-override + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - ruleId (string): Rule ID + - override (object): Rule override to create + """ + + kwargs = locals() + + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + ruleId = urllib.parse.quote(str(ruleId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/{ruleId}/override" + + body_params = [ + "override", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "create", + "body": payload, + } + return action + + def updateOrganizationApplianceSecurityIntrusionPolicyRuleOverride( + self, organizationId: str, policyId: str, ruleId: str, override: dict, **kwargs + ): + """ + **Update a rule override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!update-organization-appliance-security-intrusion-policy-rule-override + + - organizationId (string): Organization ID + - policyId (string): Policy ID + - ruleId (string): Rule ID + - override (object): Override attributes + """ + + kwargs = locals() + + organizationId = urllib.parse.quote(str(organizationId), safe="") + policyId = urllib.parse.quote(str(policyId), safe="") + ruleId = urllib.parse.quote(str(ruleId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/policies/{policyId}/rules/{ruleId}/override" + + body_params = [ + "override", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "update", + "body": payload, + } + return action + + def deleteOrganizationApplianceSecurityIntrusionRuleGroupsOverride(self, organizationId: str, overrideId: str): + """ + **Delete a rule group override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-rule-groups-override + + - organizationId (string): Organization ID + - overrideId (string): Override ID + """ + + organizationId = urllib.parse.quote(str(organizationId), safe="") + overrideId = urllib.parse.quote(str(overrideId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/ruleGroups/overrides/{overrideId}" + + action = { + "resource": resource, + "operation": "destroy", + } + return action + + def deleteOrganizationApplianceSecurityIntrusionRulesOverride(self, organizationId: str, overrideId: str): + """ + **Delete a rule override for an intrusion policy.** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-appliance-security-intrusion-rules-override + + - organizationId (string): Organization ID + - overrideId (string): Override ID + """ + + organizationId = urllib.parse.quote(str(organizationId), safe="") + overrideId = urllib.parse.quote(str(overrideId), safe="") + resource = f"/organizations/{organizationId}/appliance/security/intrusion/rules/overrides/{overrideId}" + + action = { + "resource": resource, + "operation": "destroy", + } + return action + def updateOrganizationApplianceVpnSiteToSiteIpsecPeersSlas(self, organizationId: str, **kwargs): """ **Update the IPsec SLA policies for an organization** diff --git a/meraki/api/batch/networks.py b/meraki/api/batch/networks.py index eef3867..f788e69 100644 --- a/meraki/api/batch/networks.py +++ b/meraki/api/batch/networks.py @@ -957,15 +957,17 @@ def createNetworkVlanProfile(self, networkId: str, name: str, vlanNames: list, v - vlanNames (array): An array of named VLANs - vlanGroups (array): An array of VLAN groups - iname (string): IName of the profile + - activeVlans (string): The active VLANs for the VLAN profile. Only applicable to trunk ports. The given range must be inclusive of all named VLANs. """ - kwargs = locals() + kwargs.update(locals()) networkId = urllib.parse.quote(str(networkId), safe="") resource = f"/networks/{networkId}/vlanProfiles" body_params = [ "name", + "activeVlans", "vlanNames", "vlanGroups", "iname", diff --git a/meraki/api/batch/organizations.py b/meraki/api/batch/organizations.py index ead1da9..35dd752 100644 --- a/meraki/api/batch/organizations.py +++ b/meraki/api/batch/organizations.py @@ -550,6 +550,7 @@ def createOrganizationBrandingPolicy(self, organizationId: str, name: str, **kwa - organizationId (string): Organization ID - name (string): Name of the Dashboard branding policy. - enabled (boolean): Boolean indicating whether this policy is enabled. + - appearance (object): Dashboard appearance settings. - adminSettings (object): Settings for describing which kinds of admins this policy applies to. - helpSettings (object): Settings for describing the modifications to various Help page features. Each property in this object accepts one of 'default or inherit' (do not modify functionality), 'hide' (remove the section from Dashboard), or 'show' (always show @@ -567,6 +568,7 @@ def createOrganizationBrandingPolicy(self, organizationId: str, name: str, **kwa body_params = [ "name", "enabled", + "appearance", "adminSettings", "helpSettings", "customLogo", @@ -614,6 +616,7 @@ def updateOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId - brandingPolicyId (string): Branding policy ID - name (string): Name of the Dashboard branding policy. - enabled (boolean): Boolean indicating whether this policy is enabled. + - appearance (object): Dashboard appearance settings. - adminSettings (object): Settings for describing which kinds of admins this policy applies to. - helpSettings (object): Settings for describing the modifications to various Help page features. Each property in this object accepts one of 'default or inherit' (do not modify functionality), 'hide' (remove the section from Dashboard), or 'show' (always show @@ -632,6 +635,7 @@ def updateOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId body_params = [ "name", "enabled", + "appearance", "adminSettings", "helpSettings", "customLogo", @@ -1838,6 +1842,7 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( - rulesetId (string): ID of the ruleset to assign - policyId (string): ID of the policy to assign the ruleset to - priority (integer): Priority of the ruleset assignment (lower numbers = higher priority) + - staged (boolean): Stage an assignment without applying it immediately to the policy """ kwargs.update(locals()) @@ -1849,6 +1854,7 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( "rulesetId", "policyId", "priority", + "staged", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -1858,6 +1864,33 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( } return action + def commitOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments( + self, organizationId: str, policy: dict, **kwargs + ): + """ + **Commit staged Organization-Wide Policy Ruleset Assignments** + https://developer.cisco.com/meraki/api-v1/#!commit-organization-policies-global-group-policies-firewall-rulesets-assignments + + - organizationId (string): Organization ID + - policy (object): Policy in which all staged rulesets will be committed + """ + + kwargs = locals() + + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/policies/global/group/policies/firewall/rulesets/assignments/commit" + + body_params = [ + "policy", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "commit", + "body": payload, + } + return action + def updateOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( self, organizationId: str, assignmentId: str, **kwargs ): @@ -1914,6 +1947,64 @@ def deleteOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment(self } return action + def bulkOrganizationPoliciesGlobalGroupPoliciesNetworksAssignmentsAssign( + self, organizationId: str, policy: dict, targets: list, **kwargs + ): + """ + **Assign Network Enforcement Targets to an Organization-Wide Policy** + https://developer.cisco.com/meraki/api-v1/#!bulk-organization-policies-global-group-policies-networks-assignments-assign + + - organizationId (string): Organization ID + - policy (object): Policy to assign network enforcement targets to + - targets (array): Network enforcement targets to assign to the specified policy. Maximum 1000 per request. + """ + + kwargs = locals() + + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/policies/global/group/policies/networks/assignments/bulkAssign" + + body_params = [ + "policy", + "targets", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "bulk_create", + "body": payload, + } + return action + + def bulkOrganizationPoliciesGlobalGroupPoliciesNetworksAssignmentsDelete( + self, organizationId: str, policy: dict, targets: list, **kwargs + ): + """ + **Remove Network Enforcement Targets from an Organization-Wide Policy** + https://developer.cisco.com/meraki/api-v1/#!bulk-organization-policies-global-group-policies-networks-assignments-delete + + - organizationId (string): Organization ID + - policy (object): Policy to remove network enforcement targets from + - targets (array): Network enforcement targets to remove for the specified policy. Maximum 1000 per request. + """ + + kwargs = locals() + + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/policies/global/group/policies/networks/assignments/bulkDelete" + + body_params = [ + "policy", + "targets", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "bulk_delete", + "body": payload, + } + return action + def updateOrganizationPoliciesGlobalGroupPolicy(self, organizationId: str, policyId: str, **kwargs): """ **Update an Organization-Wide Policy** @@ -2217,31 +2308,6 @@ def deleteOrganizationSamlIdp(self, organizationId: str, idpId: str): } return action - def createOrganizationSaseIntegration(self, organizationId: str, api: dict, **kwargs): - """ - **Create a new Secure Access integration** - https://developer.cisco.com/meraki/api-v1/#!create-organization-sase-integration - - - organizationId (string): Organization ID - - api (object): API credentials - """ - - kwargs = locals() - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sase/integrations" - - body_params = [ - "api", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "create", - "body": payload, - } - return action - def deleteOrganizationSaseIntegration(self, organizationId: str, integrationId: str): """ **Remove a Secure Access integration** @@ -2297,7 +2363,7 @@ def updateOrganizationSnmp(self, organizationId: str, **kwargs): - 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'. + - v3AuthMode (string): The SNMP version 3 authentication mode. Can be one of 'SHA', 'MD5', 'SHA256', 'SHA384', or 'SHA512'. MD5 is not supported in the Cisco Meraki US Government Region. - 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. @@ -2307,7 +2373,7 @@ def updateOrganizationSnmp(self, organizationId: str, **kwargs): kwargs.update(locals()) if "v3AuthMode" in kwargs: - options = ["MD5", "SHA"] + options = ["MD5", "SHA", "SHA256", "SHA384", "SHA512"] assert kwargs["v3AuthMode"] in options, ( f'''"v3AuthMode" cannot be "{kwargs["v3AuthMode"]}", & must be set to one of: {options}''' ) diff --git a/meraki/api/batch/switch.py b/meraki/api/batch/switch.py index 8e276c9..eb8d57a 100644 --- a/meraki/api/batch/switch.py +++ b/meraki/api/batch/switch.py @@ -39,7 +39,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - serial (string): Serial - portId (string): Port ID - - name (string): The name of the switch port. + - name (string): The name of the switch port. Dashboard displays this value as the port description. For Cisco Catalyst switches running IOS XE, it corresponds to the configured interface description. - tags (array): The list of tags of the switch port. - enabled (boolean): The status of the switch port. - poeEnabled (boolean): The PoE status of the switch port. @@ -156,6 +156,7 @@ def createDeviceSwitchRoutingInterface(self, serial: str, name: str, **kwargs): - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher - loopback (object): The loopback settings of the interface. + - bidirectionalForwardingDetection (object): BFD configuration for the L3 interface. """ kwargs.update(locals()) @@ -186,6 +187,7 @@ def createDeviceSwitchRoutingInterface(self, serial: str, name: str, **kwargs): "ipv6", "vrf", "loopback", + "bidirectionalForwardingDetection", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -214,6 +216,7 @@ def updateDeviceSwitchRoutingInterface(self, serial: str, interfaceId: str, **kw - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher - loopback (object): The loopback settings of the interface. + - bidirectionalForwardingDetection (object): BFD configuration for the L3 interface. """ kwargs.update(locals()) @@ -241,6 +244,7 @@ def updateDeviceSwitchRoutingInterface(self, serial: str, interfaceId: str, **kw "ipv6", "vrf", "loopback", + "bidirectionalForwardingDetection", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -292,6 +296,8 @@ def updateDeviceSwitchRoutingInterfaceDhcp(self, serial: str, interfaceId: str, - dhcpOptions (array): Array of DHCP options consisting of code, type and value for the DHCP server running on the switch interface - reservedIpRanges (array): Array of DHCP reserved IP assignments for the DHCP server running on the switch interface - fixedIpAssignments (array): Array of DHCP fixed IP assignments for the DHCP server running on the switch interface + - dhcpDefaultRouterIps (string): The DHCP default router IPs for the DHCP server running on the switch interface + - dhcpDomainName (string): The DHCP domain name for the DHCP server running on the switch interface """ kwargs.update(locals()) @@ -328,6 +334,8 @@ def updateDeviceSwitchRoutingInterfaceDhcp(self, serial: str, interfaceId: str, "dhcpOptions", "reservedIpRanges", "fixedIpAssignments", + "dhcpDefaultRouterIps", + "dhcpDomainName", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -932,6 +940,25 @@ def createNetworkSwitchPortSchedule(self, networkId: str, name: str, **kwargs): } return action + def deleteNetworkSwitchPortSchedule(self, networkId: str, portScheduleId: str): + """ + **Delete a switch port schedule** + https://developer.cisco.com/meraki/api-v1/#!delete-network-switch-port-schedule + + - networkId (string): Network ID + - portScheduleId (string): Port schedule ID + """ + + networkId = urllib.parse.quote(str(networkId), safe="") + portScheduleId = urllib.parse.quote(str(portScheduleId), safe="") + resource = f"/networks/{networkId}/switch/portSchedules/{portScheduleId}" + + action = { + "resource": resource, + "operation": "destroy", + } + return action + def updateNetworkSwitchPortSchedule(self, networkId: str, portScheduleId: str, **kwargs): """ **Update a switch port schedule** @@ -1118,7 +1145,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": "ms/multicast/actions/update", + "operation": "update", "body": payload, } return action @@ -1338,6 +1365,7 @@ def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher - loopback (object): The loopback settings of the interface. + - bidirectionalForwardingDetection (object): BFD configuration for the L3 interface. """ kwargs.update(locals()) @@ -1369,6 +1397,7 @@ def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId "ipv6", "vrf", "loopback", + "bidirectionalForwardingDetection", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -1398,6 +1427,7 @@ def updateNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher - loopback (object): The loopback settings of the interface. + - bidirectionalForwardingDetection (object): BFD configuration for the L3 interface. """ kwargs.update(locals()) @@ -1426,6 +1456,7 @@ def updateNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId "ipv6", "vrf", "loopback", + "bidirectionalForwardingDetection", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -1481,6 +1512,8 @@ def updateNetworkSwitchStackRoutingInterfaceDhcp(self, networkId: str, switchSta switch stack interface - reservedIpRanges (array): Array of DHCP reserved IP assignments for the DHCP server running on the switch stack interface - fixedIpAssignments (array): Array of DHCP fixed IP assignments for the DHCP server running on the switch stack interface + - dhcpDefaultRouterIps (string): The DHCP default router IPs for the DHCP server running on the switch stack interface + - dhcpDomainName (string): The DHCP domain name for the DHCP server running on the switch stack interface """ kwargs.update(locals()) @@ -1518,6 +1551,8 @@ def updateNetworkSwitchStackRoutingInterfaceDhcp(self, networkId: str, switchSta "dhcpOptions", "reservedIpRanges", "fixedIpAssignments", + "dhcpDefaultRouterIps", + "dhcpDomainName", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -1697,10 +1732,12 @@ def updateOrganizationConfigTemplateSwitchProfilePort( - configTemplateId (string): Config template ID - profileId (string): Profile ID - portId (string): Port ID - - name (string): The name of the switch template port. + - name (string): The name of the switch template port. Dashboard displays this value as the port description. For Cisco Catalyst switches running IOS XE, it corresponds to the configured interface description. - tags (array): The list of tags of the switch template port. - enabled (boolean): The status of the switch template port. - poeEnabled (boolean): The PoE status of the switch template port. + - perpetualPoe (object): Perpetual PoE settings for the switch template port. + - fastPoe (object): Fast PoE settings for the switch template port. - type (string): The type of the switch template port ('access', 'trunk', 'stack', 'routed', 'svl' or 'dad'). - vlan (integer): The VLAN of the switch template port. For a trunk port, this is the native VLAN. A null value will clear the value set for trunk ports. - voiceVlan (integer): The voice VLAN of the switch template port. Only applicable to access ports. @@ -1759,6 +1796,8 @@ def updateOrganizationConfigTemplateSwitchProfilePort( "tags", "enabled", "poeEnabled", + "perpetualPoe", + "fastPoe", "type", "vlan", "voiceVlan", diff --git a/meraki/api/batch/wireless.py b/meraki/api/batch/wireless.py index 2aae844..40b3d1d 100644 --- a/meraki/api/batch/wireless.py +++ b/meraki/api/batch/wireless.py @@ -68,7 +68,7 @@ def updateDeviceWirelessElectronicShelfLabel(self, serial: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-electronic-shelf-label - serial (string): Serial - - channel (string): Desired ESL channel for the device, or 'Auto' (case insensitive) to use the recommended channel + - channel (string): Desired ESL channel for the device. Only configurable for devices assigned the High frequency ESL or sepioo IIoT role. Use 'Auto' (case insensitive) to use the recommended channel - enabled (boolean): Turn ESL features on and off for this device """ @@ -725,6 +725,31 @@ def updateNetworkWirelessSettings(self, networkId: str, **kwargs): } return action + def updateNetworkWirelessSsidsOwe(self, networkId: str, transitions: list, **kwargs): + """ + **Update the OWE transition pairs for a network** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ssids-owe + + - networkId (string): Network ID + - transitions (array): Array of OWE transition pairs + """ + + kwargs = locals() + + networkId = urllib.parse.quote(str(networkId), safe="") + resource = f"/networks/{networkId}/wireless/ssids/owe" + + body_params = [ + "transitions", + ] + 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 updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): """ **Update the attributes of an MR SSID** @@ -1278,6 +1303,33 @@ def updateNetworkWirelessSsidOpenRoaming(self, networkId: str, number: str, **kw } return action + def updateNetworkWirelessSsidOverrides(self, networkId: str, number: str, **kwargs): + """ + **Update the overrides for this SSID** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ssid-overrides + + - networkId (string): Network ID + - number (string): Number + - ccxNameIeEnabled (boolean): When true, enables CCX name IE, which allows the AP to broadcast its device name as part of its beacon (as defined by the network admin in the Dashboard). + """ + + kwargs.update(locals()) + + networkId = urllib.parse.quote(str(networkId), safe="") + number = urllib.parse.quote(str(number), safe="") + resource = f"/networks/{networkId}/wireless/ssids/{number}/overrides" + + body_params = [ + "ccxNameIeEnabled", + ] + 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 updateNetworkWirelessSsidSchedules(self, networkId: str, number: str, **kwargs): """ **Update the outage schedule for the SSID** diff --git a/meraki/api/campusGateway.py b/meraki/api/campusGateway.py index c0f6f54..3ef030e 100644 --- a/meraki/api/campusGateway.py +++ b/meraki/api/campusGateway.py @@ -740,6 +740,7 @@ def getOrganizationCampusGatewayConnections(self, organizationId: str, total_pag - campusGatewaySerials (array): Optional parameter to filter connections(APs) by MCG serials. This filter uses multiple exact matches. - campusGatewayClusterIds (array): Optional parameter to filter connections(APs) by MCG cluster IDs. This filter uses multiple exact matches. - campusGatewayTunnelStatuses (array): Optional parameter to filter connections(APs) by tunnel statuses. This filter uses multiple exact matches. + - campusGatewayPriorities (array): Optional parameter to filter connections(APs) by Campus Gateway tunnel priority. Use 0 for primary or 1 for backup. This filter uses multiple exact matches. - search (string): Optional parameter to filter connections(APs) on AP name, serial, MAC address, network name, or interface IP address. This filter uses partial string matching (ILIKE). - models (array): Optional parameter to filter connections(APs) by device model names. This filter uses multiple exact matches. - dataEncryptionStatuses (array): Optional parameter to filter connections(APs) by data encryption status. This filter uses multiple exact matches. @@ -776,6 +777,7 @@ def getOrganizationCampusGatewayConnections(self, organizationId: str, total_pag "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "search", "models", "dataEncryptionStatuses", @@ -793,6 +795,7 @@ def getOrganizationCampusGatewayConnections(self, organizationId: str, total_pag "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "models", "dataEncryptionStatuses", ] @@ -822,6 +825,7 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * - campusGatewaySerials (array): Optional parameter to filter connections(APs) by Campus Gateway serials. This filter uses multiple exact matches. - campusGatewayClusterIds (array): Optional parameter to filter connections(APs) by Campus Gateway cluster IDs. This filter uses multiple exact matches. - campusGatewayTunnelStatuses (array): Optional parameter to filter connections(APs) by tunnel statuses. This filter uses multiple exact matches. + - campusGatewayPriorities (array): Optional parameter to filter connections(APs) by Campus Gateway tunnel priority. Use 0 for primary or 1 for backup. This filter uses multiple exact matches. - search (string): Optional setting that lets you filter access points (APs) by name, serial number, MAC address, network name, or interface IP address. The filter matches partial text, not just exact values (uses ILIKE matching). - models (array): Optional parameter to filter connections(APs) by device model names. This filter uses multiple exact matches. - dataEncryptionStatuses (array): Optional parameter to filter connections(APs) by data encryption status. This filter uses multiple exact matches. @@ -842,6 +846,7 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "search", "models", "dataEncryptionStatuses", @@ -854,6 +859,7 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "models", "dataEncryptionStatuses", ] @@ -872,6 +878,58 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * return self._session.get(metadata, resource, params) + def getOrganizationCampusGatewayDevicesSystemCpuLoad(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **Return the latest CPU load averages reported by Campus Gateway devices.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-devices-system-cpu-load + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - networkIds (array): Optional exact-match network filters. Accepts both node group (N_) and locale (L_) network IDs. + - serials (array): Optional exact-match Campus Gateway serial filters. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["campusGateway", "monitor", "devices", "system", "cpu", "load"], + "operation": "getOrganizationCampusGatewayDevicesSystemCpuLoad", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/campusGateway/devices/system/cpu/load" + + query_params = [ + "networkIds", + "serials", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "serials", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationCampusGatewayDevicesSystemCpuLoad: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationCampusGatewayDevicesUplinksLocalOverridesByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): diff --git a/meraki/api/networks.py b/meraki/api/networks.py index e290dbf..e8d7894 100644 --- a/meraki/api/networks.py +++ b/meraki/api/networks.py @@ -3050,9 +3050,10 @@ def createNetworkVlanProfile(self, networkId: str, name: str, vlanNames: list, v - vlanNames (array): An array of named VLANs - vlanGroups (array): An array of VLAN groups - iname (string): IName of the profile + - activeVlans (string): The active VLANs for the VLAN profile. Only applicable to trunk ports. The given range must be inclusive of all named VLANs. """ - kwargs = locals() + kwargs.update(locals()) metadata = { "tags": ["networks", "configure", "vlanProfiles"], @@ -3063,6 +3064,7 @@ def createNetworkVlanProfile(self, networkId: str, name: str, vlanNames: list, v body_params = [ "name", + "activeVlans", "vlanNames", "vlanGroups", "iname", @@ -3198,9 +3200,10 @@ def updateNetworkVlanProfile(self, networkId: str, iname: str, name: str, vlanNa - name (string): Name of the profile, string length must be from 1 to 255 characters - vlanNames (array): An array of named VLANs - vlanGroups (array): An array of VLAN groups + - activeVlans (string): The active VLANs for the VLAN profile. Only applicable to trunk ports. The given range must be inclusive of all named VLANs. """ - kwargs = locals() + kwargs.update(locals()) metadata = { "tags": ["networks", "configure", "vlanProfiles"], @@ -3212,6 +3215,7 @@ def updateNetworkVlanProfile(self, networkId: str, iname: str, name: str, vlanNa body_params = [ "name", + "activeVlans", "vlanNames", "vlanGroups", ] diff --git a/meraki/api/organizations.py b/meraki/api/organizations.py index 5dbbc85..199c972 100644 --- a/meraki/api/organizations.py +++ b/meraki/api/organizations.py @@ -1083,6 +1083,62 @@ def deleteOrganizationAlertsProfile(self, organizationId: str, alertConfigId: st return self._session.delete(metadata, resource) + def getOrganizationApiRestProvisioningPipelines(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **List pipelines with operation and status metadata, sorted by pipeline ID** + https://developer.cisco.com/meraki/api-v1/#!get-organization-api-rest-provisioning-pipelines + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 10. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'descending'. + - status (string): If provided, filters pipelines by status. If omitted, pipelines of all statuses are returned. `pending` pipelines have not started, `active` pipelines have started but not finished, `success` pipelines completed successfully, and `error` pipelines failed. + - timespan (integer): Created-at lookback for matching pipelines, in seconds. Defaults to 7200 seconds. The maximum is 30 days. + """ + + kwargs.update(locals()) + + if "sortOrder" in kwargs: + options = ["ascending", "descending"] + assert kwargs["sortOrder"] in options, ( + f'''"sortOrder" cannot be "{kwargs["sortOrder"]}", & must be set to one of: {options}''' + ) + if "status" in kwargs: + options = ["active", "error", "pending", "success"] + assert kwargs["status"] in options, ( + f'''"status" cannot be "{kwargs["status"]}", & must be set to one of: {options}''' + ) + + metadata = { + "tags": ["organizations", "configure", "api", "rest", "provisioning", "pipelines"], + "operation": "getOrganizationApiRestProvisioningPipelines", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/api/rest/provisioning/pipelines" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "sortOrder", + "status", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationApiRestProvisioningPipelines: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationApiRestProvisioningPipelinesJobs(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **List pipeline jobs, with optional status filtering** @@ -2057,6 +2113,7 @@ def createOrganizationBrandingPolicy(self, organizationId: str, name: str, **kwa - organizationId (string): Organization ID - name (string): Name of the Dashboard branding policy. - enabled (boolean): Boolean indicating whether this policy is enabled. + - appearance (object): Dashboard appearance settings. - adminSettings (object): Settings for describing which kinds of admins this policy applies to. - helpSettings (object): Settings for describing the modifications to various Help page features. Each property in this object accepts one of 'default or inherit' (do not modify functionality), 'hide' (remove the section from Dashboard), or 'show' (always show @@ -2078,6 +2135,7 @@ def createOrganizationBrandingPolicy(self, organizationId: str, name: str, **kwa body_params = [ "name", "enabled", + "appearance", "adminSettings", "helpSettings", "customLogo", @@ -2171,6 +2229,7 @@ def updateOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId - brandingPolicyId (string): Branding policy ID - name (string): Name of the Dashboard branding policy. - enabled (boolean): Boolean indicating whether this policy is enabled. + - appearance (object): Dashboard appearance settings. - adminSettings (object): Settings for describing which kinds of admins this policy applies to. - helpSettings (object): Settings for describing the modifications to various Help page features. Each property in this object accepts one of 'default or inherit' (do not modify functionality), 'hide' (remove the section from Dashboard), or 'show' (always show @@ -2193,6 +2252,7 @@ def updateOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId body_params = [ "name", "enabled", + "appearance", "adminSettings", "helpSettings", "customLogo", @@ -2308,7 +2368,7 @@ def getOrganizationClientsBandwidthUsageHistory(self, organizationId: str, **kwa def getOrganizationClientsOverview(self, organizationId: str, **kwargs): """ - **Return summary information around client data usage (in kb) across the given organization.** + **Return summary information around client data usage in MiB across the given organization.** https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-overview - organizationId (string): Organization ID @@ -5884,6 +5944,7 @@ def getOrganizationNetworksGroups(self, organizationId: str, total_pages=1, dire - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - groupIds (array): Optional parameter to filter network groups by ID + - search (string): Optional parameter to filter network groups by a case-insensitive partial group name match - 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. @@ -5900,6 +5961,7 @@ def getOrganizationNetworksGroups(self, organizationId: str, total_pages=1, dire query_params = [ "groupIds", + "search", "perPage", "startingAfter", "endingBefore", @@ -6923,6 +6985,7 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( - rulesetId (string): ID of the ruleset to assign - policyId (string): ID of the policy to assign the ruleset to - priority (integer): Priority of the ruleset assignment (lower numbers = higher priority) + - staged (boolean): Stage an assignment without applying it immediately to the policy """ kwargs.update(locals()) @@ -6938,6 +7001,7 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( "rulesetId", "policyId", "priority", + "staged", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -6951,6 +7015,41 @@ def createOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( return self._session.post(metadata, resource, payload) + def commitOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments( + self, organizationId: str, policy: dict, **kwargs + ): + """ + **Commit staged Organization-Wide Policy Ruleset Assignments** + https://developer.cisco.com/meraki/api-v1/#!commit-organization-policies-global-group-policies-firewall-rulesets-assignments + + - organizationId (string): Organization ID + - policy (object): Policy in which all staged rulesets will be committed + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "policies", "global", "group", "firewall", "rulesets", "assignments"], + "operation": "commitOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/policies/global/group/policies/firewall/rulesets/assignments/commit" + + body_params = [ + "policy", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"commitOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignments: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + def updateOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment( self, organizationId: str, assignmentId: str, **kwargs ): @@ -7015,6 +7114,199 @@ def deleteOrganizationPoliciesGlobalGroupPoliciesFirewallRulesetsAssignment(self return self._session.delete(metadata, resource) + def getOrganizationPoliciesGlobalGroupPoliciesNetworks( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List all available Network Enforcement Targets for an Organization and their associated Organization-Wide Policies if applicable** + https://developer.cisco.com/meraki/api-v1/#!get-organization-policies-global-group-policies-networks + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - policyIds (array): Filter network enforcement targets by policy IDs + - networkIds (array): Filter network enforcement targets by network IDs + - firewallTypes (array): Filter network enforcement targets by firewall enforcement types for a network + - name (string): Filter network enforcement targets by network name with support for partial matches. Case insensitive. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 100. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "policies", "global", "group", "networks"], + "operation": "getOrganizationPoliciesGlobalGroupPoliciesNetworks", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/policies/global/group/policies/networks" + + query_params = [ + "policyIds", + "networkIds", + "firewallTypes", + "name", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "policyIds", + "networkIds", + "firewallTypes", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationPoliciesGlobalGroupPoliciesNetworks: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationPoliciesGlobalGroupPoliciesNetworksAssignments( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List Network Enforcement Target Assignments for Organization-Wide policies for the specified organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-policies-global-group-policies-networks-assignments + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - assignmentIds (array): Filter network enforcement target assignments by assignment IDs + - policyIds (array): Filter network enforcement target assignments by policy IDs + - networkIds (array): Filter network enforcement target assignments by network IDs + - firewallTypes (array): Filter network enforcement target assignments by firewall enforcement types for a network + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100. Default is 100. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "policies", "global", "group", "networks", "assignments"], + "operation": "getOrganizationPoliciesGlobalGroupPoliciesNetworksAssignments", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/policies/global/group/policies/networks/assignments" + + query_params = [ + "assignmentIds", + "policyIds", + "networkIds", + "firewallTypes", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "assignmentIds", + "policyIds", + "networkIds", + "firewallTypes", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationPoliciesGlobalGroupPoliciesNetworksAssignments: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def bulkOrganizationPoliciesGlobalGroupPoliciesNetworksAssignmentsAssign( + self, organizationId: str, policy: dict, targets: list, **kwargs + ): + """ + **Assign Network Enforcement Targets to an Organization-Wide Policy** + https://developer.cisco.com/meraki/api-v1/#!bulk-organization-policies-global-group-policies-networks-assignments-assign + + - organizationId (string): Organization ID + - policy (object): Policy to assign network enforcement targets to + - targets (array): Network enforcement targets to assign to the specified policy. Maximum 1000 per request. + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "policies", "global", "group", "networks", "assignments"], + "operation": "bulkOrganizationPoliciesGlobalGroupPoliciesNetworksAssignmentsAssign", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/policies/global/group/policies/networks/assignments/bulkAssign" + + body_params = [ + "policy", + "targets", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"bulkOrganizationPoliciesGlobalGroupPoliciesNetworksAssignmentsAssign: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def bulkOrganizationPoliciesGlobalGroupPoliciesNetworksAssignmentsDelete( + self, organizationId: str, policy: dict, targets: list, **kwargs + ): + """ + **Remove Network Enforcement Targets from an Organization-Wide Policy** + https://developer.cisco.com/meraki/api-v1/#!bulk-organization-policies-global-group-policies-networks-assignments-delete + + - organizationId (string): Organization ID + - policy (object): Policy to remove network enforcement targets from + - targets (array): Network enforcement targets to remove for the specified policy. Maximum 1000 per request. + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "policies", "global", "group", "networks", "assignments"], + "operation": "bulkOrganizationPoliciesGlobalGroupPoliciesNetworksAssignmentsDelete", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/policies/global/group/policies/networks/assignments/bulkDelete" + + body_params = [ + "policy", + "targets", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"bulkOrganizationPoliciesGlobalGroupPoliciesNetworksAssignmentsDelete: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + def updateOrganizationPoliciesGlobalGroupPolicy(self, organizationId: str, policyId: str, **kwargs): """ **Update an Organization-Wide Policy** @@ -8096,7 +8388,7 @@ def updateOrganizationSnmp(self, organizationId: str, **kwargs): - 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'. + - v3AuthMode (string): The SNMP version 3 authentication mode. Can be one of 'SHA', 'MD5', 'SHA256', 'SHA384', or 'SHA512'. MD5 is not supported in the Cisco Meraki US Government Region. - 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. @@ -8106,7 +8398,7 @@ def updateOrganizationSnmp(self, organizationId: str, **kwargs): kwargs.update(locals()) if "v3AuthMode" in kwargs: - options = ["MD5", "SHA"] + options = ["MD5", "SHA", "SHA256", "SHA384", "SHA512"] assert kwargs["v3AuthMode"] in options, ( f'''"v3AuthMode" cannot be "{kwargs["v3AuthMode"]}", & must be set to one of: {options}''' ) @@ -8284,6 +8576,226 @@ def createOrganizationSplashThemeAsset(self, organizationId: str, themeIdentifie return self._session.post(metadata, resource, payload) + def getOrganizationSummarySustainabilityDailyConsumerMetricsNetworks(self, organizationId: str, **kwargs): + """ + **Lists daily consumer metrics for networks.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-daily-consumer-metrics-networks + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for 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 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "dailyConsumerMetrics", "networks"], + "operation": "getOrganizationSummarySustainabilityDailyConsumerMetricsNetworks", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/dailyConsumerMetrics/networks" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilityDailyConsumerMetricsNetworks: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategories(self, organizationId: str): + """ + **Lists available device categories for sustainability metrics with their corresponding device types.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-device-categories + + - organizationId (string): Organization ID + """ + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "summaryConsumerMetrics", "deviceCategories"], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategories", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/deviceCategories" + + return self._session.get(metadata, resource) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategoriesAggregated( + self, organizationId: str, **kwargs + ): + """ + **Lists summary consumer metrics aggregated by device category.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-device-categories-aggregated + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for 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 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": [ + "organizations", + "configure", + "summary", + "sustainability", + "summaryConsumerMetrics", + "deviceCategories", + "aggregated", + ], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategoriesAggregated", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/deviceCategories/aggregated" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategoriesAggregated: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsDevices(self, organizationId: str, **kwargs): + """ + **Lists summary consumer metrics for devices.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-devices + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for 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 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "summaryConsumerMetrics", "devices"], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsDevices", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/devices" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsDevices: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworks(self, organizationId: str, **kwargs): + """ + **Lists summary consumer metrics for networks.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-networks + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for 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 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "summaryConsumerMetrics", "networks"], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworks", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/networks" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworks: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworksAggregated(self, organizationId: str, **kwargs): + """ + **Returns aggregated consumer metrics for all networks in the organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-networks-aggregated + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for 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 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": [ + "organizations", + "configure", + "summary", + "sustainability", + "summaryConsumerMetrics", + "networks", + "aggregated", + ], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworksAggregated", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/networks/aggregated" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworksAggregated: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, **kwargs): """ **Return the top 10 appliances sorted by utilization over given time range.** diff --git a/meraki/api/switch.py b/meraki/api/switch.py index 71fbe24..fa21963 100644 --- a/meraki/api/switch.py +++ b/meraki/api/switch.py @@ -146,7 +146,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - serial (string): Serial - portId (string): Port ID - - name (string): The name of the switch port. + - name (string): The name of the switch port. Dashboard displays this value as the port description. For Cisco Catalyst switches running IOS XE, it corresponds to the configured interface description. - tags (array): The list of tags of the switch port. - enabled (boolean): The status of the switch port. - poeEnabled (boolean): The PoE status of the switch port. @@ -311,6 +311,7 @@ def createDeviceSwitchRoutingInterface(self, serial: str, name: str, **kwargs): - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher - loopback (object): The loopback settings of the interface. + - bidirectionalForwardingDetection (object): BFD configuration for the L3 interface. """ kwargs.update(locals()) @@ -345,6 +346,7 @@ def createDeviceSwitchRoutingInterface(self, serial: str, name: str, **kwargs): "ipv6", "vrf", "loopback", + "bidirectionalForwardingDetection", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -394,6 +396,7 @@ def updateDeviceSwitchRoutingInterface(self, serial: str, interfaceId: str, **kw - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher - loopback (object): The loopback settings of the interface. + - bidirectionalForwardingDetection (object): BFD configuration for the L3 interface. """ kwargs.update(locals()) @@ -425,6 +428,7 @@ def updateDeviceSwitchRoutingInterface(self, serial: str, interfaceId: str, **kw "ipv6", "vrf", "loopback", + "bidirectionalForwardingDetection", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -497,6 +501,8 @@ def updateDeviceSwitchRoutingInterfaceDhcp(self, serial: str, interfaceId: str, - dhcpOptions (array): Array of DHCP options consisting of code, type and value for the DHCP server running on the switch interface - reservedIpRanges (array): Array of DHCP reserved IP assignments for the DHCP server running on the switch interface - fixedIpAssignments (array): Array of DHCP fixed IP assignments for the DHCP server running on the switch interface + - dhcpDefaultRouterIps (string): The DHCP default router IPs for the DHCP server running on the switch interface + - dhcpDomainName (string): The DHCP domain name for the DHCP server running on the switch interface """ kwargs.update(locals()) @@ -537,6 +543,8 @@ def updateDeviceSwitchRoutingInterfaceDhcp(self, serial: str, interfaceId: str, "dhcpOptions", "reservedIpRanges", "fixedIpAssignments", + "dhcpDefaultRouterIps", + "dhcpDomainName", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2439,6 +2447,7 @@ def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher - loopback (object): The loopback settings of the interface. + - bidirectionalForwardingDetection (object): BFD configuration for the L3 interface. """ kwargs.update(locals()) @@ -2474,6 +2483,7 @@ def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId "ipv6", "vrf", "loopback", + "bidirectionalForwardingDetection", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2528,6 +2538,7 @@ def updateNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - ipv6 (object): The IPv6 settings of the interface. - vrf (object): The VRF settings of the interface. Requires IOS XE 17.18 or higher - loopback (object): The loopback settings of the interface. + - bidirectionalForwardingDetection (object): BFD configuration for the L3 interface. """ kwargs.update(locals()) @@ -2560,6 +2571,7 @@ def updateNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId "ipv6", "vrf", "loopback", + "bidirectionalForwardingDetection", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -2640,6 +2652,8 @@ def updateNetworkSwitchStackRoutingInterfaceDhcp(self, networkId: str, switchSta switch stack interface - reservedIpRanges (array): Array of DHCP reserved IP assignments for the DHCP server running on the switch stack interface - fixedIpAssignments (array): Array of DHCP fixed IP assignments for the DHCP server running on the switch stack interface + - dhcpDefaultRouterIps (string): The DHCP default router IPs for the DHCP server running on the switch stack interface + - dhcpDomainName (string): The DHCP domain name for the DHCP server running on the switch stack interface """ kwargs.update(locals()) @@ -2681,6 +2695,8 @@ def updateNetworkSwitchStackRoutingInterfaceDhcp(self, networkId: str, switchSta "dhcpOptions", "reservedIpRanges", "fixedIpAssignments", + "dhcpDefaultRouterIps", + "dhcpDomainName", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -3033,10 +3049,12 @@ def updateOrganizationConfigTemplateSwitchProfilePort( - configTemplateId (string): Config template ID - profileId (string): Profile ID - portId (string): Port ID - - name (string): The name of the switch template port. + - name (string): The name of the switch template port. Dashboard displays this value as the port description. For Cisco Catalyst switches running IOS XE, it corresponds to the configured interface description. - tags (array): The list of tags of the switch template port. - enabled (boolean): The status of the switch template port. - poeEnabled (boolean): The PoE status of the switch template port. + - perpetualPoe (object): Perpetual PoE settings for the switch template port. + - fastPoe (object): Fast PoE settings for the switch template port. - type (string): The type of the switch template port ('access', 'trunk', 'stack', 'routed', 'svl' or 'dad'). - vlan (integer): The VLAN of the switch template port. For a trunk port, this is the native VLAN. A null value will clear the value set for trunk ports. - voiceVlan (integer): The voice VLAN of the switch template port. Only applicable to access ports. @@ -3099,6 +3117,8 @@ def updateOrganizationConfigTemplateSwitchProfilePort( "tags", "enabled", "poeEnabled", + "perpetualPoe", + "fastPoe", "type", "vlan", "voiceVlan", diff --git a/meraki/api/wireless.py b/meraki/api/wireless.py index 050e2fa..52b3540 100644 --- a/meraki/api/wireless.py +++ b/meraki/api/wireless.py @@ -167,7 +167,7 @@ def updateDeviceWirelessElectronicShelfLabel(self, serial: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-electronic-shelf-label - serial (string): Serial - - channel (string): Desired ESL channel for the device, or 'Auto' (case insensitive) to use the recommended channel + - channel (string): Desired ESL channel for the device. Only configurable for devices assigned the High frequency ESL or sepioo IIoT role. Use 'Auto' (case insensitive) to use the recommended channel - enabled (boolean): Turn ESL features on and off for this device """ @@ -2278,6 +2278,37 @@ def getNetworkWirelessSsids(self, networkId: str): return self._session.get(metadata, resource) + def updateNetworkWirelessSsidsOwe(self, networkId: str, transitions: list, **kwargs): + """ + **Update the OWE transition pairs for a network** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ssids-owe + + - networkId (string): Network ID + - transitions (array): Array of OWE transition pairs + """ + + kwargs = locals() + + metadata = { + "tags": ["wireless", "configure", "ssids", "owe"], + "operation": "updateNetworkWirelessSsidsOwe", + } + networkId = urllib.parse.quote(str(networkId), safe="") + resource = f"/networks/{networkId}/wireless/ssids/owe" + + body_params = [ + "transitions", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"updateNetworkWirelessSsidsOwe: ignoring unrecognized kwargs: {invalid}") + + return self._session.put(metadata, resource, payload) + def getNetworkWirelessSsid(self, networkId: str, number: str): """ **Return a single MR SSID** @@ -3072,6 +3103,58 @@ def updateNetworkWirelessSsidOpenRoaming(self, networkId: str, number: str, **kw return self._session.put(metadata, resource, payload) + def getNetworkWirelessSsidOverrides(self, networkId: str, number: str): + """ + **Display the overrides for this SSID** + https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-ssid-overrides + + - networkId (string): Network ID + - number (string): Number + """ + + metadata = { + "tags": ["wireless", "configure", "ssids", "overrides"], + "operation": "getNetworkWirelessSsidOverrides", + } + networkId = urllib.parse.quote(str(networkId), safe="") + number = urllib.parse.quote(str(number), safe="") + resource = f"/networks/{networkId}/wireless/ssids/{number}/overrides" + + return self._session.get(metadata, resource) + + def updateNetworkWirelessSsidOverrides(self, networkId: str, number: str, **kwargs): + """ + **Update the overrides for this SSID** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ssid-overrides + + - networkId (string): Network ID + - number (string): Number + - ccxNameIeEnabled (boolean): When true, enables CCX name IE, which allows the AP to broadcast its device name as part of its beacon (as defined by the network admin in the Dashboard). + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "configure", "ssids", "overrides"], + "operation": "updateNetworkWirelessSsidOverrides", + } + networkId = urllib.parse.quote(str(networkId), safe="") + number = urllib.parse.quote(str(number), safe="") + resource = f"/networks/{networkId}/wireless/ssids/{number}/overrides" + + body_params = [ + "ccxNameIeEnabled", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning(f"updateNetworkWirelessSsidOverrides: ignoring unrecognized kwargs: {invalid}") + + return self._session.put(metadata, resource, payload) + def getNetworkWirelessSsidSchedules(self, networkId: str, number: str): """ **List the outage schedule for the SSID** @@ -5619,6 +5702,55 @@ def getOrganizationWirelessSsidsOpenRoamingByNetwork(self, organizationId: str, return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationWirelessSsidsOweByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **Returns an array of objects, each containing OWE transition pairs for the corresponding network** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-ssids-owe-by-network + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Optional parameter to filter OWE transition configuration by Network Id. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "configure", "ssids", "owe", "byNetwork"], + "operation": "getOrganizationWirelessSsidsOweByNetwork", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/ssids/owe/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"getOrganizationWirelessSsidsOweByNetwork: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationWirelessSsidsProfiles(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Returns the SSID profiles for an organization** @@ -5921,9 +6053,12 @@ def getOrganizationWirelessSsidsProfilesOverviews(self, organizationId: str, tot - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - name (string): (Optional) Filter results by name. Case insensitive substring match. - - sortBy (string): Column to sort results by. Default is `name`. - - sortOrder (string): Direction to sort results by. Default is `asc`. + - sortBy (string): Sort by `name` or `attached`. Default is `name`. For `attached`, provide `networkIds` and `ssidNumbers`. With `sortOrder=asc`, attached profile is first. With `sortOrder=desc`, it is last. + - sortOrder (string): Sort direction for either `sortBy` mode. Default is `asc`. - profileIds (array): (Optional) Filter results by a list of SSID profile IDs. + - networkIds (array): (Optional) Network ID for the selected SSID. Provide one value. Required when `attachable` is true. + - ssidNumbers (array): (Optional) SSID number (0-14) for the selected SSID. Provide one value. Required when `attachable` is true. + - attachable (boolean): (Optional) When true, returns profiles not assigned to another SSID in the selected network. Includes the currently attached profile. Requires `networkIds` and `ssidNumbers`. - 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. @@ -5932,7 +6067,7 @@ def getOrganizationWirelessSsidsProfilesOverviews(self, organizationId: str, tot kwargs.update(locals()) if "sortBy" in kwargs: - options = ["name"] + options = ["attached", "name"] assert kwargs["sortBy"] in options, ( f'''"sortBy" cannot be "{kwargs["sortBy"]}", & must be set to one of: {options}''' ) @@ -5954,6 +6089,9 @@ def getOrganizationWirelessSsidsProfilesOverviews(self, organizationId: str, tot "sortBy", "sortOrder", "profileIds", + "networkIds", + "ssidNumbers", + "attachable", "perPage", "startingAfter", "endingBefore", @@ -5962,6 +6100,8 @@ def getOrganizationWirelessSsidsProfilesOverviews(self, organizationId: str, tot array_params = [ "profileIds", + "networkIds", + "ssidNumbers", ] for k, v in kwargs.items(): if k.strip() in array_params: diff --git a/pyproject.toml b/pyproject.toml index 2a2cc70..3fb26a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "meraki" -version = "4.5.0" +version = "4.6.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 467d706..6608987 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 3 +revision = 5 requires-python = ">=3.11" [[package]] @@ -363,7 +363,7 @@ wheels = [ [[package]] name = "meraki" -version = "4.5.0" +version = "4.6.0" source = { editable = "." } dependencies = [ { name = "httpx" },