Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
# #
###############################################################################
+import fastapi
+import uuid
+
from .app import app
+from . import backend
@app.get("/builds/{build_id}")
-async def get(build_id: str):
- return { "GOT" : "HERE" }
+async def get(build_id: uuid.UUID):
+ build = await backend.builds.get_by_uuid(build_id)
+
+ # Raise 404 if the build could not be found
+ if not build:
+ raise fastapi.HTTPException(404, "Build not found")
+
+ return build