inventory¶
The following methods allow for interaction with the ZDX Inventory API endpoints.
Methods are accessible via zdx.inventory
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 InventoryAPI¶
Bases:
APIClient- list_software_keys(software_key, query_params=None)¶
Returns a list of all users and devices for the given software name and version.
- Keyword Arguments:
{dict} (query_params) –
Map of query parameters for the request.
[query_params.since]{int}: The number of hours to look back for devices.[query_params.department_id]{str}: The unique ID for the department.[query_params.geo_id]{int}: The unique ID for the geolocation.[query_params.user_ids]{list}: List of user IDs.[query_params.device_ids]{list}: List of device IDs.- Returns:
The list of software in ZDX.
- Return type:
Examples
List all software keys in ZDX for the past 2 hours:
>>> software_key, _, error = client.zdx.inventory.list_software_keys( software_key='screencaptureui2') ... if error: ... print(f"Error: {error}") ... else: ... for software in software_key: ... print(software.as_dict())
List all software keys in ZDX for the past 24 hours:
>>> software_key, _, error = client.zdx.inventory.list_software_keys( software_key='screencaptureui2', query_params={"since": 24}) ... if error: ... print(f"Error: {error}") ... else: ... for software in software_key: ... print(software.as_dict())
- list_softwares(query_params=None)¶
Returns a list of all software in ZDX.
- Keyword Arguments:
{dict} (query_params) –
Map of query parameters for the request.
[query_params.location_id]{list}: The unique ID for the department.[query_params.department_id]{list}: The unique ID for the department.[query_params.geo_id]{list}: List of unique ID for the geolocation.[query_params.user_ids]{list}: List of user IDs.[query_params.device_ids]{list}: List of device IDs.- Returns:
The list of software in ZDX.
- Return type:
Tuple
Examples
List all software in ZDX for the past 2 hours:
>>> software_list, _, err = client.zdx.inventory.list_softwares() ... if err: ... print(f"Error listing softwares: {err}") ... return ... for software in software_list: ... print(software)
List all software in ZDX for the past 24 hours:
>>> software_list, _, err = client.zdx.inventory.list_softwares(query_params={"since": 24}) ... if err: ... print(f"Error listing softwares: {err}") ... return ... for software in software_list: ... print(software)