network_events¶
The following methods allow for interaction with the ZCell Network Events API endpoints. Includes searching network events for a customer with filtering and pagination.
Methods are accessible via zcell.network_events
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 NetworkEventsAPI¶
Bases:
APIClient- list_network_events_search(id=None, start_time=None, end_time=None, **kwargs)¶
Searches for network events for a given customer with filtering and pagination.
The time window (
startTime/endTime, epoch seconds) is supplied as path parameters, while the filter and pagination options are sent as a flat JSON request body. Thedaysshorthand fillsstart_time/end_timewith a[now - days, now]window.- Parameters:
id (str) – Optional. The ZCell customer ID. Defaults to the
zcellCustomerIdconfig value or theZCELL_CUSTOMER_IDenvironment variable when omitted.start_time (int) – Path parameter. Window start as epoch seconds. Required unless
daysis supplied.end_time (int) – Path parameter. Window end as epoch seconds. Required unless
daysis supplied.days (int) – Convenience shorthand — sets a [now - days, now] start_time/end_time epoch-seconds path window.
**kwargs – Request body fields (flat):
[sort_by]{dict}: Sort object, e.g.{"name": "DESC"}(SortDirectionEnum: ASC, DESC).[filter_by]{list[dict]}: List of filters, each withfilterName(str),operator(str: EQ, NE, LIKE, NOT_LIKE), andvalues(list[str]).[exclude_apn_config]{bool}: Whether to exclude APN config.[page]{int}: Page number (>= 0).[size]{int}: Page size (1-100).
- Returns:
(result, Response, error)
- Return type:
The returned response supports
resp.search(<jmespath>)for client-side filtering/projection of the current page.Examples
Search network events over the last 7 days with a filter:
>>> results, _, error = client.zcell.network_events.list_network_events_search( ... id='gi754cvqb07r0', ... days=7, ... filter_by=[{'filterName': 'country', 'operator': 'EQ', 'values': ['US']}], ... page=0, ... size=10, ... ) >>> if error: ... print(f"Error: {error}") ... return >>> for item in results: ... print(item.as_dict())
Provide an explicit path window instead of the
daysshorthand:>>> results, _, error = client.zcell.network_events.list_network_events_search( ... id='gi754cvqb07r0', ... start_time=1781296768, ... end_time=1782506368, ... sort_by={'name': 'DESC'}, ... )