Skip to content

Commit

Permalink
get assets info endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
nrjadkry committed Sep 23, 2024
1 parent 7a2fc70 commit 9e81978
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/backend/app/projects/project_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,20 @@ async def process_imagery(
):
background_tasks.add_task(project_logic.process_drone_images, project.id, task_id)
return {"message": "Processing started"}


@router.get(
"/assets/{project_id}/{task_id}/",
tags=["Image Processing"],
response_model=project_schemas.AssetsInfo,
)
async def get_assets_info(
project: Annotated[
project_schemas.DbProject, Depends(project_deps.get_project_by_id)
],
task_id: uuid.UUID,
):
"""
Endpoint to get the number of images and the URL to download the assets for a given project and task.
"""
return await project_logic.get_project_info_from_s3(project.id, task_id)
7 changes: 7 additions & 0 deletions src/backend/app/projects/project_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,3 +457,10 @@ class PresignedUrlRequest(BaseModel):
task_id: uuid.UUID
image_name: List[str]
expiry: int # Expiry time in hours


class AssetsInfo(BaseModel):
project_id: str
task_id: str
image_count: int
assets_url: Optional[str]

0 comments on commit 9e81978

Please sign in to comment.