diff --git a/docs/generation-report.md b/docs/generation-report.md index 5a9e2a4..c59fd21 100644 --- a/docs/generation-report.md +++ b/docs/generation-report.md @@ -1,5 +1,11 @@ # Generation Report +## 2026-06-24 | Library v4.2.0b3 | API 1.71.0-beta.3 + + +No Python keyword parameter conflicts detected. + + ## 2026-06-17 | Library v4.2.0b2 | API 1.71.0-beta.2 diff --git a/meraki/__init__.py b/meraki/__init__.py index 8851b13..84d8582 100644 --- a/meraki/__init__.py +++ b/meraki/__init__.py @@ -59,7 +59,7 @@ from meraki._version import __version__ # noqa: F401 from datetime import datetime -__api_version__ = "1.71.0-beta.2" +__api_version__ = "1.71.0-beta.3" __all__ = [ "APIError", diff --git a/meraki/_version.py b/meraki/_version.py index b6bcb5a..e3503fc 100644 --- a/meraki/_version.py +++ b/meraki/_version.py @@ -1 +1 @@ -__version__ = "4.2.0b2" +__version__ = "4.2.0b3" diff --git a/meraki/aio/api/appliance.py b/meraki/aio/api/appliance.py index a7099f2..7d7f83e 100644 --- a/meraki/aio/api/appliance.py +++ b/meraki/aio/api/appliance.py @@ -1152,6 +1152,7 @@ def createNetworkApplianceInterfacesL3(self, networkId: str, ipv4: dict, **kwarg - networkId (string): Network ID - ipv4 (object): IPv4 configuration - port (object): Port configuration + - vrf (object): VRF assignment for the L3 interface """ kwargs.update(locals()) @@ -1166,6 +1167,7 @@ def createNetworkApplianceInterfacesL3(self, networkId: str, ipv4: dict, **kwarg body_params = [ "port", "ipv4", + "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1186,6 +1188,7 @@ def updateNetworkApplianceInterfacesL3(self, networkId: str, interfaceId: str, * - interfaceId (string): Interface ID - port (object): Port configuration - ipv4 (object): IPv4 configuration + - vrf (object): VRF assignment for the L3 interface """ kwargs.update(locals()) @@ -1201,6 +1204,7 @@ def updateNetworkApplianceInterfacesL3(self, networkId: str, interfaceId: str, * body_params = [ "port", "ipv4", + "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1687,6 +1691,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 """ @@ -1711,6 +1716,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} @@ -1873,7 +1879,7 @@ def updateNetworkApplianceSingleLan(self, networkId: str, **kwargs): - applianceIp (string): The appliance IP address of the single LAN - ipv6 (object): IPv6 configuration on the VLAN - mandatoryDhcp (object): Mandatory DHCP will enforce that clients connecting to this LAN must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. Only available on firmware versions 17.0 and above - - vrf (object): VRF configuration on the Single LAN + - vrf (object): VRF configuration on the Single LAN. Omit this field to preserve the current VRF. """ kwargs.update(locals()) @@ -3159,12 +3165,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. 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. + - vpnAsNumber (integer): Network specific number of the Autonomous System to which the appliance belongs. + - 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 and kwargs["priorityRoute"] is not None: + 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", @@ -3176,6 +3192,10 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): "enabled", "asNumber", "ibgpHoldTimer", + "ipv6", + "tunnelDownTermination", + "vpnAsNumber", + "priorityRoute", "routerId", "neighbors", ] @@ -4564,6 +4584,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 ): diff --git a/meraki/aio/api/assistant.py b/meraki/aio/api/assistant.py index b34084b..3dfece6 100644 --- a/meraki/aio/api/assistant.py +++ b/meraki/aio/api/assistant.py @@ -359,7 +359,7 @@ def getOrganizationAssistantChatThreadMessageArtifacts(self, organizationId: str return self._session.get(metadata, resource) def getOrganizationAssistantChatThreadMessageArtifact( - self, organizationId: str, threadId: str, messageId: str, artifactId: str + self, organizationId: str, threadId: str, messageId: str, artifactId: str, total_pages=1, direction="next", **kwargs ): """ **Return a single artifact with its full content.** @@ -369,8 +369,14 @@ def getOrganizationAssistantChatThreadMessageArtifact( - threadId (string): Thread ID - messageId (string): Message ID - artifactId (string): Artifact 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 + - page (integer): Page number for paginated artifact content, defaulting to 1 + - perPage (integer): Number of entries per page. Defaults to 100. Maximum 1000. """ + kwargs.update(locals()) + metadata = { "tags": ["assistant", "configure", "chat", "threads", "messages", "artifacts"], "operation": "getOrganizationAssistantChatThreadMessageArtifact", @@ -383,7 +389,21 @@ def getOrganizationAssistantChatThreadMessageArtifact( f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages/{messageId}/artifacts/{artifactId}" ) - return self._session.get(metadata, resource) + query_params = [ + "page", + "perPage", + ] + 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"getOrganizationAssistantChatThreadMessageArtifact: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) def getOrganizationAssistantChatThreadMessageFeedback(self, organizationId: str, threadId: str, messageId: str): """ diff --git a/meraki/aio/api/organizations.py b/meraki/aio/api/organizations.py index 7494507..bc8629e 100644 --- a/meraki/aio/api/organizations.py +++ b/meraki/aio/api/organizations.py @@ -1350,18 +1350,29 @@ def getOrganizationApiPushTopics(self, organizationId: str): return self._session.get(metadata, resource) - def getOrganizationApiRestProvisioningPipelines(self, organizationId: str, **kwargs): + def getOrganizationApiRestProvisioningPipelines(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **List pipeline IDs for the organization, with optional status and timespan filtering** + **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 - - status (string): If provided, filters pipelines by status. If omitted, pipelines of all statuses are returned. + - 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, ( @@ -1376,6 +1387,10 @@ def getOrganizationApiRestProvisioningPipelines(self, organizationId: str, **kwa resource = f"/organizations/{organizationId}/api/rest/provisioning/pipelines" query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "sortOrder", "status", "timespan", ] @@ -1389,7 +1404,7 @@ def getOrganizationApiRestProvisioningPipelines(self, organizationId: str, **kwa f"getOrganizationApiRestProvisioningPipelines: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) def getOrganizationApiRestProvisioningPipelinesJobs(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ @@ -2371,9 +2386,10 @@ def getOrganizationAssuranceClientsConnectedCountHistory(self, organizationId: s - organizationId (string): Organization ID - networkId (string): Network ID to query. - - serials (array): A list of serials of AP devices + - serials (array): A list of serials of wireless AP or wired switch devices - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - ssidNumbers (array): Filter results by SSID number + - deviceType (string): Filter connected client counts by device type. - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 8 hours. If interval is provided, the timespan will be autocalculated. @@ -2382,6 +2398,12 @@ def getOrganizationAssuranceClientsConnectedCountHistory(self, organizationId: s kwargs.update(locals()) + if "deviceType" in kwargs: + options = ["access_point", "switch"] + assert kwargs["deviceType"] in options, ( + f'''"deviceType" cannot be "{kwargs["deviceType"]}", & must be set to one of: {options}''' + ) + metadata = { "tags": ["organizations", "monitor", "clients", "connectedCountHistory"], "operation": "getOrganizationAssuranceClientsConnectedCountHistory", @@ -2394,6 +2416,7 @@ def getOrganizationAssuranceClientsConnectedCountHistory(self, organizationId: s "serials", "bands", "ssidNumbers", + "deviceType", "t0", "t1", "timespan", @@ -4546,6 +4569,208 @@ def getOrganizationCloudConnectivityRequirements(self, organizationId: str): return self._session.get(metadata, resource) + def getOrganizationComputeApplicationDeployments(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **List the Application Deployment agent configurations for all hosts under this organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-compute-application-deployments + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - developerNames (array): Filters deployments by application developer name + - applicationNames (array): Filters deployments by application name + - enabled (boolean): Filters deployments by their enabled status + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "compute", "application", "deployments"], + "operation": "getOrganizationComputeApplicationDeployments", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/compute/application/deployments" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "developerNames", + "applicationNames", + "enabled", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "developerNames", + "applicationNames", + ] + 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"getOrganizationComputeApplicationDeployments: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def createOrganizationComputeApplicationDeploymentsBulkCreate( + self, organizationId: str, hosts: list, application: dict, enabled: bool, **kwargs + ): + """ + **Add Application Deployment agents for a list of hosts** + https://developer.cisco.com/meraki/api-v1/#!create-organization-compute-application-deployments-bulk-create + + - organizationId (string): Organization ID + - hosts (array): List of hosts to deploy applications on + - application (object): Application information + - enabled (boolean): Whether the deployment should be enabled + - applicationConfiguration (object): Optional: Generic object for application-specific configuration + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "compute", "application", "deployments", "bulkCreate"], + "operation": "createOrganizationComputeApplicationDeploymentsBulkCreate", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/compute/application/deployments/bulkCreate" + + body_params = [ + "hosts", + "application", + "enabled", + "applicationConfiguration", + ] + 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"createOrganizationComputeApplicationDeploymentsBulkCreate: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def updateOrganizationComputeApplicationDeployment(self, organizationId: str, deploymentId: str, enabled: bool, **kwargs): + """ + **Update a Deployment agent configuration** + https://developer.cisco.com/meraki/api-v1/#!update-organization-compute-application-deployment + + - organizationId (string): Organization ID + - deploymentId (string): Deployment ID + - enabled (boolean): Whether or not the Application Deployment agent is enabled for the host. + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "compute", "application", "deployments"], + "operation": "updateOrganizationComputeApplicationDeployment", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + deploymentId = urllib.parse.quote(str(deploymentId), safe="") + resource = f"/organizations/{organizationId}/compute/application/deployments/{deploymentId}" + + body_params = [ + "enabled", + ] + 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"updateOrganizationComputeApplicationDeployment: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def deleteOrganizationComputeApplicationDeployment(self, organizationId: str, deploymentId: str): + """ + **Delete a Application Deployment agent from the host** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-compute-application-deployment + + - organizationId (string): Organization ID + - deploymentId (string): Deployment ID + """ + + metadata = { + "tags": ["organizations", "configure", "compute", "application", "deployments"], + "operation": "deleteOrganizationComputeApplicationDeployment", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + deploymentId = urllib.parse.quote(str(deploymentId), safe="") + resource = f"/organizations/{organizationId}/compute/application/deployments/{deploymentId}" + + return self._session.delete(metadata, resource) + + def getOrganizationComputeHosts( + self, organizationId: str, developerName: str, applicationName: str, total_pages=1, direction="next", **kwargs + ): + """ + **Retrieves a list of compute hosts eligible for application deployment within a given organization, filtered by the specified application developer and application name, with optional network ID filtering.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-compute-hosts + + - organizationId (string): Organization ID + - developerName (string): Filters hosts by application developer name + - applicationName (string): Filters hosts by application name + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Filters hosts by the network ID they belong to + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "compute", "hosts"], + "operation": "getOrganizationComputeHosts", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/compute/hosts" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "developerName", + "applicationName", + "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"getOrganizationComputeHosts: ignoring unrecognized kwargs: {invalid}") + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationConfigTemplates(self, organizationId: str): """ **List the configuration templates for this organization** @@ -11456,39 +11681,6 @@ def detachOrganizationSaseSites(self, organizationId: str, **kwargs): return self._session.delete(metadata, resource) - def enrollOrganizationSaseSites(self, organizationId: str, **kwargs): - """ - **Enroll sites in this organization to Secure Access** - https://developer.cisco.com/meraki/api-v1/#!enroll-organization-sase-sites - - - organizationId (string): Organization ID - - items (array): List of Meraki SD-WAN sites with the associated regions to be enrolled. - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "sase", "sites"], - "operation": "enrollOrganizationSaseSites", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sase/sites/enroll" - - body_params = [ - "items", - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"enrollOrganizationSaseSites: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - def updateOrganizationSaseSite(self, organizationId: str, siteId: str, **kwargs): """ **Update the configuration for a site** diff --git a/meraki/aio/api/switch.py b/meraki/aio/api/switch.py index 746bbca..e443672 100644 --- a/meraki/aio/api/switch.py +++ b/meraki/aio/api/switch.py @@ -2553,8 +2553,8 @@ def updateNetworkSwitchStack(self, networkId: str, switchStackId: str, **kwargs) - networkId (string): Network ID - switchStackId (string): Switch stack ID - - name (string): The name of the stack - - members (array): The list of switches that should be in the stack + - name (string): The name of the switch stack + - members (array): The complete list of switches that should be in the stack. Minimum 2 and maximum 8 members. Omitting this field leaves stack membership unchanged. """ kwargs.update(locals()) diff --git a/meraki/aio/api/wireless.py b/meraki/aio/api/wireless.py index 1e10213..8085bb2 100644 --- a/meraki/aio/api/wireless.py +++ b/meraki/aio/api/wireless.py @@ -4630,6 +4630,7 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwo - bands (array): Filter results by band. - contributor (string): Contributor for which to retrieve insights. If not specified, returns overall insights. - subContributor (string): Sub-contributor for which to retrieve insights. If not specified, returns all sub contributor insights. + - insights (string): Insights version to use. - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. @@ -4645,6 +4646,11 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwo assert kwargs["contributor"] in options, ( f'''"contributor" cannot be "{kwargs["contributor"]}", & must be set to one of: {options}''' ) + if "insights" in kwargs: + options = ["1", "2"] + assert kwargs["insights"] in options, ( + f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' + ) metadata = { "tags": ["wireless", "configure", "experience", "channelAvailability", "insights", "byNetwork"], @@ -4660,6 +4666,7 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwo "bands", "contributor", "subContributor", + "insights", "t0", "t1", "timespan", @@ -5317,6 +5324,8 @@ def getOrganizationAssuranceWirelessExperienceCoverageInsightsByNetwork( - ssidNumbers (array): Filter results by SSID number. - bands (array): Filter results by band. - contributor (string): Contributor for which to retrieve insights. If not specified, returns overall insights. + - subContributor (string): Sub-contributor for which to retrieve insights. If not specified, returns all sub contributor insights. + - insights (string): Insights version to use. - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. @@ -5332,6 +5341,11 @@ def getOrganizationAssuranceWirelessExperienceCoverageInsightsByNetwork( assert kwargs["contributor"] in options, ( f'''"contributor" cannot be "{kwargs["contributor"]}", & must be set to one of: {options}''' ) + if "insights" in kwargs: + options = ["1", "2"] + assert kwargs["insights"] in options, ( + f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' + ) metadata = { "tags": ["wireless", "configure", "experience", "coverage", "insights", "byNetwork"], @@ -5346,6 +5360,8 @@ def getOrganizationAssuranceWirelessExperienceCoverageInsightsByNetwork( "ssidNumbers", "bands", "contributor", + "subContributor", + "insights", "t0", "t1", "timespan", diff --git a/meraki/api/appliance.py b/meraki/api/appliance.py index 2886703..fa7b1fd 100644 --- a/meraki/api/appliance.py +++ b/meraki/api/appliance.py @@ -1152,6 +1152,7 @@ def createNetworkApplianceInterfacesL3(self, networkId: str, ipv4: dict, **kwarg - networkId (string): Network ID - ipv4 (object): IPv4 configuration - port (object): Port configuration + - vrf (object): VRF assignment for the L3 interface """ kwargs.update(locals()) @@ -1166,6 +1167,7 @@ def createNetworkApplianceInterfacesL3(self, networkId: str, ipv4: dict, **kwarg body_params = [ "port", "ipv4", + "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1186,6 +1188,7 @@ def updateNetworkApplianceInterfacesL3(self, networkId: str, interfaceId: str, * - interfaceId (string): Interface ID - port (object): Port configuration - ipv4 (object): IPv4 configuration + - vrf (object): VRF assignment for the L3 interface """ kwargs.update(locals()) @@ -1201,6 +1204,7 @@ def updateNetworkApplianceInterfacesL3(self, networkId: str, interfaceId: str, * body_params = [ "port", "ipv4", + "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -1687,6 +1691,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 """ @@ -1711,6 +1716,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} @@ -1873,7 +1879,7 @@ def updateNetworkApplianceSingleLan(self, networkId: str, **kwargs): - applianceIp (string): The appliance IP address of the single LAN - ipv6 (object): IPv6 configuration on the VLAN - mandatoryDhcp (object): Mandatory DHCP will enforce that clients connecting to this LAN must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. Only available on firmware versions 17.0 and above - - vrf (object): VRF configuration on the Single LAN + - vrf (object): VRF configuration on the Single LAN. Omit this field to preserve the current VRF. """ kwargs.update(locals()) @@ -3159,12 +3165,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. 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. + - vpnAsNumber (integer): Network specific number of the Autonomous System to which the appliance belongs. + - 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 and kwargs["priorityRoute"] is not None: + 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", @@ -3176,6 +3192,10 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): "enabled", "asNumber", "ibgpHoldTimer", + "ipv6", + "tunnelDownTermination", + "vpnAsNumber", + "priorityRoute", "routerId", "neighbors", ] @@ -4564,6 +4584,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 ): diff --git a/meraki/api/assistant.py b/meraki/api/assistant.py index 9923c9d..e76b269 100644 --- a/meraki/api/assistant.py +++ b/meraki/api/assistant.py @@ -359,7 +359,7 @@ def getOrganizationAssistantChatThreadMessageArtifacts(self, organizationId: str return self._session.get(metadata, resource) def getOrganizationAssistantChatThreadMessageArtifact( - self, organizationId: str, threadId: str, messageId: str, artifactId: str + self, organizationId: str, threadId: str, messageId: str, artifactId: str, total_pages=1, direction="next", **kwargs ): """ **Return a single artifact with its full content.** @@ -369,8 +369,14 @@ def getOrganizationAssistantChatThreadMessageArtifact( - threadId (string): Thread ID - messageId (string): Message ID - artifactId (string): Artifact 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 + - page (integer): Page number for paginated artifact content, defaulting to 1 + - perPage (integer): Number of entries per page. Defaults to 100. Maximum 1000. """ + kwargs.update(locals()) + metadata = { "tags": ["assistant", "configure", "chat", "threads", "messages", "artifacts"], "operation": "getOrganizationAssistantChatThreadMessageArtifact", @@ -383,7 +389,21 @@ def getOrganizationAssistantChatThreadMessageArtifact( f"/organizations/{organizationId}/assistant/chat/threads/{threadId}/messages/{messageId}/artifacts/{artifactId}" ) - return self._session.get(metadata, resource) + query_params = [ + "page", + "perPage", + ] + 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"getOrganizationAssistantChatThreadMessageArtifact: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) def getOrganizationAssistantChatThreadMessageFeedback(self, organizationId: str, threadId: str, messageId: str): """ diff --git a/meraki/api/batch/appliance.py b/meraki/api/batch/appliance.py index 1f10f7e..461f1c1 100644 --- a/meraki/api/batch/appliance.py +++ b/meraki/api/batch/appliance.py @@ -303,6 +303,7 @@ def createNetworkApplianceInterfacesL3(self, networkId: str, ipv4: dict, **kwarg - networkId (string): Network ID - ipv4 (object): IPv4 configuration - port (object): Port configuration + - vrf (object): VRF assignment for the L3 interface """ kwargs.update(locals()) @@ -313,6 +314,7 @@ def createNetworkApplianceInterfacesL3(self, networkId: str, ipv4: dict, **kwarg body_params = [ "port", "ipv4", + "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -331,6 +333,7 @@ def updateNetworkApplianceInterfacesL3(self, networkId: str, interfaceId: str, * - interfaceId (string): Interface ID - port (object): Port configuration - ipv4 (object): IPv4 configuration + - vrf (object): VRF assignment for the L3 interface """ kwargs.update(locals()) @@ -342,6 +345,7 @@ def updateNetworkApplianceInterfacesL3(self, networkId: str, interfaceId: str, * body_params = [ "port", "ipv4", + "vrf", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -650,7 +654,7 @@ def updateNetworkApplianceSingleLan(self, networkId: str, **kwargs): - applianceIp (string): The appliance IP address of the single LAN - ipv6 (object): IPv6 configuration on the VLAN - mandatoryDhcp (object): Mandatory DHCP will enforce that clients connecting to this LAN must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. Only available on firmware versions 17.0 and above - - vrf (object): VRF configuration on the Single LAN + - vrf (object): VRF configuration on the Single LAN. Omit this field to preserve the current VRF. """ kwargs.update(locals()) @@ -1389,12 +1393,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. 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. + - vpnAsNumber (integer): Network specific number of the Autonomous System to which the appliance belongs. + - 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 and kwargs["priorityRoute"] is not None: + 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" @@ -1402,6 +1416,10 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): "enabled", "asNumber", "ibgpHoldTimer", + "ipv6", + "tunnelDownTermination", + "vpnAsNumber", + "priorityRoute", "routerId", "neighbors", ] @@ -1889,6 +1907,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/organizations.py b/meraki/api/batch/organizations.py index 6bf37b2..3718ecf 100644 --- a/meraki/api/batch/organizations.py +++ b/meraki/api/batch/organizations.py @@ -952,6 +952,85 @@ def importOrganizationCertificates(self, organizationId: str, managedBy: str, co } return action + def createOrganizationComputeApplicationDeploymentsBulkCreate( + self, organizationId: str, hosts: list, application: dict, enabled: bool, **kwargs + ): + """ + **Add Application Deployment agents for a list of hosts. Only valid for hosts with access to Meraki Insight.** + https://developer.cisco.com/meraki/api-v1/#!create-organization-compute-application-deployments-bulk-create + + - organizationId (string): Organization ID + - hosts (array): List of hosts to deploy applications on + - application (object): Application information + - enabled (boolean): Whether the deployment should be enabled + - applicationConfiguration (object): Optional: Generic object for application-specific configuration + """ + + kwargs.update(locals()) + + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/compute/application/deployments/bulkCreate" + + body_params = [ + "hosts", + "application", + "enabled", + "applicationConfiguration", + ] + 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 updateOrganizationComputeApplicationDeployment(self, organizationId: str, deploymentId: str, enabled: bool, **kwargs): + """ + **Update a Deployment agent configuration. Only valid for hosts with access to Meraki Insight.** + https://developer.cisco.com/meraki/api-v1/#!update-organization-compute-application-deployment + + - organizationId (string): Organization ID + - deploymentId (string): Deployment ID + - enabled (boolean): Whether or not the Application Deployment agent is enabled for the host. + """ + + kwargs = locals() + + organizationId = urllib.parse.quote(str(organizationId), safe="") + deploymentId = urllib.parse.quote(str(deploymentId), safe="") + resource = f"/organizations/{organizationId}/compute/application/deployments/{deploymentId}" + + body_params = [ + "enabled", + ] + 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 deleteOrganizationComputeApplicationDeployment(self, organizationId: str, deploymentId: str): + """ + **Delete a Application Deployment agent from the host. Only valid for host with access to Meraki Insight.** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-compute-application-deployment + + - organizationId (string): Organization ID + - deploymentId (string): Deployment ID + """ + + organizationId = urllib.parse.quote(str(organizationId), safe="") + deploymentId = urllib.parse.quote(str(deploymentId), safe="") + resource = f"/organizations/{organizationId}/compute/application/deployments/{deploymentId}" + + action = { + "resource": resource, + "operation": "action", + } + return action + def createOrganizationConfigTemplate(self, organizationId: str, name: str, **kwargs): """ **Create a new configuration template** @@ -2975,33 +3054,6 @@ def detachOrganizationSaseSites(self, organizationId: str, **kwargs): } return action - def enrollOrganizationSaseSites(self, organizationId: str, **kwargs): - """ - **Enroll sites in this organization to Secure Access. For an organization, a maximum of 2500 sites can be enrolled if they are in spoke mode or a maximum of 10 sites can be enrolled in hub mode.** - https://developer.cisco.com/meraki/api-v1/#!enroll-organization-sase-sites - - - organizationId (string): Organization ID - - items (array): List of Meraki SD-WAN sites with the associated regions to be enrolled. - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sase/sites/enroll" - - body_params = [ - "items", - "callback", - ] - 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 updateOrganizationSaseSite(self, organizationId: str, siteId: str, **kwargs): """ **Update the configuration for a site. Currently, only supports updating default route enablement.** diff --git a/meraki/api/batch/switch.py b/meraki/api/batch/switch.py index 374ef2b..b7b8163 100644 --- a/meraki/api/batch/switch.py +++ b/meraki/api/batch/switch.py @@ -1433,13 +1433,13 @@ def updateNetworkSwitchSpanningTree(self, networkId: str, **kwargs): def updateNetworkSwitchStack(self, networkId: str, switchStackId: str, **kwargs): """ - **Update a switch stack** + **Update a switch stack. At least one of 'name' or 'members' must be provided. If 'members' is provided, it replaces the entire stack membership.** https://developer.cisco.com/meraki/api-v1/#!update-network-switch-stack - networkId (string): Network ID - switchStackId (string): Switch stack ID - - name (string): The name of the stack - - members (array): The list of switches that should be in the stack + - name (string): The name of the switch stack + - members (array): The complete list of switches that should be in the stack. Minimum 2 and maximum 8 members. Omitting this field leaves stack membership unchanged. """ kwargs.update(locals()) diff --git a/meraki/api/organizations.py b/meraki/api/organizations.py index f15cdfd..7361921 100644 --- a/meraki/api/organizations.py +++ b/meraki/api/organizations.py @@ -1350,18 +1350,29 @@ def getOrganizationApiPushTopics(self, organizationId: str): return self._session.get(metadata, resource) - def getOrganizationApiRestProvisioningPipelines(self, organizationId: str, **kwargs): + def getOrganizationApiRestProvisioningPipelines(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ - **List pipeline IDs for the organization, with optional status and timespan filtering** + **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 - - status (string): If provided, filters pipelines by status. If omitted, pipelines of all statuses are returned. + - 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, ( @@ -1376,6 +1387,10 @@ def getOrganizationApiRestProvisioningPipelines(self, organizationId: str, **kwa resource = f"/organizations/{organizationId}/api/rest/provisioning/pipelines" query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "sortOrder", "status", "timespan", ] @@ -1389,7 +1404,7 @@ def getOrganizationApiRestProvisioningPipelines(self, organizationId: str, **kwa f"getOrganizationApiRestProvisioningPipelines: ignoring unrecognized kwargs: {invalid}" ) - return self._session.get(metadata, resource, params) + return self._session.get_pages(metadata, resource, params, total_pages, direction) def getOrganizationApiRestProvisioningPipelinesJobs(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ @@ -2371,9 +2386,10 @@ def getOrganizationAssuranceClientsConnectedCountHistory(self, organizationId: s - organizationId (string): Organization ID - networkId (string): Network ID to query. - - serials (array): A list of serials of AP devices + - serials (array): A list of serials of wireless AP or wired switch devices - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. - ssidNumbers (array): Filter results by SSID number + - deviceType (string): Filter connected client counts by device type. - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0. - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 8 hours. If interval is provided, the timespan will be autocalculated. @@ -2382,6 +2398,12 @@ def getOrganizationAssuranceClientsConnectedCountHistory(self, organizationId: s kwargs.update(locals()) + if "deviceType" in kwargs: + options = ["access_point", "switch"] + assert kwargs["deviceType"] in options, ( + f'''"deviceType" cannot be "{kwargs["deviceType"]}", & must be set to one of: {options}''' + ) + metadata = { "tags": ["organizations", "monitor", "clients", "connectedCountHistory"], "operation": "getOrganizationAssuranceClientsConnectedCountHistory", @@ -2394,6 +2416,7 @@ def getOrganizationAssuranceClientsConnectedCountHistory(self, organizationId: s "serials", "bands", "ssidNumbers", + "deviceType", "t0", "t1", "timespan", @@ -4546,6 +4569,208 @@ def getOrganizationCloudConnectivityRequirements(self, organizationId: str): return self._session.get(metadata, resource) + def getOrganizationComputeApplicationDeployments(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **List the Application Deployment agent configurations for all hosts under this organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-compute-application-deployments + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - developerNames (array): Filters deployments by application developer name + - applicationNames (array): Filters deployments by application name + - enabled (boolean): Filters deployments by their enabled status + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "compute", "application", "deployments"], + "operation": "getOrganizationComputeApplicationDeployments", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/compute/application/deployments" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "developerNames", + "applicationNames", + "enabled", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "developerNames", + "applicationNames", + ] + 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"getOrganizationComputeApplicationDeployments: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def createOrganizationComputeApplicationDeploymentsBulkCreate( + self, organizationId: str, hosts: list, application: dict, enabled: bool, **kwargs + ): + """ + **Add Application Deployment agents for a list of hosts** + https://developer.cisco.com/meraki/api-v1/#!create-organization-compute-application-deployments-bulk-create + + - organizationId (string): Organization ID + - hosts (array): List of hosts to deploy applications on + - application (object): Application information + - enabled (boolean): Whether the deployment should be enabled + - applicationConfiguration (object): Optional: Generic object for application-specific configuration + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "compute", "application", "deployments", "bulkCreate"], + "operation": "createOrganizationComputeApplicationDeploymentsBulkCreate", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/compute/application/deployments/bulkCreate" + + body_params = [ + "hosts", + "application", + "enabled", + "applicationConfiguration", + ] + 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"createOrganizationComputeApplicationDeploymentsBulkCreate: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def updateOrganizationComputeApplicationDeployment(self, organizationId: str, deploymentId: str, enabled: bool, **kwargs): + """ + **Update a Deployment agent configuration** + https://developer.cisco.com/meraki/api-v1/#!update-organization-compute-application-deployment + + - organizationId (string): Organization ID + - deploymentId (string): Deployment ID + - enabled (boolean): Whether or not the Application Deployment agent is enabled for the host. + """ + + kwargs = locals() + + metadata = { + "tags": ["organizations", "configure", "compute", "application", "deployments"], + "operation": "updateOrganizationComputeApplicationDeployment", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + deploymentId = urllib.parse.quote(str(deploymentId), safe="") + resource = f"/organizations/{organizationId}/compute/application/deployments/{deploymentId}" + + body_params = [ + "enabled", + ] + 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"updateOrganizationComputeApplicationDeployment: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def deleteOrganizationComputeApplicationDeployment(self, organizationId: str, deploymentId: str): + """ + **Delete a Application Deployment agent from the host** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-compute-application-deployment + + - organizationId (string): Organization ID + - deploymentId (string): Deployment ID + """ + + metadata = { + "tags": ["organizations", "configure", "compute", "application", "deployments"], + "operation": "deleteOrganizationComputeApplicationDeployment", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + deploymentId = urllib.parse.quote(str(deploymentId), safe="") + resource = f"/organizations/{organizationId}/compute/application/deployments/{deploymentId}" + + return self._session.delete(metadata, resource) + + def getOrganizationComputeHosts( + self, organizationId: str, developerName: str, applicationName: str, total_pages=1, direction="next", **kwargs + ): + """ + **Retrieves a list of compute hosts eligible for application deployment within a given organization, filtered by the specified application developer and application name, with optional network ID filtering.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-compute-hosts + + - organizationId (string): Organization ID + - developerName (string): Filters hosts by application developer name + - applicationName (string): Filters hosts by application name + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 100. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Filters hosts by the network ID they belong to + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "compute", "hosts"], + "operation": "getOrganizationComputeHosts", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/compute/hosts" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "developerName", + "applicationName", + "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"getOrganizationComputeHosts: ignoring unrecognized kwargs: {invalid}") + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationConfigTemplates(self, organizationId: str): """ **List the configuration templates for this organization** @@ -11456,39 +11681,6 @@ def detachOrganizationSaseSites(self, organizationId: str, **kwargs): return self._session.delete(metadata, resource) - def enrollOrganizationSaseSites(self, organizationId: str, **kwargs): - """ - **Enroll sites in this organization to Secure Access** - https://developer.cisco.com/meraki/api-v1/#!enroll-organization-sase-sites - - - organizationId (string): Organization ID - - items (array): List of Meraki SD-WAN sites with the associated regions to be enrolled. - - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret - """ - - kwargs.update(locals()) - - metadata = { - "tags": ["organizations", "configure", "sase", "sites"], - "operation": "enrollOrganizationSaseSites", - } - organizationId = urllib.parse.quote(str(organizationId), safe="") - resource = f"/organizations/{organizationId}/sase/sites/enroll" - - body_params = [ - "items", - "callback", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - - if self._session._validate_kwargs: - all_params = [] + body_params - invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] - if invalid and self._session._logger: - self._session._logger.warning(f"enrollOrganizationSaseSites: ignoring unrecognized kwargs: {invalid}") - - return self._session.post(metadata, resource, payload) - def updateOrganizationSaseSite(self, organizationId: str, siteId: str, **kwargs): """ **Update the configuration for a site** diff --git a/meraki/api/switch.py b/meraki/api/switch.py index ca432ea..327f942 100644 --- a/meraki/api/switch.py +++ b/meraki/api/switch.py @@ -2553,8 +2553,8 @@ def updateNetworkSwitchStack(self, networkId: str, switchStackId: str, **kwargs) - networkId (string): Network ID - switchStackId (string): Switch stack ID - - name (string): The name of the stack - - members (array): The list of switches that should be in the stack + - name (string): The name of the switch stack + - members (array): The complete list of switches that should be in the stack. Minimum 2 and maximum 8 members. Omitting this field leaves stack membership unchanged. """ kwargs.update(locals()) diff --git a/meraki/api/wireless.py b/meraki/api/wireless.py index 79d1bdd..c4c5088 100644 --- a/meraki/api/wireless.py +++ b/meraki/api/wireless.py @@ -4630,6 +4630,7 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwo - bands (array): Filter results by band. - contributor (string): Contributor for which to retrieve insights. If not specified, returns overall insights. - subContributor (string): Sub-contributor for which to retrieve insights. If not specified, returns all sub contributor insights. + - insights (string): Insights version to use. - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. @@ -4645,6 +4646,11 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwo assert kwargs["contributor"] in options, ( f'''"contributor" cannot be "{kwargs["contributor"]}", & must be set to one of: {options}''' ) + if "insights" in kwargs: + options = ["1", "2"] + assert kwargs["insights"] in options, ( + f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' + ) metadata = { "tags": ["wireless", "configure", "experience", "channelAvailability", "insights", "byNetwork"], @@ -4660,6 +4666,7 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwo "bands", "contributor", "subContributor", + "insights", "t0", "t1", "timespan", @@ -5317,6 +5324,8 @@ def getOrganizationAssuranceWirelessExperienceCoverageInsightsByNetwork( - ssidNumbers (array): Filter results by SSID number. - bands (array): Filter results by band. - contributor (string): Contributor for which to retrieve insights. If not specified, returns overall insights. + - subContributor (string): Sub-contributor for which to retrieve insights. If not specified, returns all sub contributor insights. + - insights (string): Insights version to use. - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 14 days from today. - t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0. - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 15 minutes and be less than or equal to 14 days. The default is 2 hours. @@ -5332,6 +5341,11 @@ def getOrganizationAssuranceWirelessExperienceCoverageInsightsByNetwork( assert kwargs["contributor"] in options, ( f'''"contributor" cannot be "{kwargs["contributor"]}", & must be set to one of: {options}''' ) + if "insights" in kwargs: + options = ["1", "2"] + assert kwargs["insights"] in options, ( + f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' + ) metadata = { "tags": ["wireless", "configure", "experience", "coverage", "insights", "byNetwork"], @@ -5346,6 +5360,8 @@ def getOrganizationAssuranceWirelessExperienceCoverageInsightsByNetwork( "ssidNumbers", "bands", "contributor", + "subContributor", + "insights", "t0", "t1", "timespan", diff --git a/pyproject.toml b/pyproject.toml index 6c19b93..1c3a31f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "meraki" -version = "4.2.0b2" +version = "4.2.0b3" description = "Cisco Meraki Dashboard API library" authors = [ {name = "Cisco Meraki", email = "api-feedback@meraki.net"} diff --git a/uv.lock b/uv.lock index e15d3d3..e80c5d6 100644 --- a/uv.lock +++ b/uv.lock @@ -314,7 +314,7 @@ wheels = [ [[package]] name = "meraki" -version = "4.2.0b2" +version = "4.2.0b3" source = { editable = "." } dependencies = [ { name = "httpx" },