device_management

The following methods allow for interaction with the ZIA Device Management API endpoints.

Methods are accessible via zia.device_management

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 DeviceManagementAPI

Bases: APIClient

A Client object for the Device Management resource.

list_device_groups(query_params=None)

Returns the list of ZIA Device Groups.

Parameters:

{dict} (query_params) –

Map of query parameters for the request.

[query_params.include_device_info] {bool}: Include or exclude device information.

[query_params.include_pseudo_groups] {bool}: Include or exclude Zscaler Client Connector and

Cloud Browser Isolation-related device groups.

Returns:

A tuple containing (list of Device Group instances, Response, error)

Return type:

tuple

Examples

Print all device groups

>>> for device group in zia.device_management.list_device_groups():
...    pprint(device)

Print Device Groups that match the name or description ‘Windows’

>>> pprint(zia.device_management.list_device_groups('Windows'))
list_device_lite()

Returns the list of devices that includes device ID, name, and owner name.

Returns:

List of Device/ids.

Return type:

tuple

Examples

Get Device Lite results

>>> results = zia.device.list_device_lite()
... for item in results:
...    print(item)
list_devices(query_params=None)

Returns the list of Devices.

Parameters:

{dict} (query_params) –

Map of query parameters for the request. [query_params.name] {str}: The device group name. This is a starts with match.

[query_params.user_ids] {list}: Used to list devices for specific users.

[query_params.include_all] {bool}: Used to include or exclude Cloud Browser Isolation devices.

[query_params.page] {int}: Specifies the page offset.

[query_params.page_size] {int}: Specifies the page size.

The default size is 100, but the maximum size is 1000.

Returns:

A tuple containing (list of Devices instances, Response, error)

Return type:

tuple

Examples

Print all devices

>>> for dlp device in zia.device_management.list_devices():
...    pprint(device)

Print Devices that match the name or description ‘WINDOWS_OS’

>>> pprint(zia.device_management.list_devices('WINDOWS_OS'))