US07-06: Validate Performance and Resource Bounds (#93)
This commit was merged in pull request #93.
This commit is contained in:
@@ -11,7 +11,13 @@ from fastapi import APIRouter, Query, Request
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
from photo_pipeline.schemas import DecisionRequest
|
||||
from photo_pipeline.services.duplicates import ConflictError, DuplicateError, DuplicateService
|
||||
from photo_pipeline.services.duplicates import (
|
||||
MAX_MEMBER_PAGE,
|
||||
MEMBER_PAGE,
|
||||
ConflictError,
|
||||
DuplicateError,
|
||||
DuplicateService,
|
||||
)
|
||||
|
||||
router = APIRouter(tags=["duplicates"])
|
||||
|
||||
@@ -42,8 +48,13 @@ def list_clusters(
|
||||
|
||||
|
||||
@router.get("/duplicates/clusters/{cluster_id}")
|
||||
def get_cluster(cluster_id: str, request: Request):
|
||||
detail = _service(request).get_cluster(cluster_id)
|
||||
def get_cluster(
|
||||
cluster_id: str,
|
||||
request: Request,
|
||||
limit: int = Query(MEMBER_PAGE, ge=1, le=MAX_MEMBER_PAGE),
|
||||
offset: int = Query(0, ge=0),
|
||||
):
|
||||
detail = _service(request).get_cluster(cluster_id, limit=limit, offset=offset)
|
||||
if detail is None:
|
||||
return _error(404, "not_found", f"unknown cluster {cluster_id}")
|
||||
return detail
|
||||
|
||||
Reference in New Issue
Block a user