sim_analytics

The following methods allow for interaction with the ZCell SIM Analytics API endpoints. Includes SIM analytics map, summary, and usage breakdowns by country, day, and SIM.

Methods are accessible via zcell.sim_analytics

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 SimAnalyticsAPI

Bases: APIClient

list_sim_analytics_map(id=None, query_params=None, **kwargs)

Returns dashboard lat/lng details summary.

Parameters:
  • id (str) – Optional. The ZCell customer ID. Defaults to the zcellCustomerId config value or the ZCELL_CUSTOMER_ID environment variable when omitted.

  • **kwargs – Request body fields.

  • query_params (dict) – Map of query parameters for the request.

Returns:

(result, Response, error)

Return type:

tuple

The returned response supports resp.search(<jmespath>) for client-side filtering/projection of the current page.

Examples

>>> results, response, error = client.zcell.sim_analytics.list_sim_analytics_map(id='...')
>>> if error:
...     print(f"Error: {error}")
...     return
>>> for item in results:
...     print(item.as_dict())
list_sim_analytics_summary(id=None, query_params=None)

Returns sim status summary.

Parameters:
  • id (str) – Optional. The ZCell customer ID. Defaults to the zcellCustomerId config value or the ZCELL_CUSTOMER_ID environment variable when omitted.

  • query_params (dict) – Map of query parameters for the request.

Returns:

(result, Response, error)

Return type:

tuple

The returned response supports resp.search(<jmespath>) for client-side filtering/projection of the current page.

Examples

>>> results, response, error = client.zcell.sim_analytics.list_sim_analytics_summary(id='...')
>>> if error:
...     print(f"Error: {error}")
...     return
>>> for item in results:
...     print(item.as_dict())
list_sim_analytics_usage_countries(id=None, start_date=None, end_date=None, query_params=None)

Returns top countries by usage.

This endpoint uses startDate / endDate (epoch seconds) for the time window — not the startDateTime / endDateTime used by most other ZCell endpoints. The days shorthand fills both accordingly.

Parameters:
  • id (str) – Optional. The ZCell customer ID. Defaults to the zcellCustomerId config value or the ZCELL_CUSTOMER_ID environment variable when omitted.

  • start_date (int) – Window start as epoch seconds. Required unless days is supplied.

  • end_date (int) – Window end as epoch seconds. Required unless days is supplied.

  • days (int) – Convenience shorthand — sets a [now - days, now] start_date/end_date epoch-seconds window.

  • query_params (dict) – Map of query parameters for the request. [query_params.start_date] {int}: Required [query_params.end_date] {int}: Required [query_params.limit] {int}: Page size (<= 20). Default: 10

Returns:

(result, Response, error)

Return type:

tuple

The returned response supports resp.search(<jmespath>) for client-side filtering/projection of the current page.

Examples

>>> results, response, error = client.zcell.sim_analytics.list_sim_analytics_usage_countries(
...     id='gi754cvqb07r0',
...     days=14
... )
>>> if error:
...     print(f"Error: {error}")
...     return
>>> for item in results:
...     print(item.as_dict())
list_sim_analytics_usage_day(id=None, start_date=None, end_date=None, query_params=None)

Returns data usage in given date range.

This endpoint uses startDate / endDate (epoch seconds) for the time window — not the startDateTime / endDateTime used by most other ZCell endpoints. The days shorthand fills both accordingly.

Parameters:
  • id (str) – Optional. The ZCell customer ID. Defaults to the zcellCustomerId config value or the ZCELL_CUSTOMER_ID environment variable when omitted.

  • start_date (int) – Window start as epoch seconds. Required unless days is supplied.

  • end_date (int) – Window end as epoch seconds. Required unless days is supplied.

  • days (int) – Convenience shorthand — sets a [now - days, now] start_date/end_date epoch-seconds window.

  • query_params (dict) – Map of query parameters for the request. [query_params.start_date] {int}: Required [query_params.end_date] {int}: Required [query_params.icc_id] {str}

Returns:

(result, Response, error)

Return type:

tuple

The returned response supports resp.search(<jmespath>) for client-side filtering/projection of the current page.

Examples

>>> results, response, error = client.zcell.sim_analytics.list_sim_analytics_usage_day(id='...')
>>> if error:
...     print(f"Error: {error}")
...     return
>>> for item in results:
...     print(item.as_dict())
list_sim_analytics_usage_sims(id=None, start_date=None, end_date=None, query_params=None)

Returns top sim by usage.

Parameters:
  • id (str) – Optional. The ZCell customer ID. Defaults to the zcellCustomerId config value or the ZCELL_CUSTOMER_ID environment variable when omitted.

  • query_params (dict) – Map of query parameters for the request. [query_params.start_date] {int}: Required [query_params.end_date] {int}: Required [query_params.limit] {int}

Returns:

(result, Response, error)

Return type:

tuple

The returned response supports resp.search(<jmespath>) for client-side filtering/projection of the current page.

Examples

>>> results, response, error = client.zcell.sim_analytics.list_sim_analytics_usage_sims(id='...')
>>> if error:
...     print(f"Error: {error}")
...     return
>>> for item in results:
...     print(item.as_dict())