abilian_cdn.client¶
The CLI drives this HTTP client. A script can call it directly and skip the subprocess.
abilian_cdn.client ¶
The client side: talking to a CDN from a terminal or a CI job.
Separate from the server modules on purpose — nothing here imports the
database or the object store, so cdn put works on a laptop that has neither.
ClientError ¶
Bases: RuntimeError
The server refused, and this says what it said.
Credentials
dataclass
¶
Where to talk, and what to say who we are.
load
classmethod
¶
load(path: Path = CONFIG_PATH) -> Credentials
Read the environment first, then the config file.
The environment wins so a CI job can hold its token in a secret rather than in a file it would have to write first.
Client ¶
The handful of calls the command line makes.
list_objects ¶
Every object under a prefix, following the server's paging.
A generator, so ls on a zone with a million objects prints the
first page while the rest is still arriving.
put_file ¶
Upload one file, streamed rather than read into memory.
sign ¶
Ask the service for a URL that serves this object without a token.