17 lines
476 B
Python
17 lines
476 B
Python
from __future__ import annotations
|
|
|
|
from fastapi import APIRouter, Depends
|
|
|
|
from app.models.sources import BackrestSnapshot
|
|
from app.services.aggregator import AggregatorService, get_aggregator_service
|
|
|
|
|
|
router = APIRouter(prefix="/api", tags=["backrest"])
|
|
|
|
|
|
@router.get("/backrest", response_model=BackrestSnapshot)
|
|
async def get_backrest(
|
|
aggregator: AggregatorService = Depends(get_aggregator_service),
|
|
) -> BackrestSnapshot:
|
|
return await aggregator.get_backrest()
|