This script provides a basic CLI for taking snapshots of all zones within an UltraDNS account. Additionally, there's functionality to restore zones to their most recent snapshots.
- Snapshot All Zones: Quickly generate snapshots for all zones in the UltraDNS account.
- Restore Zones from Snapshots: Restore all zones to their most recent snapshot.
- Selective Zone Processing: Specify a file to process only a subset of zones.
- Python 3.x
- Libraries:
requests(should be automatically installed withultra_auth)tqdmultra_auth
-
Clone the repository:
git clone https://github.com/sbarbett/udns_snapshot.git -
Navigate to the directory:
cd udns_snapshot -
Make sure the script is executable:
chmod +x src/snapshot.py -
Run the script:
./src/snapshot.py [options]Options include:
-
Authentication:
-uor--username: Username for authentication.-por--password: Password for authentication.-tor--token: Directly pass the Bearer token.-ror--refresh-token: Pass the Refresh token (optional with --token).
-
Actions:
-sor--restore: Restore zones to their most recent snapshot.-lor--log-file: Specify the log file name (default isoutput.log).-dor--download: Download a zip file with all existing snapshots.-zor--zones-file: Specify a file with a list of zones to process.-aor--all-zones: Process every zone in an account (use with caution).
-
- It's essential to use this script with caution, especially the restore functionality, as it's a destructive action that can't be undone.
- By default, the script writes logs to
output.log. You can change this with the-loption.