From: Michael Tremer Date: Wed, 2 Jul 2025 17:08:58 +0000 (+0000) Subject: api: Add an endpoint to return all mirrors X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1b7aa8975c23f827bd5eaae133f81b9e0afc0d3;p=pbs.git api: Add an endpoint to return all mirrors Signed-off-by: Michael Tremer --- diff --git a/src/api/mirrors.py b/src/api/mirrors.py index e5bf0f37..915d01d4 100644 --- a/src/api/mirrors.py +++ b/src/api/mirrors.py @@ -37,6 +37,10 @@ async def get_mirror_from_path(hostname: str = fastapi.Path(...)) -> Mirror | No """ return await backend.mirrors.get_by_hostname(hostname) +@router.get("") +async def get_mirrors() -> list[Mirror]: + return [mirror async for mirror in backend.mirrors] + @router.get("/{hostname}") async def get_mirror(mirror: Mirror = fastapi.Depends(get_mirror_from_path)) -> Mirror: if not mirror: