diff --git a/docs/generation-report.md b/docs/generation-report.md index 46c6962..feb0f7e 100644 --- a/docs/generation-report.md +++ b/docs/generation-report.md @@ -1,5 +1,11 @@ # Generation Report +## 2026-10-07 | Library v4.6.0b0 | API 1.75.0-beta.0 + + +No Python keyword parameter conflicts detected. + + ## 2026-09-30 | Library v4.5.0b4 | API 1.74.0-beta.4 diff --git a/meraki/__init__.py b/meraki/__init__.py index b20efe8..2ecdcfc 100644 --- a/meraki/__init__.py +++ b/meraki/__init__.py @@ -57,7 +57,7 @@ from meraki.exceptions import APIError, APIKeyError, APIResponseError, AsyncAPIError from meraki.rest_session import RestSession -__api_version__ = "1.74.0-beta.4" +__api_version__ = "1.75.0-beta.0" __all__ = [ "APIError", diff --git a/meraki/_version.py b/meraki/_version.py index 885b52e..bdf65f2 100644 --- a/meraki/_version.py +++ b/meraki/_version.py @@ -1 +1 @@ -__version__ = "4.5.0b4" +__version__ = "4.6.0b0" diff --git a/meraki/aio/api/campusGateway.py b/meraki/aio/api/campusGateway.py index 09c0a5f..a85a43c 100644 --- a/meraki/aio/api/campusGateway.py +++ b/meraki/aio/api/campusGateway.py @@ -759,6 +759,7 @@ def getOrganizationCampusGatewayConnections(self, organizationId: str, total_pag - campusGatewaySerials (array): Optional parameter to filter connections(APs) by MCG serials. This filter uses multiple exact matches. - campusGatewayClusterIds (array): Optional parameter to filter connections(APs) by MCG cluster IDs. This filter uses multiple exact matches. - campusGatewayTunnelStatuses (array): Optional parameter to filter connections(APs) by tunnel statuses. This filter uses multiple exact matches. + - campusGatewayPriorities (array): Optional parameter to filter connections(APs) by Campus Gateway tunnel priority. Use 0 for primary or 1 for backup. This filter uses multiple exact matches. - search (string): Optional parameter to filter connections(APs) on AP name, serial, MAC address, network name, or interface IP address. This filter uses partial string matching (ILIKE). - models (array): Optional parameter to filter connections(APs) by device model names. This filter uses multiple exact matches. - dataEncryptionStatuses (array): Optional parameter to filter connections(APs) by data encryption status. This filter uses multiple exact matches. @@ -795,6 +796,7 @@ def getOrganizationCampusGatewayConnections(self, organizationId: str, total_pag "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "search", "models", "dataEncryptionStatuses", @@ -812,6 +814,7 @@ def getOrganizationCampusGatewayConnections(self, organizationId: str, total_pag "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "models", "dataEncryptionStatuses", ] @@ -841,6 +844,7 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * - campusGatewaySerials (array): Optional parameter to filter connections(APs) by Campus Gateway serials. This filter uses multiple exact matches. - campusGatewayClusterIds (array): Optional parameter to filter connections(APs) by Campus Gateway cluster IDs. This filter uses multiple exact matches. - campusGatewayTunnelStatuses (array): Optional parameter to filter connections(APs) by tunnel statuses. This filter uses multiple exact matches. + - campusGatewayPriorities (array): Optional parameter to filter connections(APs) by Campus Gateway tunnel priority. Use 0 for primary or 1 for backup. This filter uses multiple exact matches. - search (string): Optional setting that lets you filter access points (APs) by name, serial number, MAC address, network name, or interface IP address. The filter matches partial text, not just exact values (uses ILIKE matching). - models (array): Optional parameter to filter connections(APs) by device model names. This filter uses multiple exact matches. - dataEncryptionStatuses (array): Optional parameter to filter connections(APs) by data encryption status. This filter uses multiple exact matches. @@ -861,6 +865,7 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "search", "models", "dataEncryptionStatuses", @@ -873,6 +878,7 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "models", "dataEncryptionStatuses", ] @@ -891,6 +897,58 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * return self._session.get(metadata, resource, params) + def getOrganizationCampusGatewayDevicesSystemCpuLoad(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **Return the latest CPU load averages reported by Campus Gateway devices.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-devices-system-cpu-load + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - networkIds (array): Optional exact-match network filters. Accepts both node group (N_) and locale (L_) network IDs. + - serials (array): Optional exact-match Campus Gateway serial filters. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["campusGateway", "monitor", "devices", "system", "cpu", "load"], + "operation": "getOrganizationCampusGatewayDevicesSystemCpuLoad", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/campusGateway/devices/system/cpu/load" + + query_params = [ + "networkIds", + "serials", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "serials", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationCampusGatewayDevicesSystemCpuLoad: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationCampusGatewayDevicesUplinksLocalOverridesByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): @@ -1060,7 +1118,7 @@ def createOrganizationCampusGatewayMdnsServicesCustom(self, organizationId: str, - organizationId (string): Organization ID - name (string): Display name of the custom mDNS service. - - types (array): One to ten DNS-SD service types. Accepted shorthand is normalized by the API. + - types (array): DNS-SD service types. Accepted shorthand is normalized by the API. """ kwargs = locals() @@ -1096,7 +1154,7 @@ def updateOrganizationCampusGatewayMdnsServicesCustom(self, organizationId: str, - organizationId (string): Organization ID - key (string): Key - name (string): Updated display name of the custom mDNS service. - - types (array): Replacement ordered list of one to ten DNS-SD service types. + - types (array): Replacement ordered list of DNS-SD service types. """ kwargs.update(locals()) diff --git a/meraki/aio/api/organizations.py b/meraki/aio/api/organizations.py index 693fd9a..d7d6f59 100644 --- a/meraki/aio/api/organizations.py +++ b/meraki/aio/api/organizations.py @@ -10940,11 +10940,10 @@ def getSite(self, organizationId: str, siteId: str): def getSummary(self, organizationId: str): """ - **Returns the aggregate values required to populate organization summary - cards** - https://developer.cisco.com/meraki/api-v1/#!get-summary + **Returns organization connection, VPC, Site, and region counts derived from Zero Trust Routing and tunnel health.** + https://developer.cisco.com/meraki/api-v1/#!get-summary - - organizationId (string): Organization ID + - organizationId (string): Organization ID """ metadata = { @@ -14754,6 +14753,226 @@ def createOrganizationSplashThemeAsset(self, organizationId: str, themeIdentifie return self._session.post(metadata, resource, payload) + def getOrganizationSummarySustainabilityDailyConsumerMetricsNetworks(self, organizationId: str, **kwargs): + """ + **Lists daily consumer metrics for networks.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-daily-consumer-metrics-networks + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "dailyConsumerMetrics", "networks"], + "operation": "getOrganizationSummarySustainabilityDailyConsumerMetricsNetworks", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/dailyConsumerMetrics/networks" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilityDailyConsumerMetricsNetworks: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategories(self, organizationId: str): + """ + **Lists available device categories for sustainability metrics with their corresponding device types.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-device-categories + + - organizationId (string): Organization ID + """ + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "summaryConsumerMetrics", "deviceCategories"], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategories", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/deviceCategories" + + return self._session.get(metadata, resource) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategoriesAggregated( + self, organizationId: str, **kwargs + ): + """ + **Lists summary consumer metrics aggregated by device category.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-device-categories-aggregated + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": [ + "organizations", + "configure", + "summary", + "sustainability", + "summaryConsumerMetrics", + "deviceCategories", + "aggregated", + ], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategoriesAggregated", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/deviceCategories/aggregated" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategoriesAggregated: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsDevices(self, organizationId: str, **kwargs): + """ + **Lists summary consumer metrics for devices.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-devices + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "summaryConsumerMetrics", "devices"], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsDevices", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/devices" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsDevices: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworks(self, organizationId: str, **kwargs): + """ + **Lists summary consumer metrics for networks.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-networks + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "summaryConsumerMetrics", "networks"], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworks", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/networks" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworks: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworksAggregated(self, organizationId: str, **kwargs): + """ + **Returns aggregated consumer metrics for all networks in the organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-networks-aggregated + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": [ + "organizations", + "configure", + "summary", + "sustainability", + "summaryConsumerMetrics", + "networks", + "aggregated", + ], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworksAggregated", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/networks/aggregated" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworksAggregated: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, **kwargs): """ **Return the top 10 appliances sorted by utilization over given time range.** diff --git a/meraki/aio/api/switch.py b/meraki/aio/api/switch.py index 1888e9f..88bd792 100644 --- a/meraki/aio/api/switch.py +++ b/meraki/aio/api/switch.py @@ -200,7 +200,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - serial (string): Serial - portId (string): Port ID - - name (string): The name of the switch port. For IOS XE Catalyst switches, this value is the interface description. + - name (string): The name of the switch port. Dashboard displays this value as the port description. For Cisco Catalyst switches running IOS XE, it corresponds to the configured interface description. - tags (array): The list of tags of the switch port. - enabled (boolean): The status of the switch port. - poeEnabled (boolean): The PoE status of the switch port. @@ -3609,7 +3609,7 @@ def updateOrganizationConfigTemplateSwitchProfilePort( - configTemplateId (string): Config template ID - profileId (string): Profile ID - portId (string): Port ID - - name (string): The name of the switch template port. For IOS XE Catalyst switches, this value is the interface description. + - name (string): The name of the switch template port. Dashboard displays this value as the port description. For Cisco Catalyst switches running IOS XE, it corresponds to the configured interface description. - tags (array): The list of tags of the switch template port. - enabled (boolean): The status of the switch template port. - poeEnabled (boolean): The PoE status of the switch template port. @@ -4170,6 +4170,219 @@ def cloneOrganizationSwitchDevices(self, organizationId: str, sourceSerial: str, return self._session.post(metadata, resource, payload) + def createOrganizationSwitchDevicesSoftwareUpdateBatch( + self, organizationId: str, serials: list, toVersion: dict, **kwargs + ): + """ + **Create a device-scoped software update batch for up to 50 selected Cloud Monitoring for Catalyst switches** + https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-devices-software-update-batch + + - organizationId (string): Organization ID + - serials (array): Switch serials receiving the same update. Values are trimmed and uppercased; duplicates after normalization are rejected. At least one and at most 50 are accepted. + - toVersion (object): Destination software version compatible with every selected device. The id field is required. + - scheduledAt (string): UTC instant at which update execution should begin. Omit to schedule as soon as allowed. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["switch", "configure", "devices", "software", "updates", "batches"], + "operation": "createOrganizationSwitchDevicesSoftwareUpdateBatch", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/switch/devices/software/updates/batches" + + body_params = [ + "serials", + "toVersion", + "scheduledAt", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"createOrganizationSwitchDevicesSoftwareUpdateBatch: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def cancelOrganizationSwitchDevicesSoftwareUpdateBatches(self, organizationId: str, **kwargs): + """ + **Cancel pending device-scoped software updates within one or more batches before execution begins** + https://developer.cisco.com/meraki/api-v1/#!cancel-organization-switch-devices-software-update-batches + + - organizationId (string): Organization ID + - batch (object): Optional device-scoped software update batch selector. Required when serials is omitted; when provided, the id field is required. + - serials (array): Optional switch serials to cancel. Values are trimmed and uppercased; duplicates after normalization are rejected. Required when batch is omitted; when provided, at least one and at most 50 serials are accepted. The selection may span at most 20 device-scoped software update batches. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["switch", "configure", "devices", "software", "updates", "batches"], + "operation": "cancelOrganizationSwitchDevicesSoftwareUpdateBatches", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/switch/devices/software/updates/batches/cancel" + + body_params = [ + "batch", + "serials", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"cancelOrganizationSwitchDevicesSoftwareUpdateBatches: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def getOrganizationSwitchDevicesSoftwareUpdateStatusesByDevice( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List software update statuses for Cloud Monitoring for Catalyst switches in one paginated device table** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-devices-software-update-statuses-by-device + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 30. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'ascending'. + - networkIds (array): Exact network.id filters using inclusive OR. Omit for no network restriction; maximum 100. + - serials (array): Exact, case-sensitive device.serial filters using inclusive OR. Omit for no serial restriction; maximum 100. + - search (string): Case-insensitive partial substring match against device.name or device.serial. Serial punctuation is matched as supplied, and whitespace-separated text is treated as one substring rather than tokenized. If this scalar is repeated, only the last value is used. + - isUpdateAvailable (boolean): Exact filter for items[].isUpdateAvailable. Omit for no availability restriction; no default is applied. + - updateStatuses (array): Exact items[].update.status.value filters using inclusive OR, normalized case-insensitively to the canonical enum value. Omit for no detailed-status restriction. Detailed status values match the existing firmware-upgrade by-device API. Idle means no active or retained update. Execution progress and terminal outcomes use their existing canonical values and labels. Terminal success or failure is also reported in status.result. No default is implied. + - updateStages (array): Exact items[].update.status.stage.value filters using inclusive OR, normalized case-insensitively to the canonical enum value. Omit for no execution-stage restriction. Execution-stage values: check-in, download, installation, or verification. The value is null before execution begins and after no stage can be identified. No default is implied. + - updateResults (array): Exact items[].update.status.result.value filters using inclusive OR, normalized case-insensitively to the canonical enum value. Omit for no terminal-result restriction. Terminal-result values: succeeded, skipped, canceled, or failed. The value is null until the update completes. No default is implied. + - currentVersionShortNames (array): Exact, case-sensitive currentVersion.shortName filters using inclusive OR. Omit for no current-version name restriction; maximum 100. + - models (array): Exact, case-sensitive device.model filters using inclusive OR. Omit for no model restriction; maximum 100. + - sortKey (string): Sort key: currentVersion orders currentVersion.shortName; device orders device.name with serial fallback; isUpdateAvailable orders false before true when ascending; model orders device.model; network orders network.name; updateStatus uses this semantic order when ascending: idle, upgrade-scheduled, upgrade-retry-scheduled, checking-in, download-started, download-complete, install-started, verification-started, upgrade-complete, upgrade-skipped, upgrade-canceled, upgrade-failed. Terminal items are then ordered by result: succeeded, skipped, canceled, then failed. Ties are resolved by device.serial. Defaults to device. + """ + + 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 "sortKey" in kwargs: + options = ["currentVersion", "device", "isUpdateAvailable", "model", "network", "updateStatus"] + assert kwargs["sortKey"] in options, ( + f'''"sortKey" cannot be "{kwargs["sortKey"]}", & must be set to one of: {options}''' + ) + + metadata = { + "tags": ["switch", "monitor", "devices", "software", "updates", "statuses", "byDevice"], + "operation": "getOrganizationSwitchDevicesSoftwareUpdateStatusesByDevice", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/switch/devices/software/updates/statuses/byDevice" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "sortOrder", + "networkIds", + "serials", + "search", + "isUpdateAvailable", + "updateStatuses", + "updateStages", + "updateResults", + "currentVersionShortNames", + "models", + "sortKey", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "serials", + "updateStatuses", + "updateStages", + "updateResults", + "currentVersionShortNames", + "models", + ] + 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"getOrganizationSwitchDevicesSoftwareUpdateStatusesByDevice: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationSwitchDevicesSoftwareVersionsTargetsByDevice( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **Returns a paginated list of accessible Cloud Monitoring for Catalyst switches and the complete list of destination software versions for each switch** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-devices-software-versions-targets-by-device + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - serials (array): Optional switch serials used to filter the result set. Values are trimmed and uppercased. Supports up to 50 serials when provided. Matching switches that are not accessible to the caller or are not eligible for this operation are omitted. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 50. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["switch", "monitor", "devices", "software", "versions", "targets", "byDevice"], + "operation": "getOrganizationSwitchDevicesSoftwareVersionsTargetsByDevice", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/switch/devices/software/versions/targets/byDevice" + + query_params = [ + "serials", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "serials", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSwitchDevicesSoftwareVersionsTargetsByDevice: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationSwitchDevicesSystemQueuesHistoryBySwitchByInterval( self, organizationId: str, total_pages=1, direction="next", **kwargs ): @@ -6590,16 +6803,7 @@ def getOrganizationSwitchRoutingBgpPeersGroupsAddressFamiliesDeployments( return self._session.get_pages(metadata, resource, params, total_pages, direction) def createOrganizationSwitchRoutingBgpPeersGroupsDeploy( - self, - organizationId: str, - addressFamily: dict, - network: dict, - peerGroup: dict, - peerGroupAddressFamilyBindingProfile: dict, - peerGroupProfile: dict, - policies: list, - router: dict, - **kwargs, + self, organizationId: str, addressFamily: dict, network: dict, policies: list, router: dict, **kwargs ): """ **Create or update a peer group, in addition to an associated peer group profile, peer group address family binding, peer group address family binding profile and routing policies associated with the peer group** @@ -6608,12 +6812,23 @@ def createOrganizationSwitchRoutingBgpPeersGroupsDeploy( - organizationId (string): Organization ID - addressFamily (object): Information regarding the address family the peer group address family binding belongs to - network (object): Information regarding the network the peer group profile belongs to - - peerGroup (object): Information regarding the peer group - - peerGroupAddressFamilyBindingProfile (object): Information regarding the peer group address family binding profile - - peerGroupProfile (object): Information regarding the peer group profile - policies (array): Information regarding the routing policies - router (object): Information regarding the router this peer group belongs to - - peerGroupAddressFamilyBinding (object): Information regarding the peer group address family binding. Only required when updating. + - peerGroupId (string): Object ID for the peer group. Only required when updating. + - name (string): Name of the peer group (CLI: 'neighbor peer-group') + - description (string): Text description of the peer group (CLI: 'neighbor description ') + - ebgp (object): Options related to eBGP configuration + - password (string): BGP password used to authenticate BGP peers and prevent unauthorized access (CLI: 'neighbor password ') + - timers (object): Options related to timers used to maintain connectivity between BGP peers + - autonomousSystem (object): Information regarding the autonomous system for the BGP neighbors in the peer group + - interfaces (object): Options related to BGP interfaces + - advertisement (object): Options related to route advertisement + - communityAttribute (object): Information regarding the community attribute for peer groups for a given address family + - nextHop (object): Information regarding next hop for peer groups for a given address family + - removePrivateAs (object): Information regarding removal of private AS number from outbound updates + - routeReflector (object): Information regarding route reflectors + - softReconfiguration (object): Options related to soft reconfiguration + - weight (integer): Set default weight for routes from this peer group (CLI: 'neighbor IBGP weight ') """ kwargs.update(locals()) @@ -6626,14 +6841,25 @@ def createOrganizationSwitchRoutingBgpPeersGroupsDeploy( resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/groups/deploy" body_params = [ + "peerGroupId", "addressFamily", "network", - "peerGroup", - "peerGroupAddressFamilyBinding", - "peerGroupAddressFamilyBindingProfile", - "peerGroupProfile", "policies", "router", + "name", + "description", + "ebgp", + "password", + "timers", + "autonomousSystem", + "interfaces", + "advertisement", + "communityAttribute", + "nextHop", + "removePrivateAs", + "routeReflector", + "softReconfiguration", + "weight", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -6895,15 +7121,7 @@ def getOrganizationSwitchRoutingBgpPeersNeighbors(self, organizationId: str, tot return self._session.get_pages(metadata, resource, params, total_pages, direction) def createOrganizationSwitchRoutingBgpPeersNeighborsDeploy( - self, - organizationId: str, - addressFamily: dict, - neighbor: dict, - neighborAddressFamilyBinding: dict, - peerGroup: dict, - policies: list, - router: dict, - **kwargs, + self, organizationId: str, addressFamily: dict, peerGroup: dict, policies: list, router: dict, **kwargs ): """ **Create or update a neighor, in addition to an associated neighbor address family binding and routing policies associated with the neighbor** @@ -6911,14 +7129,22 @@ def createOrganizationSwitchRoutingBgpPeersNeighborsDeploy( - organizationId (string): Organization ID - addressFamily (object): Information regarding the address family this binding is bound to - - neighbor (object): Information regarding the BPG neighbor - - neighborAddressFamilyBinding (object): Information regarding the neighbor address family binding - peerGroup (object): Information regarding the peer group this neighbor belongs to - policies (array): Information regarding the routing policies related to the neighbor - router (object): Information regarding the router this neighbor peers with + - neighborId (string): The neighbor object ID. Only required for updating a neighbor + - description (string): Text description of the neighbor (CLI: 'neighbor 10.0.42.1 description ') + - address (string): The IP address of the neighbor (CLI: 'neighbor
') + - ebgp (object): Options related to eBGP configuration + - password (string): BGP password used to authenticate BGP peers and prevent unauthorized access (CLI: 'neighbor 10.0.42.1 password ') + - interfaces (object): Options related to BGP interfaces + - peering (object): Options related to enabling peering for this address family and neighbor + - weight (integer): Set default weight for routes from this neighbor (CLI: 'neighbor 10.0.42.1 weight ') + - advertisement (object): Options related to route advertisement + - softReconfiguration (object): Options related to soft reconfiguration """ - kwargs = locals() + kwargs.update(locals()) metadata = { "tags": ["switch", "configure", "routing", "bgp", "peers", "neighbors", "deploy"], @@ -6928,12 +7154,20 @@ def createOrganizationSwitchRoutingBgpPeersNeighborsDeploy( resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/neighbors/deploy" body_params = [ + "neighborId", "addressFamily", - "neighbor", - "neighborAddressFamilyBinding", "peerGroup", "policies", "router", + "description", + "address", + "ebgp", + "password", + "interfaces", + "peering", + "weight", + "advertisement", + "softReconfiguration", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -7087,7 +7321,6 @@ def createOrganizationSwitchRoutingBgpRoutersDeploy( organizationId: str, addressFamily: dict, addressFamilyPrefixes: list, - addressFamilyProfile: dict, autonomousSystem: dict, router: dict, switch: dict, @@ -7100,7 +7333,6 @@ def createOrganizationSwitchRoutingBgpRoutersDeploy( - organizationId (string): Organization ID - addressFamily (object): Information regarding the address family - addressFamilyPrefixes (array): The list of network prefixes to which the address family applies - - addressFamilyProfile (object): Information regarding the profile applied to the address family - autonomousSystem (object): Information regarding the router's autonomous system - router (object): Information regarding the BPG router - switch (object): The router's switch node. When the router is part of a switch stack, this is the switch stack's active node @@ -7118,7 +7350,6 @@ def createOrganizationSwitchRoutingBgpRoutersDeploy( body_params = [ "addressFamily", "addressFamilyPrefixes", - "addressFamilyProfile", "autonomousSystem", "router", "switch", diff --git a/meraki/aio/api/wireless.py b/meraki/aio/api/wireless.py index fd3ce1a..f868f66 100644 --- a/meraki/aio/api/wireless.py +++ b/meraki/aio/api/wireless.py @@ -169,7 +169,7 @@ def updateDeviceWirelessElectronicShelfLabel(self, serial: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-electronic-shelf-label - serial (string): Serial - - channel (string): Desired ESL channel for the device, or 'Auto' (case insensitive) to use the recommended channel + - channel (string): Desired ESL channel for the device. Only configurable for devices assigned the High frequency ESL or sepioo IIoT role. Use 'Auto' (case insensitive) to use the recommended channel - enabled (boolean): Turn ESL features on and off for this device """ @@ -2181,6 +2181,132 @@ def getNetworkWirelessLatencyStats(self, networkId: str, **kwargs): return self._session.get(metadata, resource, params) + def updateNetworkWirelessLocationAssetTrackingFloorPlan(self, networkId: str, floorPlanId: str, enabled: bool, **kwargs): + """ + **Update asset tracking settings for a specific floor plan.** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-location-asset-tracking-floor-plan + + - networkId (string): Network ID + - floorPlanId (string): Floor plan ID + - enabled (boolean): Enable or disable asset tracking for this floor plan + - webhook (object): Webhook configuration for asset tracking events + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "configure", "location", "assetTracking", "floorPlans"], + "operation": "updateNetworkWirelessLocationAssetTrackingFloorPlan", + } + networkId = urllib.parse.quote(str(networkId), safe="") + floorPlanId = urllib.parse.quote(str(floorPlanId), safe="") + resource = f"/networks/{networkId}/wireless/location/assetTracking/floorPlans/{floorPlanId}" + + body_params = [ + "enabled", + "webhook", + ] + 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"updateNetworkWirelessLocationAssetTrackingFloorPlan: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def deleteNetworkWirelessLocationAssetTrackingFloorPlanGroups(self, networkId: str, floorPlanId: str): + """ + **Delete all the asset tracking groups for a floor plan in a network** + https://developer.cisco.com/meraki/api-v1/#!delete-network-wireless-location-asset-tracking-floor-plan-groups + + - networkId (string): Network ID + - floorPlanId (string): Floor plan ID + """ + + metadata = { + "tags": ["wireless", "configure", "location", "assetTracking", "floorPlans", "groups"], + "operation": "deleteNetworkWirelessLocationAssetTrackingFloorPlanGroups", + } + networkId = urllib.parse.quote(str(networkId), safe="") + floorPlanId = urllib.parse.quote(str(floorPlanId), safe="") + resource = f"/networks/{networkId}/wireless/location/assetTracking/floorPlans/{floorPlanId}/groups" + + return self._session.delete(metadata, resource) + + def createNetworkWirelessLocationAssetTrackingFloorPlanGroupsBatchCreate( + self, networkId: str, floorPlanId: str, groups: list, **kwargs + ): + """ + **Create asset tracking groups for a floor plan in a network** + https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-location-asset-tracking-floor-plan-groups-batch-create + + - networkId (string): Network ID + - floorPlanId (string): Floor plan ID + - groups (array): List of groups to create. Up to 1000 groups can be provided in a request. + """ + + kwargs = locals() + + metadata = { + "tags": ["wireless", "configure", "location", "assetTracking", "floorPlans", "groups", "batchCreate"], + "operation": "createNetworkWirelessLocationAssetTrackingFloorPlanGroupsBatchCreate", + } + networkId = urllib.parse.quote(str(networkId), safe="") + floorPlanId = urllib.parse.quote(str(floorPlanId), safe="") + resource = f"/networks/{networkId}/wireless/location/assetTracking/floorPlans/{floorPlanId}/groups/batchCreate" + + body_params = [ + "groups", + ] + 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"createNetworkWirelessLocationAssetTrackingFloorPlanGroupsBatchCreate: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def createNetworkWirelessLocationRangingJobsBatch(self, networkId: str, jobs: list, **kwargs): + """ + **Schedule ranging jobs for one or more floor plans in a network** + https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-location-ranging-jobs-batch + + - networkId (string): Network ID + - jobs (array): List of ranging jobs to create. Up to 100 jobs can be provided in a request. + """ + + kwargs = locals() + + metadata = { + "tags": ["wireless", "configure", "location", "ranging", "jobs", "batch"], + "operation": "createNetworkWirelessLocationRangingJobsBatch", + } + networkId = urllib.parse.quote(str(networkId), safe="") + resource = f"/networks/{networkId}/wireless/location/ranging/jobs/batch" + + body_params = [ + "jobs", + ] + 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"createNetworkWirelessLocationRangingJobsBatch: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + def updateNetworkWirelessLocationScanning(self, networkId: str, **kwargs): """ **Change scanning API settings** @@ -4823,7 +4949,7 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwo kwargs.update(locals()) if "insights" in kwargs: - options = ["dashboard", "rca"] + options = ["dashboard", "rca", "rca_v2"] assert kwargs["insights"] in options, ( f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' ) @@ -5518,7 +5644,7 @@ def getOrganizationAssuranceWirelessExperienceCoverageInsightsByNetwork( kwargs.update(locals()) if "insights" in kwargs: - options = ["dashboard", "rca"] + options = ["dashboard", "rca", "rca_v2"] assert kwargs["insights"] in options, ( f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' ) @@ -6383,7 +6509,7 @@ def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsInsightsByNetwor kwargs.update(locals()) if "insights" in kwargs: - options = ["dashboard", "rca"] + options = ["dashboard", "rca", "rca_v2"] assert kwargs["insights"] in options, ( f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' ) @@ -7062,7 +7188,7 @@ def getOrganizationAssuranceWirelessExperienceTimeToConnectInsightsByNetwork( kwargs.update(locals()) if "insights" in kwargs: - options = ["dashboard", "rca"] + options = ["dashboard", "rca", "rca_v2"] assert kwargs["insights"] in options, ( f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' ) @@ -9751,6 +9877,223 @@ def getOrganizationWirelessIotRolesByNetwork(self, organizationId: str, total_pa return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationWirelessLocationAssetTrackingFloorPlans( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **Retrieve a list of asset tracking settings per floor plan.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-asset-tracking-floor-plans + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - floorPlanIds (array): Optional parameter to filter settings by one or more floor plan IDs + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "configure", "location", "assetTracking", "floorPlans"], + "operation": "getOrganizationWirelessLocationAssetTrackingFloorPlans", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/location/assetTracking/floorPlans" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "floorPlanIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "floorPlanIds", + ] + 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"getOrganizationWirelessLocationAssetTrackingFloorPlans: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationWirelessLocationAssetTrackingGroups( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **Retrieve a list of asset tracking groups used in asset tracking.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-asset-tracking-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 - 1000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Optional parameter to filter asset tracking groups by one or more network IDs + - floorPlanIds (array): Optional parameter to filter asset tracking groups by one or more floor plan IDs + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "configure", "location", "assetTracking", "groups"], + "operation": "getOrganizationWirelessLocationAssetTrackingGroups", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/location/assetTracking/groups" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "networkIds", + "floorPlanIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "floorPlanIds", + ] + 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"getOrganizationWirelessLocationAssetTrackingGroups: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationWirelessLocationRangingJobs(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **Retrieve a list of ranging jobs that measure the distances between APs by performing ranging operations.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-ranging-jobs + + - 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 - 10000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Optional parameter to filter ranging jobs by one or more network IDs + - jobIds (array): Optional parameter to filter ranging jobs by one or more job IDs + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "configure", "location", "ranging", "jobs"], + "operation": "getOrganizationWirelessLocationRangingJobs", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/location/ranging/jobs" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "networkIds", + "jobIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "jobIds", + ] + 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"getOrganizationWirelessLocationRangingJobs: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationWirelessLocationRangingMeasurements( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List the ranging measurements** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-ranging-measurements + + - 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 - 10000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Optional parameter to filter ranging measurements by one or more network IDs + - floorPlanIds (array): Optional parameter to filter ranging measurements by one or more floor plan IDs + - type (string): Optional parameter to filter the type of ranging measurements returned. By default, only 'uwb' measurements are returned. + """ + + kwargs.update(locals()) + + if "type" in kwargs: + options = ["all", "ftm", "uwb"] + assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["wireless", "configure", "location", "ranging", "measurements"], + "operation": "getOrganizationWirelessLocationRangingMeasurements", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/location/ranging/measurements" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "networkIds", + "floorPlanIds", + "type", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "floorPlanIds", + ] + 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"getOrganizationWirelessLocationRangingMeasurements: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationWirelessLocationScanningByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Return scanning API settings** diff --git a/meraki/api/batch/appliance.py b/meraki/api/batch/appliance.py index efe4dda..86aaf31 100644 --- a/meraki/api/batch/appliance.py +++ b/meraki/api/batch/appliance.py @@ -1027,31 +1027,6 @@ def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kw } return action - def connectNetworkApplianceUmbrellaAccount(self, networkId: str, api: dict, **kwargs): - """ - **Connect a Cisco Umbrella account to this network** - https://developer.cisco.com/meraki/api-v1/#!connect-network-appliance-umbrella-account - - - networkId (string): Network ID - - api (object): Umbrella API credentials - """ - - kwargs = locals() - - networkId = urllib.parse.quote(networkId, safe="") - resource = f"/networks/{networkId}/appliance/umbrella/account/connect" - - body_params = [ - "api", - ] - payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} - action = { - "resource": resource, - "operation": "action", - "body": payload, - } - return action - def disconnectNetworkApplianceUmbrellaAccount(self, networkId: str): """ **Disconnect Umbrella account from this network** @@ -1223,7 +1198,7 @@ def protectionNetworkApplianceUmbrella(self, networkId: str, enabled: bool, **kw payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, - "operation": "action", + "operation": "update", "body": payload, } return action diff --git a/meraki/api/batch/campusGateway.py b/meraki/api/batch/campusGateway.py index 206d702..54ccee7 100644 --- a/meraki/api/batch/campusGateway.py +++ b/meraki/api/batch/campusGateway.py @@ -217,7 +217,7 @@ def createOrganizationCampusGatewayMdnsServicesCustom(self, organizationId: str, - organizationId (string): Organization ID - name (string): Display name of the custom mDNS service. - - types (array): One to ten DNS-SD service types. Accepted shorthand is normalized by the API. + - types (array): DNS-SD service types. Accepted shorthand is normalized by the API. """ kwargs = locals() @@ -245,7 +245,7 @@ def updateOrganizationCampusGatewayMdnsServicesCustom(self, organizationId: str, - organizationId (string): Organization ID - key (string): Key - name (string): Updated display name of the custom mDNS service. - - types (array): Replacement ordered list of one to ten DNS-SD service types. + - types (array): Replacement ordered list of DNS-SD service types. """ kwargs.update(locals()) diff --git a/meraki/api/batch/switch.py b/meraki/api/batch/switch.py index 2401762..12ab689 100644 --- a/meraki/api/batch/switch.py +++ b/meraki/api/batch/switch.py @@ -71,7 +71,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - serial (string): Serial - portId (string): Port ID - - name (string): The name of the switch port. For IOS XE Catalyst switches, this value is the interface description. + - name (string): The name of the switch port. Dashboard displays this value as the port description. For Cisco Catalyst switches running IOS XE, it corresponds to the configured interface description. - tags (array): The list of tags of the switch port. - enabled (boolean): The status of the switch port. - poeEnabled (boolean): The PoE status of the switch port. @@ -2070,7 +2070,7 @@ def updateOrganizationConfigTemplateSwitchProfilePort( - configTemplateId (string): Config template ID - profileId (string): Profile ID - portId (string): Port ID - - name (string): The name of the switch template port. For IOS XE Catalyst switches, this value is the interface description. + - name (string): The name of the switch template port. Dashboard displays this value as the port description. For Cisco Catalyst switches running IOS XE, it corresponds to the configured interface description. - tags (array): The list of tags of the switch template port. - enabled (boolean): The status of the switch template port. - poeEnabled (boolean): The PoE status of the switch template port. @@ -2226,6 +2226,37 @@ def cloneOrganizationSwitchDevices(self, organizationId: str, sourceSerial: str, } return action + def createOrganizationSwitchDevicesSoftwareUpdateBatch( + self, organizationId: str, serials: list, toVersion: dict, **kwargs + ): + """ + **Create a device-scoped software update batch for up to 50 selected Cloud Monitoring for Catalyst switches. A batch groups one or more selected switches that receive the same destination software version at the same execution time; a one-switch batch is valid. Cloud Monitoring for Catalyst means Dashboard monitors each switch while its configuration remains device-managed. Eligible switches use a supported model and Dashboard connection, remain device-configured (including in a template-bound child network), are not assigned a template switch profile, and have no overlapping pending or in-progress update. The destination version must be compatible with every selected switch and must appear as items[].targets[].id for each serial in the software versions search response. One request applies the same toVersion.id to every serial; send separate requests for serial groups selecting different target IDs. The complete selection is validated atomically: if any switch or the destination is ineligible, no update batch is created. Poll the byDevice operation with the returned serials and match items[].update.batchId to the returned batch.id. The batch ID identifies the persistent software update batch, not a transient asynchronous job. Retrying a successful request is not idempotent and can create another batch.** + https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-devices-software-update-batch + + - organizationId (string): Organization ID + - serials (array): Switch serials receiving the same update. Values are trimmed and uppercased; duplicates after normalization are rejected. At least one and at most 50 are accepted. + - toVersion (object): Destination software version compatible with every selected device. The id field is required. + - scheduledAt (string): UTC instant at which update execution should begin. Omit to schedule as soon as allowed. + """ + + kwargs.update(locals()) + + organizationId = urllib.parse.quote(organizationId, safe="") + resource = f"/organizations/{organizationId}/switch/devices/software/updates/batches" + + body_params = [ + "serials", + "toVersion", + "scheduledAt", + ] + 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 createOrganizationSwitchPortsProfile(self, organizationId: str, **kwargs): """ **Create a port profile in an organization** @@ -2796,16 +2827,7 @@ def deleteOrganizationSwitchRoutingBgpFiltersPrefixList(self, organizationId: st return action def createOrganizationSwitchRoutingBgpPeersGroupsDeploy( - self, - organizationId: str, - addressFamily: dict, - network: dict, - peerGroup: dict, - peerGroupAddressFamilyBindingProfile: dict, - peerGroupProfile: dict, - policies: list, - router: dict, - **kwargs, + self, organizationId: str, addressFamily: dict, network: dict, policies: list, router: dict, **kwargs ): """ **Create or update a peer group, in addition to an associated peer group profile, peer group address family binding, peer group address family binding profile and routing policies associated with the peer group. Border Gateway Protocol requires IOS XE 17.18 or higher** @@ -2814,12 +2836,23 @@ def createOrganizationSwitchRoutingBgpPeersGroupsDeploy( - organizationId (string): Organization ID - addressFamily (object): Information regarding the address family the peer group address family binding belongs to - network (object): Information regarding the network the peer group profile belongs to - - peerGroup (object): Information regarding the peer group - - peerGroupAddressFamilyBindingProfile (object): Information regarding the peer group address family binding profile - - peerGroupProfile (object): Information regarding the peer group profile - policies (array): Information regarding the routing policies - router (object): Information regarding the router this peer group belongs to - - peerGroupAddressFamilyBinding (object): Information regarding the peer group address family binding. Only required when updating. + - peerGroupId (string): Object ID for the peer group. Only required when updating. + - name (string): Name of the peer group (CLI: 'neighbor peer-group') + - description (string): Text description of the peer group (CLI: 'neighbor description ') + - ebgp (object): Options related to eBGP configuration + - password (string): BGP password used to authenticate BGP peers and prevent unauthorized access (CLI: 'neighbor password ') + - timers (object): Options related to timers used to maintain connectivity between BGP peers + - autonomousSystem (object): Information regarding the autonomous system for the BGP neighbors in the peer group + - interfaces (object): Options related to BGP interfaces + - advertisement (object): Options related to route advertisement + - communityAttribute (object): Information regarding the community attribute for peer groups for a given address family + - nextHop (object): Information regarding next hop for peer groups for a given address family + - removePrivateAs (object): Information regarding removal of private AS number from outbound updates + - routeReflector (object): Information regarding route reflectors + - softReconfiguration (object): Options related to soft reconfiguration + - weight (integer): Set default weight for routes from this peer group (CLI: 'neighbor IBGP weight ') """ kwargs.update(locals()) @@ -2828,14 +2861,25 @@ def createOrganizationSwitchRoutingBgpPeersGroupsDeploy( resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/groups/deploy" body_params = [ + "peerGroupId", "addressFamily", "network", - "peerGroup", - "peerGroupAddressFamilyBinding", - "peerGroupAddressFamilyBindingProfile", - "peerGroupProfile", "policies", "router", + "name", + "description", + "ebgp", + "password", + "timers", + "autonomousSystem", + "interfaces", + "advertisement", + "communityAttribute", + "nextHop", + "removePrivateAs", + "routeReflector", + "softReconfiguration", + "weight", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -2846,15 +2890,7 @@ def createOrganizationSwitchRoutingBgpPeersGroupsDeploy( return action def createOrganizationSwitchRoutingBgpPeersNeighborsDeploy( - self, - organizationId: str, - addressFamily: dict, - neighbor: dict, - neighborAddressFamilyBinding: dict, - peerGroup: dict, - policies: list, - router: dict, - **kwargs, + self, organizationId: str, addressFamily: dict, peerGroup: dict, policies: list, router: dict, **kwargs ): """ **Create or update a neighor, in addition to an associated neighbor address family binding and routing policies associated with the neighbor. Border Gateway Protocol requires IOS XE 17.18 or higher** @@ -2862,25 +2898,41 @@ def createOrganizationSwitchRoutingBgpPeersNeighborsDeploy( - organizationId (string): Organization ID - addressFamily (object): Information regarding the address family this binding is bound to - - neighbor (object): Information regarding the BPG neighbor - - neighborAddressFamilyBinding (object): Information regarding the neighbor address family binding - peerGroup (object): Information regarding the peer group this neighbor belongs to - policies (array): Information regarding the routing policies related to the neighbor - router (object): Information regarding the router this neighbor peers with + - neighborId (string): The neighbor object ID. Only required for updating a neighbor + - description (string): Text description of the neighbor (CLI: 'neighbor 10.0.42.1 description ') + - address (string): The IP address of the neighbor (CLI: 'neighbor
') + - ebgp (object): Options related to eBGP configuration + - password (string): BGP password used to authenticate BGP peers and prevent unauthorized access (CLI: 'neighbor 10.0.42.1 password ') + - interfaces (object): Options related to BGP interfaces + - peering (object): Options related to enabling peering for this address family and neighbor + - weight (integer): Set default weight for routes from this neighbor (CLI: 'neighbor 10.0.42.1 weight ') + - advertisement (object): Options related to route advertisement + - softReconfiguration (object): Options related to soft reconfiguration """ - kwargs = locals() + kwargs.update(locals()) organizationId = urllib.parse.quote(organizationId, safe="") resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/neighbors/deploy" body_params = [ + "neighborId", "addressFamily", - "neighbor", - "neighborAddressFamilyBinding", "peerGroup", "policies", "router", + "description", + "address", + "ebgp", + "password", + "interfaces", + "peering", + "weight", + "advertisement", + "softReconfiguration", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { @@ -2895,7 +2947,6 @@ def createOrganizationSwitchRoutingBgpRoutersDeploy( organizationId: str, addressFamily: dict, addressFamilyPrefixes: list, - addressFamilyProfile: dict, autonomousSystem: dict, router: dict, switch: dict, @@ -2908,7 +2959,6 @@ def createOrganizationSwitchRoutingBgpRoutersDeploy( - organizationId (string): Organization ID - addressFamily (object): Information regarding the address family - addressFamilyPrefixes (array): The list of network prefixes to which the address family applies - - addressFamilyProfile (object): Information regarding the profile applied to the address family - autonomousSystem (object): Information regarding the router's autonomous system - router (object): Information regarding the BPG router - switch (object): The router's switch node. When the router is part of a switch stack, this is the switch stack's active node @@ -2922,7 +2972,6 @@ def createOrganizationSwitchRoutingBgpRoutersDeploy( body_params = [ "addressFamily", "addressFamilyPrefixes", - "addressFamilyProfile", "autonomousSystem", "router", "switch", diff --git a/meraki/api/batch/wireless.py b/meraki/api/batch/wireless.py index 86e619b..8647e08 100644 --- a/meraki/api/batch/wireless.py +++ b/meraki/api/batch/wireless.py @@ -70,7 +70,7 @@ def updateDeviceWirelessElectronicShelfLabel(self, serial: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-electronic-shelf-label - serial (string): Serial - - channel (string): Desired ESL channel for the device, or 'Auto' (case insensitive) to use the recommended channel + - channel (string): Desired ESL channel for the device. Only configurable for devices assigned the High frequency ESL or sepioo IIoT role. Use 'Auto' (case insensitive) to use the recommended channel - enabled (boolean): Turn ESL features on and off for this device """ @@ -591,6 +591,108 @@ def updateNetworkWirelessIotRoles(self, networkId: str, roles: dict, **kwargs): } return action + def updateNetworkWirelessLocationAssetTrackingFloorPlan(self, networkId: str, floorPlanId: str, enabled: bool, **kwargs): + """ + **Update asset tracking settings for a specific floor plan.** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-location-asset-tracking-floor-plan + + - networkId (string): Network ID + - floorPlanId (string): Floor plan ID + - enabled (boolean): Enable or disable asset tracking for this floor plan + - webhook (object): Webhook configuration for asset tracking events + """ + + kwargs.update(locals()) + + networkId = urllib.parse.quote(networkId, safe="") + floorPlanId = urllib.parse.quote(floorPlanId, safe="") + resource = f"/networks/{networkId}/wireless/location/assetTracking/floorPlans/{floorPlanId}" + + body_params = [ + "enabled", + "webhook", + ] + 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 deleteNetworkWirelessLocationAssetTrackingFloorPlanGroups(self, networkId: str, floorPlanId: str): + """ + **Delete all the asset tracking groups for a floor plan in a network. It also deletes the asset tracking group nodes for all the nodes assigned to that floor plan at the moment of deletion.** + https://developer.cisco.com/meraki/api-v1/#!delete-network-wireless-location-asset-tracking-floor-plan-groups + + - networkId (string): Network ID + - floorPlanId (string): Floor plan ID + """ + + networkId = urllib.parse.quote(networkId, safe="") + floorPlanId = urllib.parse.quote(floorPlanId, safe="") + resource = f"/networks/{networkId}/wireless/location/assetTracking/floorPlans/{floorPlanId}/groups" + + action = { + "resource": resource, + "operation": "destroy", + } + return action + + def createNetworkWirelessLocationAssetTrackingFloorPlanGroupsBatchCreate( + self, networkId: str, floorPlanId: str, groups: list, **kwargs + ): + """ + **Create asset tracking groups for a floor plan in a network** + https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-location-asset-tracking-floor-plan-groups-batch-create + + - networkId (string): Network ID + - floorPlanId (string): Floor plan ID + - groups (array): List of groups to create. Up to 1000 groups can be provided in a request. + """ + + kwargs = locals() + + networkId = urllib.parse.quote(networkId, safe="") + floorPlanId = urllib.parse.quote(floorPlanId, safe="") + resource = f"/networks/{networkId}/wireless/location/assetTracking/floorPlans/{floorPlanId}/groups/batchCreate" + + body_params = [ + "groups", + ] + 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 createNetworkWirelessLocationRangingJobsBatch(self, networkId: str, jobs: list, **kwargs): + """ + **Schedule ranging jobs for one or more floor plans in a network** + https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-location-ranging-jobs-batch + + - networkId (string): Network ID + - jobs (array): List of ranging jobs to create. Up to 100 jobs can be provided in a request. + """ + + kwargs = locals() + + networkId = urllib.parse.quote(networkId, safe="") + resource = f"/networks/{networkId}/wireless/location/ranging/jobs/batch" + + body_params = [ + "jobs", + ] + 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 updateNetworkWirelessLocationScanning(self, networkId: str, **kwargs): """ **Change scanning API settings** diff --git a/meraki/api/campusGateway.py b/meraki/api/campusGateway.py index a9f1e58..3c78dad 100644 --- a/meraki/api/campusGateway.py +++ b/meraki/api/campusGateway.py @@ -759,6 +759,7 @@ def getOrganizationCampusGatewayConnections(self, organizationId: str, total_pag - campusGatewaySerials (array): Optional parameter to filter connections(APs) by MCG serials. This filter uses multiple exact matches. - campusGatewayClusterIds (array): Optional parameter to filter connections(APs) by MCG cluster IDs. This filter uses multiple exact matches. - campusGatewayTunnelStatuses (array): Optional parameter to filter connections(APs) by tunnel statuses. This filter uses multiple exact matches. + - campusGatewayPriorities (array): Optional parameter to filter connections(APs) by Campus Gateway tunnel priority. Use 0 for primary or 1 for backup. This filter uses multiple exact matches. - search (string): Optional parameter to filter connections(APs) on AP name, serial, MAC address, network name, or interface IP address. This filter uses partial string matching (ILIKE). - models (array): Optional parameter to filter connections(APs) by device model names. This filter uses multiple exact matches. - dataEncryptionStatuses (array): Optional parameter to filter connections(APs) by data encryption status. This filter uses multiple exact matches. @@ -795,6 +796,7 @@ def getOrganizationCampusGatewayConnections(self, organizationId: str, total_pag "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "search", "models", "dataEncryptionStatuses", @@ -812,6 +814,7 @@ def getOrganizationCampusGatewayConnections(self, organizationId: str, total_pag "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "models", "dataEncryptionStatuses", ] @@ -841,6 +844,7 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * - campusGatewaySerials (array): Optional parameter to filter connections(APs) by Campus Gateway serials. This filter uses multiple exact matches. - campusGatewayClusterIds (array): Optional parameter to filter connections(APs) by Campus Gateway cluster IDs. This filter uses multiple exact matches. - campusGatewayTunnelStatuses (array): Optional parameter to filter connections(APs) by tunnel statuses. This filter uses multiple exact matches. + - campusGatewayPriorities (array): Optional parameter to filter connections(APs) by Campus Gateway tunnel priority. Use 0 for primary or 1 for backup. This filter uses multiple exact matches. - search (string): Optional setting that lets you filter access points (APs) by name, serial number, MAC address, network name, or interface IP address. The filter matches partial text, not just exact values (uses ILIKE matching). - models (array): Optional parameter to filter connections(APs) by device model names. This filter uses multiple exact matches. - dataEncryptionStatuses (array): Optional parameter to filter connections(APs) by data encryption status. This filter uses multiple exact matches. @@ -861,6 +865,7 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "search", "models", "dataEncryptionStatuses", @@ -873,6 +878,7 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * "campusGatewaySerials", "campusGatewayClusterIds", "campusGatewayTunnelStatuses", + "campusGatewayPriorities", "models", "dataEncryptionStatuses", ] @@ -891,6 +897,58 @@ def getOrganizationCampusGatewayConnectionsOverview(self, organizationId: str, * return self._session.get(metadata, resource, params) + def getOrganizationCampusGatewayDevicesSystemCpuLoad(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **Return the latest CPU load averages reported by Campus Gateway devices.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-devices-system-cpu-load + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - networkIds (array): Optional exact-match network filters. Accepts both node group (N_) and locale (L_) network IDs. + - serials (array): Optional exact-match Campus Gateway serial filters. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["campusGateway", "monitor", "devices", "system", "cpu", "load"], + "operation": "getOrganizationCampusGatewayDevicesSystemCpuLoad", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/campusGateway/devices/system/cpu/load" + + query_params = [ + "networkIds", + "serials", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "serials", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationCampusGatewayDevicesSystemCpuLoad: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationCampusGatewayDevicesUplinksLocalOverridesByDevice( self, organizationId: str, total_pages=1, direction="next", **kwargs ): @@ -1060,7 +1118,7 @@ def createOrganizationCampusGatewayMdnsServicesCustom(self, organizationId: str, - organizationId (string): Organization ID - name (string): Display name of the custom mDNS service. - - types (array): One to ten DNS-SD service types. Accepted shorthand is normalized by the API. + - types (array): DNS-SD service types. Accepted shorthand is normalized by the API. """ kwargs = locals() @@ -1096,7 +1154,7 @@ def updateOrganizationCampusGatewayMdnsServicesCustom(self, organizationId: str, - organizationId (string): Organization ID - key (string): Key - name (string): Updated display name of the custom mDNS service. - - types (array): Replacement ordered list of one to ten DNS-SD service types. + - types (array): Replacement ordered list of DNS-SD service types. """ kwargs.update(locals()) diff --git a/meraki/api/organizations.py b/meraki/api/organizations.py index 9ee44b3..f1b3f79 100644 --- a/meraki/api/organizations.py +++ b/meraki/api/organizations.py @@ -10940,11 +10940,10 @@ def getSite(self, organizationId: str, siteId: str): def getSummary(self, organizationId: str): """ - **Returns the aggregate values required to populate organization summary - cards** - https://developer.cisco.com/meraki/api-v1/#!get-summary + **Returns organization connection, VPC, Site, and region counts derived from Zero Trust Routing and tunnel health.** + https://developer.cisco.com/meraki/api-v1/#!get-summary - - organizationId (string): Organization ID + - organizationId (string): Organization ID """ metadata = { @@ -14754,6 +14753,226 @@ def createOrganizationSplashThemeAsset(self, organizationId: str, themeIdentifie return self._session.post(metadata, resource, payload) + def getOrganizationSummarySustainabilityDailyConsumerMetricsNetworks(self, organizationId: str, **kwargs): + """ + **Lists daily consumer metrics for networks.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-daily-consumer-metrics-networks + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "dailyConsumerMetrics", "networks"], + "operation": "getOrganizationSummarySustainabilityDailyConsumerMetricsNetworks", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/dailyConsumerMetrics/networks" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilityDailyConsumerMetricsNetworks: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategories(self, organizationId: str): + """ + **Lists available device categories for sustainability metrics with their corresponding device types.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-device-categories + + - organizationId (string): Organization ID + """ + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "summaryConsumerMetrics", "deviceCategories"], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategories", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/deviceCategories" + + return self._session.get(metadata, resource) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategoriesAggregated( + self, organizationId: str, **kwargs + ): + """ + **Lists summary consumer metrics aggregated by device category.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-device-categories-aggregated + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": [ + "organizations", + "configure", + "summary", + "sustainability", + "summaryConsumerMetrics", + "deviceCategories", + "aggregated", + ], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategoriesAggregated", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/deviceCategories/aggregated" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsDeviceCategoriesAggregated: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsDevices(self, organizationId: str, **kwargs): + """ + **Lists summary consumer metrics for devices.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-devices + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "summaryConsumerMetrics", "devices"], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsDevices", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/devices" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsDevices: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworks(self, organizationId: str, **kwargs): + """ + **Lists summary consumer metrics for networks.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-networks + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["organizations", "configure", "summary", "sustainability", "summaryConsumerMetrics", "networks"], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworks", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/networks" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworks: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + + def getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworksAggregated(self, organizationId: str, **kwargs): + """ + **Returns aggregated consumer metrics for all networks in the organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-sustainability-summary-consumer-metrics-networks-aggregated + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 730 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 32 days after t0. + - timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 32 days. The default is 30 days. + """ + + kwargs.update(locals()) + + metadata = { + "tags": [ + "organizations", + "configure", + "summary", + "sustainability", + "summaryConsumerMetrics", + "networks", + "aggregated", + ], + "operation": "getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworksAggregated", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/summary/sustainability/summaryConsumerMetrics/networks/aggregated" + + query_params = [ + "t0", + "t1", + "timespan", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + if self._session._validate_kwargs: + all_params = query_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSummarySustainabilitySummaryConsumerMetricsNetworksAggregated: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get(metadata, resource, params) + def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, **kwargs): """ **Return the top 10 appliances sorted by utilization over given time range.** diff --git a/meraki/api/switch.py b/meraki/api/switch.py index 811085d..15ac0af 100644 --- a/meraki/api/switch.py +++ b/meraki/api/switch.py @@ -200,7 +200,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - serial (string): Serial - portId (string): Port ID - - name (string): The name of the switch port. For IOS XE Catalyst switches, this value is the interface description. + - name (string): The name of the switch port. Dashboard displays this value as the port description. For Cisco Catalyst switches running IOS XE, it corresponds to the configured interface description. - tags (array): The list of tags of the switch port. - enabled (boolean): The status of the switch port. - poeEnabled (boolean): The PoE status of the switch port. @@ -3609,7 +3609,7 @@ def updateOrganizationConfigTemplateSwitchProfilePort( - configTemplateId (string): Config template ID - profileId (string): Profile ID - portId (string): Port ID - - name (string): The name of the switch template port. For IOS XE Catalyst switches, this value is the interface description. + - name (string): The name of the switch template port. Dashboard displays this value as the port description. For Cisco Catalyst switches running IOS XE, it corresponds to the configured interface description. - tags (array): The list of tags of the switch template port. - enabled (boolean): The status of the switch template port. - poeEnabled (boolean): The PoE status of the switch template port. @@ -4170,6 +4170,219 @@ def cloneOrganizationSwitchDevices(self, organizationId: str, sourceSerial: str, return self._session.post(metadata, resource, payload) + def createOrganizationSwitchDevicesSoftwareUpdateBatch( + self, organizationId: str, serials: list, toVersion: dict, **kwargs + ): + """ + **Create a device-scoped software update batch for up to 50 selected Cloud Monitoring for Catalyst switches** + https://developer.cisco.com/meraki/api-v1/#!create-organization-switch-devices-software-update-batch + + - organizationId (string): Organization ID + - serials (array): Switch serials receiving the same update. Values are trimmed and uppercased; duplicates after normalization are rejected. At least one and at most 50 are accepted. + - toVersion (object): Destination software version compatible with every selected device. The id field is required. + - scheduledAt (string): UTC instant at which update execution should begin. Omit to schedule as soon as allowed. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["switch", "configure", "devices", "software", "updates", "batches"], + "operation": "createOrganizationSwitchDevicesSoftwareUpdateBatch", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/switch/devices/software/updates/batches" + + body_params = [ + "serials", + "toVersion", + "scheduledAt", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"createOrganizationSwitchDevicesSoftwareUpdateBatch: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def cancelOrganizationSwitchDevicesSoftwareUpdateBatches(self, organizationId: str, **kwargs): + """ + **Cancel pending device-scoped software updates within one or more batches before execution begins** + https://developer.cisco.com/meraki/api-v1/#!cancel-organization-switch-devices-software-update-batches + + - organizationId (string): Organization ID + - batch (object): Optional device-scoped software update batch selector. Required when serials is omitted; when provided, the id field is required. + - serials (array): Optional switch serials to cancel. Values are trimmed and uppercased; duplicates after normalization are rejected. Required when batch is omitted; when provided, at least one and at most 50 serials are accepted. The selection may span at most 20 device-scoped software update batches. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["switch", "configure", "devices", "software", "updates", "batches"], + "operation": "cancelOrganizationSwitchDevicesSoftwareUpdateBatches", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/switch/devices/software/updates/batches/cancel" + + body_params = [ + "batch", + "serials", + ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + if self._session._validate_kwargs: + all_params = [] + body_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"cancelOrganizationSwitchDevicesSoftwareUpdateBatches: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def getOrganizationSwitchDevicesSoftwareUpdateStatusesByDevice( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List software update statuses for Cloud Monitoring for Catalyst switches in one paginated device table** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-devices-software-update-statuses-by-device + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 30. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'ascending'. + - networkIds (array): Exact network.id filters using inclusive OR. Omit for no network restriction; maximum 100. + - serials (array): Exact, case-sensitive device.serial filters using inclusive OR. Omit for no serial restriction; maximum 100. + - search (string): Case-insensitive partial substring match against device.name or device.serial. Serial punctuation is matched as supplied, and whitespace-separated text is treated as one substring rather than tokenized. If this scalar is repeated, only the last value is used. + - isUpdateAvailable (boolean): Exact filter for items[].isUpdateAvailable. Omit for no availability restriction; no default is applied. + - updateStatuses (array): Exact items[].update.status.value filters using inclusive OR, normalized case-insensitively to the canonical enum value. Omit for no detailed-status restriction. Detailed status values match the existing firmware-upgrade by-device API. Idle means no active or retained update. Execution progress and terminal outcomes use their existing canonical values and labels. Terminal success or failure is also reported in status.result. No default is implied. + - updateStages (array): Exact items[].update.status.stage.value filters using inclusive OR, normalized case-insensitively to the canonical enum value. Omit for no execution-stage restriction. Execution-stage values: check-in, download, installation, or verification. The value is null before execution begins and after no stage can be identified. No default is implied. + - updateResults (array): Exact items[].update.status.result.value filters using inclusive OR, normalized case-insensitively to the canonical enum value. Omit for no terminal-result restriction. Terminal-result values: succeeded, skipped, canceled, or failed. The value is null until the update completes. No default is implied. + - currentVersionShortNames (array): Exact, case-sensitive currentVersion.shortName filters using inclusive OR. Omit for no current-version name restriction; maximum 100. + - models (array): Exact, case-sensitive device.model filters using inclusive OR. Omit for no model restriction; maximum 100. + - sortKey (string): Sort key: currentVersion orders currentVersion.shortName; device orders device.name with serial fallback; isUpdateAvailable orders false before true when ascending; model orders device.model; network orders network.name; updateStatus uses this semantic order when ascending: idle, upgrade-scheduled, upgrade-retry-scheduled, checking-in, download-started, download-complete, install-started, verification-started, upgrade-complete, upgrade-skipped, upgrade-canceled, upgrade-failed. Terminal items are then ordered by result: succeeded, skipped, canceled, then failed. Ties are resolved by device.serial. Defaults to device. + """ + + 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 "sortKey" in kwargs: + options = ["currentVersion", "device", "isUpdateAvailable", "model", "network", "updateStatus"] + assert kwargs["sortKey"] in options, ( + f'''"sortKey" cannot be "{kwargs["sortKey"]}", & must be set to one of: {options}''' + ) + + metadata = { + "tags": ["switch", "monitor", "devices", "software", "updates", "statuses", "byDevice"], + "operation": "getOrganizationSwitchDevicesSoftwareUpdateStatusesByDevice", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/switch/devices/software/updates/statuses/byDevice" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "sortOrder", + "networkIds", + "serials", + "search", + "isUpdateAvailable", + "updateStatuses", + "updateStages", + "updateResults", + "currentVersionShortNames", + "models", + "sortKey", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "serials", + "updateStatuses", + "updateStages", + "updateResults", + "currentVersionShortNames", + "models", + ] + 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"getOrganizationSwitchDevicesSoftwareUpdateStatusesByDevice: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationSwitchDevicesSoftwareVersionsTargetsByDevice( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **Returns a paginated list of accessible Cloud Monitoring for Catalyst switches and the complete list of destination software versions for each switch** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-devices-software-versions-targets-by-device + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - serials (array): Optional switch serials used to filter the result set. Values are trimmed and uppercased. Supports up to 50 serials when provided. Matching switches that are not accessible to the caller or are not eligible for this operation are omitted. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 50. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["switch", "monitor", "devices", "software", "versions", "targets", "byDevice"], + "operation": "getOrganizationSwitchDevicesSoftwareVersionsTargetsByDevice", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/switch/devices/software/versions/targets/byDevice" + + query_params = [ + "serials", + "perPage", + "startingAfter", + "endingBefore", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "serials", + ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f"{k.strip()}[]"] = kwargs[f"{k}"] + params.pop(k.strip()) + + if self._session._validate_kwargs: + all_params = query_params + array_params + invalid = [k for k in kwargs if k.strip() not in all_params and k != "self"] + if invalid and self._session._logger: + self._session._logger.warning( + f"getOrganizationSwitchDevicesSoftwareVersionsTargetsByDevice: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationSwitchDevicesSystemQueuesHistoryBySwitchByInterval( self, organizationId: str, total_pages=1, direction="next", **kwargs ): @@ -6590,16 +6803,7 @@ def getOrganizationSwitchRoutingBgpPeersGroupsAddressFamiliesDeployments( return self._session.get_pages(metadata, resource, params, total_pages, direction) def createOrganizationSwitchRoutingBgpPeersGroupsDeploy( - self, - organizationId: str, - addressFamily: dict, - network: dict, - peerGroup: dict, - peerGroupAddressFamilyBindingProfile: dict, - peerGroupProfile: dict, - policies: list, - router: dict, - **kwargs, + self, organizationId: str, addressFamily: dict, network: dict, policies: list, router: dict, **kwargs ): """ **Create or update a peer group, in addition to an associated peer group profile, peer group address family binding, peer group address family binding profile and routing policies associated with the peer group** @@ -6608,12 +6812,23 @@ def createOrganizationSwitchRoutingBgpPeersGroupsDeploy( - organizationId (string): Organization ID - addressFamily (object): Information regarding the address family the peer group address family binding belongs to - network (object): Information regarding the network the peer group profile belongs to - - peerGroup (object): Information regarding the peer group - - peerGroupAddressFamilyBindingProfile (object): Information regarding the peer group address family binding profile - - peerGroupProfile (object): Information regarding the peer group profile - policies (array): Information regarding the routing policies - router (object): Information regarding the router this peer group belongs to - - peerGroupAddressFamilyBinding (object): Information regarding the peer group address family binding. Only required when updating. + - peerGroupId (string): Object ID for the peer group. Only required when updating. + - name (string): Name of the peer group (CLI: 'neighbor peer-group') + - description (string): Text description of the peer group (CLI: 'neighbor description ') + - ebgp (object): Options related to eBGP configuration + - password (string): BGP password used to authenticate BGP peers and prevent unauthorized access (CLI: 'neighbor password ') + - timers (object): Options related to timers used to maintain connectivity between BGP peers + - autonomousSystem (object): Information regarding the autonomous system for the BGP neighbors in the peer group + - interfaces (object): Options related to BGP interfaces + - advertisement (object): Options related to route advertisement + - communityAttribute (object): Information regarding the community attribute for peer groups for a given address family + - nextHop (object): Information regarding next hop for peer groups for a given address family + - removePrivateAs (object): Information regarding removal of private AS number from outbound updates + - routeReflector (object): Information regarding route reflectors + - softReconfiguration (object): Options related to soft reconfiguration + - weight (integer): Set default weight for routes from this peer group (CLI: 'neighbor IBGP weight ') """ kwargs.update(locals()) @@ -6626,14 +6841,25 @@ def createOrganizationSwitchRoutingBgpPeersGroupsDeploy( resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/groups/deploy" body_params = [ + "peerGroupId", "addressFamily", "network", - "peerGroup", - "peerGroupAddressFamilyBinding", - "peerGroupAddressFamilyBindingProfile", - "peerGroupProfile", "policies", "router", + "name", + "description", + "ebgp", + "password", + "timers", + "autonomousSystem", + "interfaces", + "advertisement", + "communityAttribute", + "nextHop", + "removePrivateAs", + "routeReflector", + "softReconfiguration", + "weight", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -6895,15 +7121,7 @@ def getOrganizationSwitchRoutingBgpPeersNeighbors(self, organizationId: str, tot return self._session.get_pages(metadata, resource, params, total_pages, direction) def createOrganizationSwitchRoutingBgpPeersNeighborsDeploy( - self, - organizationId: str, - addressFamily: dict, - neighbor: dict, - neighborAddressFamilyBinding: dict, - peerGroup: dict, - policies: list, - router: dict, - **kwargs, + self, organizationId: str, addressFamily: dict, peerGroup: dict, policies: list, router: dict, **kwargs ): """ **Create or update a neighor, in addition to an associated neighbor address family binding and routing policies associated with the neighbor** @@ -6911,14 +7129,22 @@ def createOrganizationSwitchRoutingBgpPeersNeighborsDeploy( - organizationId (string): Organization ID - addressFamily (object): Information regarding the address family this binding is bound to - - neighbor (object): Information regarding the BPG neighbor - - neighborAddressFamilyBinding (object): Information regarding the neighbor address family binding - peerGroup (object): Information regarding the peer group this neighbor belongs to - policies (array): Information regarding the routing policies related to the neighbor - router (object): Information regarding the router this neighbor peers with + - neighborId (string): The neighbor object ID. Only required for updating a neighbor + - description (string): Text description of the neighbor (CLI: 'neighbor 10.0.42.1 description ') + - address (string): The IP address of the neighbor (CLI: 'neighbor
') + - ebgp (object): Options related to eBGP configuration + - password (string): BGP password used to authenticate BGP peers and prevent unauthorized access (CLI: 'neighbor 10.0.42.1 password ') + - interfaces (object): Options related to BGP interfaces + - peering (object): Options related to enabling peering for this address family and neighbor + - weight (integer): Set default weight for routes from this neighbor (CLI: 'neighbor 10.0.42.1 weight ') + - advertisement (object): Options related to route advertisement + - softReconfiguration (object): Options related to soft reconfiguration """ - kwargs = locals() + kwargs.update(locals()) metadata = { "tags": ["switch", "configure", "routing", "bgp", "peers", "neighbors", "deploy"], @@ -6928,12 +7154,20 @@ def createOrganizationSwitchRoutingBgpPeersNeighborsDeploy( resource = f"/organizations/{organizationId}/switch/routing/bgp/peers/neighbors/deploy" body_params = [ + "neighborId", "addressFamily", - "neighbor", - "neighborAddressFamilyBinding", "peerGroup", "policies", "router", + "description", + "address", + "ebgp", + "password", + "interfaces", + "peering", + "weight", + "advertisement", + "softReconfiguration", ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} @@ -7087,7 +7321,6 @@ def createOrganizationSwitchRoutingBgpRoutersDeploy( organizationId: str, addressFamily: dict, addressFamilyPrefixes: list, - addressFamilyProfile: dict, autonomousSystem: dict, router: dict, switch: dict, @@ -7100,7 +7333,6 @@ def createOrganizationSwitchRoutingBgpRoutersDeploy( - organizationId (string): Organization ID - addressFamily (object): Information regarding the address family - addressFamilyPrefixes (array): The list of network prefixes to which the address family applies - - addressFamilyProfile (object): Information regarding the profile applied to the address family - autonomousSystem (object): Information regarding the router's autonomous system - router (object): Information regarding the BPG router - switch (object): The router's switch node. When the router is part of a switch stack, this is the switch stack's active node @@ -7118,7 +7350,6 @@ def createOrganizationSwitchRoutingBgpRoutersDeploy( body_params = [ "addressFamily", "addressFamilyPrefixes", - "addressFamilyProfile", "autonomousSystem", "router", "switch", diff --git a/meraki/api/wireless.py b/meraki/api/wireless.py index ba59369..3244d3e 100644 --- a/meraki/api/wireless.py +++ b/meraki/api/wireless.py @@ -169,7 +169,7 @@ def updateDeviceWirelessElectronicShelfLabel(self, serial: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-electronic-shelf-label - serial (string): Serial - - channel (string): Desired ESL channel for the device, or 'Auto' (case insensitive) to use the recommended channel + - channel (string): Desired ESL channel for the device. Only configurable for devices assigned the High frequency ESL or sepioo IIoT role. Use 'Auto' (case insensitive) to use the recommended channel - enabled (boolean): Turn ESL features on and off for this device """ @@ -2181,6 +2181,132 @@ def getNetworkWirelessLatencyStats(self, networkId: str, **kwargs): return self._session.get(metadata, resource, params) + def updateNetworkWirelessLocationAssetTrackingFloorPlan(self, networkId: str, floorPlanId: str, enabled: bool, **kwargs): + """ + **Update asset tracking settings for a specific floor plan.** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-location-asset-tracking-floor-plan + + - networkId (string): Network ID + - floorPlanId (string): Floor plan ID + - enabled (boolean): Enable or disable asset tracking for this floor plan + - webhook (object): Webhook configuration for asset tracking events + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "configure", "location", "assetTracking", "floorPlans"], + "operation": "updateNetworkWirelessLocationAssetTrackingFloorPlan", + } + networkId = urllib.parse.quote(str(networkId), safe="") + floorPlanId = urllib.parse.quote(str(floorPlanId), safe="") + resource = f"/networks/{networkId}/wireless/location/assetTracking/floorPlans/{floorPlanId}" + + body_params = [ + "enabled", + "webhook", + ] + 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"updateNetworkWirelessLocationAssetTrackingFloorPlan: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.put(metadata, resource, payload) + + def deleteNetworkWirelessLocationAssetTrackingFloorPlanGroups(self, networkId: str, floorPlanId: str): + """ + **Delete all the asset tracking groups for a floor plan in a network** + https://developer.cisco.com/meraki/api-v1/#!delete-network-wireless-location-asset-tracking-floor-plan-groups + + - networkId (string): Network ID + - floorPlanId (string): Floor plan ID + """ + + metadata = { + "tags": ["wireless", "configure", "location", "assetTracking", "floorPlans", "groups"], + "operation": "deleteNetworkWirelessLocationAssetTrackingFloorPlanGroups", + } + networkId = urllib.parse.quote(str(networkId), safe="") + floorPlanId = urllib.parse.quote(str(floorPlanId), safe="") + resource = f"/networks/{networkId}/wireless/location/assetTracking/floorPlans/{floorPlanId}/groups" + + return self._session.delete(metadata, resource) + + def createNetworkWirelessLocationAssetTrackingFloorPlanGroupsBatchCreate( + self, networkId: str, floorPlanId: str, groups: list, **kwargs + ): + """ + **Create asset tracking groups for a floor plan in a network** + https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-location-asset-tracking-floor-plan-groups-batch-create + + - networkId (string): Network ID + - floorPlanId (string): Floor plan ID + - groups (array): List of groups to create. Up to 1000 groups can be provided in a request. + """ + + kwargs = locals() + + metadata = { + "tags": ["wireless", "configure", "location", "assetTracking", "floorPlans", "groups", "batchCreate"], + "operation": "createNetworkWirelessLocationAssetTrackingFloorPlanGroupsBatchCreate", + } + networkId = urllib.parse.quote(str(networkId), safe="") + floorPlanId = urllib.parse.quote(str(floorPlanId), safe="") + resource = f"/networks/{networkId}/wireless/location/assetTracking/floorPlans/{floorPlanId}/groups/batchCreate" + + body_params = [ + "groups", + ] + 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"createNetworkWirelessLocationAssetTrackingFloorPlanGroupsBatchCreate: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + + def createNetworkWirelessLocationRangingJobsBatch(self, networkId: str, jobs: list, **kwargs): + """ + **Schedule ranging jobs for one or more floor plans in a network** + https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-location-ranging-jobs-batch + + - networkId (string): Network ID + - jobs (array): List of ranging jobs to create. Up to 100 jobs can be provided in a request. + """ + + kwargs = locals() + + metadata = { + "tags": ["wireless", "configure", "location", "ranging", "jobs", "batch"], + "operation": "createNetworkWirelessLocationRangingJobsBatch", + } + networkId = urllib.parse.quote(str(networkId), safe="") + resource = f"/networks/{networkId}/wireless/location/ranging/jobs/batch" + + body_params = [ + "jobs", + ] + 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"createNetworkWirelessLocationRangingJobsBatch: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.post(metadata, resource, payload) + def updateNetworkWirelessLocationScanning(self, networkId: str, **kwargs): """ **Change scanning API settings** @@ -4823,7 +4949,7 @@ def getOrganizationAssuranceWirelessExperienceChannelAvailabilityInsightsByNetwo kwargs.update(locals()) if "insights" in kwargs: - options = ["dashboard", "rca"] + options = ["dashboard", "rca", "rca_v2"] assert kwargs["insights"] in options, ( f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' ) @@ -5518,7 +5644,7 @@ def getOrganizationAssuranceWirelessExperienceCoverageInsightsByNetwork( kwargs.update(locals()) if "insights" in kwargs: - options = ["dashboard", "rca"] + options = ["dashboard", "rca", "rca_v2"] assert kwargs["insights"] in options, ( f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' ) @@ -6383,7 +6509,7 @@ def getOrganizationAssuranceWirelessExperienceSuccessfulConnectsInsightsByNetwor kwargs.update(locals()) if "insights" in kwargs: - options = ["dashboard", "rca"] + options = ["dashboard", "rca", "rca_v2"] assert kwargs["insights"] in options, ( f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' ) @@ -7062,7 +7188,7 @@ def getOrganizationAssuranceWirelessExperienceTimeToConnectInsightsByNetwork( kwargs.update(locals()) if "insights" in kwargs: - options = ["dashboard", "rca"] + options = ["dashboard", "rca", "rca_v2"] assert kwargs["insights"] in options, ( f'''"insights" cannot be "{kwargs["insights"]}", & must be set to one of: {options}''' ) @@ -9751,6 +9877,223 @@ def getOrganizationWirelessIotRolesByNetwork(self, organizationId: str, total_pa return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationWirelessLocationAssetTrackingFloorPlans( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **Retrieve a list of asset tracking settings per floor plan.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-asset-tracking-floor-plans + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - floorPlanIds (array): Optional parameter to filter settings by one or more floor plan IDs + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "configure", "location", "assetTracking", "floorPlans"], + "operation": "getOrganizationWirelessLocationAssetTrackingFloorPlans", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/location/assetTracking/floorPlans" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "floorPlanIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "floorPlanIds", + ] + 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"getOrganizationWirelessLocationAssetTrackingFloorPlans: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationWirelessLocationAssetTrackingGroups( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **Retrieve a list of asset tracking groups used in asset tracking.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-asset-tracking-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 - 1000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Optional parameter to filter asset tracking groups by one or more network IDs + - floorPlanIds (array): Optional parameter to filter asset tracking groups by one or more floor plan IDs + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "configure", "location", "assetTracking", "groups"], + "operation": "getOrganizationWirelessLocationAssetTrackingGroups", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/location/assetTracking/groups" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "networkIds", + "floorPlanIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "floorPlanIds", + ] + 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"getOrganizationWirelessLocationAssetTrackingGroups: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationWirelessLocationRangingJobs(self, organizationId: str, total_pages=1, direction="next", **kwargs): + """ + **Retrieve a list of ranging jobs that measure the distances between APs by performing ranging operations.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-ranging-jobs + + - 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 - 10000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Optional parameter to filter ranging jobs by one or more network IDs + - jobIds (array): Optional parameter to filter ranging jobs by one or more job IDs + """ + + kwargs.update(locals()) + + metadata = { + "tags": ["wireless", "configure", "location", "ranging", "jobs"], + "operation": "getOrganizationWirelessLocationRangingJobs", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/location/ranging/jobs" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "networkIds", + "jobIds", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "jobIds", + ] + 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"getOrganizationWirelessLocationRangingJobs: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + def getOrganizationWirelessLocationRangingMeasurements( + self, organizationId: str, total_pages=1, direction="next", **kwargs + ): + """ + **List the ranging measurements** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-ranging-measurements + + - 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 - 10000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Optional parameter to filter ranging measurements by one or more network IDs + - floorPlanIds (array): Optional parameter to filter ranging measurements by one or more floor plan IDs + - type (string): Optional parameter to filter the type of ranging measurements returned. By default, only 'uwb' measurements are returned. + """ + + kwargs.update(locals()) + + if "type" in kwargs: + options = ["all", "ftm", "uwb"] + assert kwargs["type"] in options, f'''"type" cannot be "{kwargs["type"]}", & must be set to one of: {options}''' + + metadata = { + "tags": ["wireless", "configure", "location", "ranging", "measurements"], + "operation": "getOrganizationWirelessLocationRangingMeasurements", + } + organizationId = urllib.parse.quote(str(organizationId), safe="") + resource = f"/organizations/{organizationId}/wireless/location/ranging/measurements" + + query_params = [ + "perPage", + "startingAfter", + "endingBefore", + "networkIds", + "floorPlanIds", + "type", + ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = [ + "networkIds", + "floorPlanIds", + ] + 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"getOrganizationWirelessLocationRangingMeasurements: ignoring unrecognized kwargs: {invalid}" + ) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + def getOrganizationWirelessLocationScanningByNetwork(self, organizationId: str, total_pages=1, direction="next", **kwargs): """ **Return scanning API settings** diff --git a/pyproject.toml b/pyproject.toml index c630ff6..60b4f96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "meraki" -version = "4.5.0b4" +version = "4.6.0b0" description = "Cisco Meraki Dashboard API library" authors = [ {name = "Cisco Meraki", email = "api-feedback@meraki.net"} diff --git a/uv.lock b/uv.lock index f61d964..cbfb768 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 3 +revision = 5 requires-python = ">=3.11" [[package]] @@ -549,7 +549,7 @@ wheels = [ [[package]] name = "meraki" -version = "4.5.0b4" +version = "4.6.0b0" source = { editable = "." } dependencies = [ { name = "aiohttp" },