snapshot¶
The following methods allow for interaction with the ZDX Snapshot Alert API endpoints.
Methods are accessible via zdx.snapshot
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 SnapshotAPI¶
Bases:
APIClientShare a ZDX Snapshot of alert details for a given alert ID.
- Parameters:
- Keyword Arguments:
expiry (int) – The expiry time in hours (will be converted to Unix epoch) The default is set to 2 hours. To configure, the expiration must be between 2 hours and 90 days
obfuscation (list) – Specifies the fields to obfuscate in ZDX snapshot The possible values are: “USER_NAME”, “LOCATION”, “DEVICE_NAME”, “IP_ADDRESS”, “WIFI_NAME”
- Returns:
- The snapshot resource record containing the following attributes:
id (str): The unique identifier for the snapshot.
name (str): The name of the snapshot.
alert_id (str): The unique ID for the alert associated with the snapshot.
expiry (int): The expiry time in Unix epoch format.
obfuscation (list): List of obfuscation settings applied to the snapshot.
url (str): The URL where the snapshot can be accessed.
status (str): The current status of the snapshot.
- Return type:
Tuple
Examples
Share a ZDX Snapshot of alert
>>> share_snapshot, _, error = client.zdx.snapshot.share_snapshot( ... name="ZDX-Test-Alert-Snapshot", ... alert_id='7473160764821179371', ... expiry=2 ... ) ... if error: ... print(f"Error sharing snapshot: {error}") ... return ... print(f"Snapshot shared successfully: {share_snapshot.as_dict()}")
Share a ZDX Snapshot with obfuscation settings
>>> share_snapshot, _, error = client.zdx.snapshot.share_snapshot( ... name="ZDX-Test-Alert-Snapshot", ... alert_id='7473160764821179371', ... expiry=24, ... obfuscation=["USER_NAME", "IP_ADDRESS"] ... ) ... if error: ... print(f"Error sharing snapshot: {error}") ... return ... print(f"Snapshot shared successfully: {share_snapshot.as_dict()}")