apps#

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

Methods are accessible via zdx.apps

class AppsAPI#
get_app(app_id, **kwargs)#

Returns information on the specified application configured within the ZDX tenant.

Parameters:

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

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 application information.

Return type:

Box

Examples

Return information on the application with the ID of 999999999:

>>> zia.apps.get_app(app_id='999999999')
get_app_metrics(app_id, **kwargs)#

Returns the ZDX metrics for the specified application configured within the ZDX tenant.

Parameters:

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

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.

  • metric_name (str) – The name of the metric to return. Available values are: * pft - Page Fetch Time * dns - DNS Time * availability

Returns:

The application’s ZDX metrics.

Return type:

Box

Examples

Return the ZDX metrics for the application with the ID of 999999999:

>>> zia.apps.get_app_metrics(app_id='999999999')

Return the ZDX metrics for the app with an ID of 999999999 for the last 24 hours, including dns matrics, geolocation, department and location IDs:

>>> zia.apps.get_app_metrics(app_id='999999999', since=24, metric_name='dns', location_id='888888888',
...                          geo_id='777777777', department_id='666666666')
get_app_score(app_id, **kwargs)#

Returns the ZDX score trend for the specified application configured within the ZDX tenant.

Parameters:

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

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 application’s ZDX score trend.

Return type:

Box

Examples

Return the ZDX score trend for the application with the ID of 999999999:

>>> zia.apps.get_app_score(app_id='999999999')
get_app_user(app_id, user_id, **kwargs)#

Returns information on the specified user and device that was used to access the specified application configured within the ZDX tenant.

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

  • user_id (str) – The unique ID for the ZDX user.

Keyword Arguments:

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

Returns:

The user and device information.

Return type:

Box

Examples

Return information on the user with the ID of 999999999 who has accessed the application with the ID of 888888888:

>>> zia.apps.get_app_user(app_id='888888888', user_id='999999999')
list_app_users(app_id, **kwargs)#

Returns a list of users and devices that were used to access the specified application configured within the ZDX tenant.

Parameters:

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

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.

  • score_bucket (str) – The ZDX score bucket to filter by. Available values are: * poor - 0-33 * okay - 34-65 * good - 66-100

Returns:

The list of users and devices used to access the application.

Return type:

BoxList

Examples

Return a list of users and devices who have accessed the application with the ID of 999999999:

>>> for user in zia.apps.get_app_users(app_id='999999999'):
...     print(user)
list_apps(**kwargs)#

Returns a list of all active applications configured within the ZDX tenant.

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 applications in ZDX.

Return type:

BoxList

Examples

List all applications in ZDX for the past 2 hours:

>>> for app in zdx.apps.list_apps():
...     print(app)