Marriott CDN Team Fastpurge POC script
Project description
akamai-purge-cache : interactive python script
Python Script
from fastpurge import FastPurgeClient
import click
@click.command()
@click.option('paths', '--path', '-p', multiple=True, help="A single URL to Purge (This option is repeatable for additional URLs)")
@click.option('--dryrun', '-d', is_flag=True, help="Just print the command and args that will be run and exit")
def mgpurge(paths: list[str], dryrun: bool):
# Omit credentials to read from ~/.edgerc
client = FastPurgeClient()
if dryrun:
print('These paths will be purged:')
for path in paths:
click.echo(path)
else:
# Start purge of some URLs
mgpurge = client.purge_by_url(paths)
# purge is a Future, if we want to ensure purge completed
# we can block on the result:
result = mgpurge.result()
# print("Purge completed:")
print("Purge completed:", result)
if __name__ == "__main__":
mgpurge()
TO-DO
- Document local installation
- Document local run
- Document building
- Document publishing to PY-Pi
- Document remote installation and usage
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for akamai_purge_cache-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8327f1bf3fc73b756f1ed11201c9373777a3a2f3ff6e8fdc4301921e2fda4d35 |
|
MD5 | 9294c53aaa38a1995442e2ba614233f0 |
|
BLAKE2b-256 | 6d82b2d3631e6b16ecc62b97f1851d1ce99d309a1962595e4b1eb6b26acd441e |