iot¶
The following methods allow for interaction with the Z-Insights IoT Device Visibility Analytics API.
Methods are accessible via zinsights.iot
Copyright (c) 2023, Zscaler Inc.
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- class IotAPI¶
Bases:
APIClientA Client object for the Z-Insights IOT domain.
Securing IoT begins with knowing which devices are connected to your network and what they’re doing. Zscaler IoT Device Visibility extends the power of the Zero Trust Exchange™ platform, using AI/ML to automatically detect, identify, and classify IoT devices across your estate. This domain provides device data and statistics.
- get_device_stats(limit=None, filter_by=None, order_by=None)¶
Get IoT device statistics.
Returns device statistics including: - devices_count: Total device count - user_devices_count: Unmanaged user devices count - iot_devices_count: IoT devices count - server_devices_count: Server devices count - un_classified_devices_count: Unclassified devices count - entries: List of device classifications with totals
- Parameters:
limit – Maximum number of entries to return.
filter_by – Filter options using IoTDeviceFilterBy. Supports filtering by classifications, classification_uuid, category.
order_by – Ordering options using list of IoTDeviceOrderBy. Supports ordering by classifications, classification_uuid, category, total.
- Returns:
- (device_stats_dict, response, error)
device_stats_dict contains counts and entries list.
- Return type:
Examples
>>> stats, _, err = client.zinsights.iot.get_device_stats(limit=10) >>> print(f"Total devices: {stats.get('devices_count')}") >>> print(f"IoT devices: {stats.get('iot_devices_count')}") >>> for entry in stats.get('entries', []): ... print(f" {entry['classifications']}: {entry['total']}") >>> >>> # With filtering >>> from zscaler.zinsights.models.inputs import IoTDeviceFilterBy, StringFilter >>> filter_by = IoTDeviceFilterBy(category=StringFilter(eq="Camera")) >>> stats, _, err = client.zinsights.iot.get_device_stats( ... limit=10, ... filter_by=filter_by ... )