audit_logs¶
The following methods allow for interaction with the ZIA Audit Logs API endpoints.
Methods are accessible via zia.audit_logs
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 AuditLogsAPI¶
Bases:
APIClientA Client object for Audit Logs resource.
- cancel()¶
Cancels the request to create an audit log report.
- Returns:
The operation response code.
- Return type:
Examples
>>> zia.audit_logs.cancel()
- create(start_time, end_time)¶
Creates an audit log report for the specified time period and saves it as a CSV file.
- Parameters:
- Returns:
The status code for the operation.
- Return type:
Examples
>>> zia.audit_logs.create(start_time='1627221600000', end_time='1627271676622')
- get_report()¶
Returns the most recently created audit log report.
- Returns:
String representation of CSV file.
- Return type:
Examples
Write report to CSV file:
>>> with open("audit_log.csv", "w+") as fh: ... fh.write(zia.audit_logs.get_report())