Skip to content

Commit

Permalink
updated tokenized endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
khoroshevskyi committed May 28, 2024
1 parent 7fd684d commit af3bfa9
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion bedhost/routers/bed_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
BedClassification,
BedPEPHub,
BedListSearchResult,
UniverseMetadata,
TokenizedPathResponse,
TokenizedBedResponse,
)
from bbconf.exceptions import BEDFileNotFoundError, TokenizeFileNotExistError
Expand Down Expand Up @@ -331,3 +331,26 @@ async def get_tokens(
status_code=404,
detail="Tokenized file not found",
)


@router.get(
"/{bed_id}/tokens/{universe_id}/info",
summary="Get link to tokenized bed file",
response_model=TokenizedPathResponse,
)
async def get_tokens(
bed_id: str,
universe_id: str,
):
"""
Return link to tokenized bed file
Example: bed: 0dcdf8986a72a3d85805bbc9493a1302 | universe: 58dee1672b7e581c8e1312bd4ca6b3c7
"""
try:
return bbagent.bed.get_tokenized_link(bed_id, universe_id)

except TokenizeFileNotExistError as _:
raise HTTPException(
status_code=404,
detail="Tokenized file not found",
)

0 comments on commit af3bfa9

Please sign in to comment.