devices#

The following methods allow for interaction with the ZDX Devices API endpoints.

Methods are accessible via zdx.devices

class DevicesAPI#
delete_deeptrace(device_id, trace_id)#

Deletes a single deeptrace session and associated data for a specific device.

Parameters:
  • device_id (str) – The unique ID for the device.

  • trace_id (str) – The unique ID for the deeptrace.

Returns:

The trace ID that was deleted.

Return type:

str

Examples

Delete a single deeptrace for a device.

>>> trace = zdx.devices.delete_deeptrace('123456789', '987654321')
... print(trace)
get_call_quality_metrics(device_id, app_id, **kwargs)#

Returns a single call quality metrics for a specific application being used by a device.

Parameters:
  • device_id (str) – The unique ID for the device.

  • app_id (str) – The unique ID for the application.

Keyword Arguments:

since (int) – The number of hours to look back for devices.

Returns:

The call quality metrics resource record.

Return type:

Box

Examples

Print call quality metrics for an application.

>>> metrics = zdx.devices.get_call_quality_metrics('123456789', '987654321')
... print(metrics)
get_cloudpath(device_id, app_id, probe_id, **kwargs)#

Returns a single cloudpath for a specific application being used by a device.

Parameters:
  • device_id (str) – The unique ID for the device.

  • app_id (str) – The unique ID for the application.

  • probe_id (str) – The unique ID for the cloudpath probe.

Keyword Arguments:

since (int) – The number of hours to look back for devices.

Returns:

The cloudpath resource record.

Return type:

Box

Examples

Print a single cloudpath for an application.

>>> cloudpath = zdx.devices.get_cloudpath('123456789', '987654321', '123987456')
... print(cloudpath)
get_cloudpath_probe(device_id, app_id, probe_id, **kwargs)#

Returns a single cloudpath probe for a specific application being used by a device.

Parameters:
  • device_id (str) – The unique ID for the device.

  • app_id (str) – The unique ID for the application.

  • probe_id (str) – The unique ID for the cloudpath probe.

Keyword Arguments:

since (int) – The number of hours to look back for devices.

Returns:

The cloudpath probe resource record.

Return type:

Box

Examples

Print a single cloudpath probe for an application.

>>> probe = zdx.devices.get_cloudpath_probe('123456789', '987654321', '123987456')
... print(probe)
get_deeptrace(device_id, trace_id)#

Returns information on a single deeptrace for a specific device.

Parameters:
  • device_id (str) – The unique ID for the device.

  • trace_id (str) – The unique ID for the deeptrace.

Returns:

The deeptrace resource record.

Return type:

Box

Examples

Print a single deeptrace for a device.

>>> trace = zdx.devices.get_deeptrace('123456789', '987654321')
... print(trace)
get_deeptrace_cloudpath(device_id, trace_id)#

Returns cloudpath for a specific deeptrace.

Parameters:
  • device_id (str) – The unique ID for the device.

  • trace_id (str) – The unique ID for the deeptrace.

Returns:

The deeptrace cloudpath.

Return type:

Box

Examples

Print cloudpath for a deeptrace.

>>> metrics = zdx.devices.get_deeptrace_cloudpath('123456789', '987654321')
... print(metrics)
get_deeptrace_cloudpath_metrics(device_id, trace_id)#

Returns cloudpath metrics for a specific deeptrace.

Parameters:
  • device_id (str) – The unique ID for the device.

  • trace_id (str) – The unique ID for the deeptrace.

Returns:

The deeptrace cloudpath metrics.

Return type:

Box

Examples

Print cloudpath metrics for a deeptrace.

>>> metrics = zdx.devices.get_deeptrace_cloudpath_metrics('123456789', '987654321')
... print(metrics)
get_deeptrace_events(device_id, trace_id)#

Returns events for a specific deeptrace.

Parameters:
  • device_id (str) – The unique ID for the device.

  • trace_id (str) – The unique ID for the deeptrace.

Returns:

The deeptrace events.

Return type:

Box

Examples

Print events for a deeptrace.

>>> events = zdx.devices.get_deeptrace_events('123456789', '987654321')
... print(events)
get_deeptrace_health_metrics(device_id, trace_id)#

Returns health metrics for a specific deeptrace.

Parameters:
  • device_id (str) – The unique ID for the device.

  • trace_id (str) – The unique ID for the deeptrace.

Returns:

The deeptrace health metrics.

Return type:

Box

Examples

Print health metrics for a deeptrace.

>>> metrics = zdx.devices.get_deeptrace_health_metrics('123456789', '987654321')
... print(metrics)
get_deeptrace_top_processes(device_id, trace_id)#

Returns top processes for a specific deeptrace.

Parameters:
  • device_id (str) – The unique ID for the device.

  • trace_id (str) – The unique ID for the deeptrace.

Returns:

The deeptrace top processes.

Return type:

Box

Examples

Print top processes for a deeptrace.

>>> top_processes = zdx.devices.get_deeptrace_top_processes('123456789', '987654321')
... print(top_processes)
get_deeptrace_webprobe_metrics(device_id, trace_id)#

Returns web probe metrics for a specific deeptrace.

Parameters:
  • device_id (str) – The unique ID for the device.

  • trace_id (str) – The unique ID for the deeptrace.

Returns:

The deeptrace web probe metrics.

Return type:

Box

Examples

Print web probe metrics for a deeptrace.

>>> metrics = zdx.devices.get_deeptrace_webprobe_metrics('123456789', '987654321')
... print(metrics)
get_device(device_id, **kwargs)#

Returns a single device in ZDX.

Parameters:

device_id (str) – The unique ID for the device.

Keyword Arguments:

since (int) – The number of hours to look back for devices.

Returns:

The ZDX device resource record.

Return type:

Box

Examples

Get information for the device with an ID of 123456789. >>> device = zdx.devices.get_device(‘123456789’)

Get information for the device with an ID of 123456789 for the last 24 hours. >>> device = zdx.devices.get_device(‘123456789’, since=24)

get_device_app(device_id, app_id)#

Returns a single application for a device.

Parameters:
  • device_id (str) – The unique ID for the device.

  • app_id (str) – The unique ID for the application.

Returns:

The application resource record.

Return type:

Box

Examples

Print a single application for a device.

>>> app = zdx.devices.get_device_app('123456789', '987654321')
... print(app)
get_device_apps(device_id, **kwargs)#

Returns a list of all active applications for a device.

Parameters:

device_id (str) – The unique ID for the device.

Keyword Arguments:

since (int) – The number of hours to look back for devices.

Returns:

The list of active applications for the device.

Return type:

BoxList

Examples

Print a list of active applications for a device.

>>> for app in zdx.devices.get_device_apps('123456789'):
...     print(app)

Print a list of active applications for a device for the last 24 hours.

>>> for app in zdx.devices.get_device_apps('123456789', since=24):
...     print(app)
get_events(device_id)#

Returns a list of all events for a specific device.

Parameters:

device_id (str) – The unique ID for the device.

Returns:

The list of events for the device.

Return type:

BoxList

Examples

Print a list of events for a device.

>>> for event in zdx.devices.get_events('123456789'):
...     print(event)
get_health_metrics(device_id, **kwargs)#

Returns health metrics trend for a specific device.

Parameters:

device_id (str) – The unique ID for the device.

Keyword Arguments:

since (int) – The number of hours to look back for devices.

Returns:

The health metrics resource record.

Return type:

Box

Examples

Print health metrics for an application.

>>> metrics = zdx.devices.get_health_metrics('123456789')
... print(metrics)
get_web_probe(device_id, app_id, probe_id, **kwargs)#

Returns a single web probe for a specific application being used by a device.

Parameters:
  • device_id (str) – The unique ID for the device.

  • app_id (str) – The unique ID for the application.

  • probe_id (str) – The unique ID for the web probe.

Keyword Arguments:

since (int) – The number of hours to look back for devices.

Returns:

The web probe resource record.

Return type:

Box

Examples

Print a single web probe for an application.

>>> probe = zdx.devices.get_web_probe('123456789', '987654321', '123987456')
... print(probe)
get_web_probes(device_id, app_id)#

Returns a list of all active web probes for a specific application being used by a device.

Parameters:
  • device_id (str) – The unique ID for the device.

  • app_id (str) – The unique ID for the application.

Returns:

The list of web probes for the application.

Return type:

BoxList

Examples

Print a list of web probes for an application.

>>> for probe in zdx.devices.get_device_app_webprobes('123456789', '987654321'):
...     print(probe)
list_cloudpath_probes(device_id, app_id, **kwargs)#

Returns a list of all active cloudpath probes for a specific application being used by a device.

Parameters:
  • device_id (str) – The unique ID for the device.

  • app_id (str) – The unique ID for the application.

Keyword Arguments:

since (int) – The number of hours to look back for devices.

Returns:

The list of cloudpath probes for the application.

Return type:

BoxList

Examples

Print a list of cloudpath probes for an application.

>>> for probe in zdx.devices.list_cloudpath_probes('123456789', '987654321'):
...     print(probe)
list_deeptraces(device_id)#

Returns a list of all deep traces for a specific device.

Parameters:

device_id (str) – The unique ID for the device.

Returns:

The list of deep traces for the device.

Return type:

BoxList

Examples

Print a list of deep traces for a device.

>>> for trace in zdx.devices.list_deep_traces('123456789'):
...     print(trace)
list_devices(**kwargs)#

Returns a list of all devices in ZDX.

Keyword Arguments:
  • since (int) – The number of hours to look back for devices.

  • location_id (str) – The unique ID for the location.

  • department_id (str) – The unique ID for the department.

  • geo_id (str) – The unique ID for the geolocation.

Returns:

The list of devices in ZDX.

Return type:

BoxList

Examples

List all devices in ZDX for the past 2 hours:

>>> for device in zdx.devices.list_devices():

List all devices in ZDX for the past 24 hours:

>>> for device in zdx.devices.list_devices(since=24):
start_deeptrace(device_id, app_id, session_name, **kwargs)#

Starts a deep trace for a specific device and application.

Parameters:
  • device_id (str) – The unique ID for the device.

  • app_id (str) – The unique ID for the application.

  • session_name (str) – The name of the deeptrace session.

Keyword Arguments:
  • web_probe_id (str) – The unique ID for the Web probe.

  • cloudpath_probe_id (str) – The unique ID for the Cloudpath probe.

  • session_length_minutes (int) – The duration of the deeptrace session in minutes. Defaults to 5.

  • probe_device (bool) – Whether to probe the device.

Returns:

The deeptrace resource record.

Return type:

Box

Examples

Start a deeptrace for a device.

>>> trace = zdx.devices.start_deeptrace(device_id='123456789', app_id='1', session_name='My Deeptrace')
... print(trace)