refactor: added async await to ONTAP call

This commit is contained in:
Magel, Denis
2025-09-18 13:39:22 +02:00
parent e8efde9892
commit fc71950039
4 changed files with 33 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
# contains the router for the aggregates endpoint
from fastapi import APIRouter, Query
from fastapi import APIRouter, Query, Request
from typing import List
from .aggregate_schema import AggregateSchema, MetricEnum
from .aggregate_service import get_aggregates
@@ -10,6 +10,7 @@ router = APIRouter(tags=["aggregates"])
@router.get("/aggregates", response_model=List[AggregateSchema])
async def aggregates_endpoint(
request: Request,
metric: MetricEnum = Query(MetricEnum.relative, description="Metric type"),
):
return await get_aggregates(metric)
return await get_aggregates(request, metric)