first content-indexing slice
This commit is contained in:
parent
9cd700b215
commit
6416139176
12 changed files with 404 additions and 0 deletions
|
|
@ -464,6 +464,36 @@ def list_observed_facts(
|
|||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
|
||||
|
||||
@app.get("/repos/{repository_id}/content-chunks")
|
||||
def list_content_chunks(
|
||||
repository_id: int,
|
||||
analysis_run_id: int | None = None,
|
||||
service: RegistryService = Depends(get_service),
|
||||
) -> list[dict[str, object]]:
|
||||
try:
|
||||
return [
|
||||
asdict(chunk)
|
||||
for chunk in service.list_content_chunks(repository_id, analysis_run_id)
|
||||
]
|
||||
except NotFoundError as exc:
|
||||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
|
||||
|
||||
@app.get("/repos/{repository_id}/analysis-runs/{analysis_run_id}/content-chunks")
|
||||
def list_analysis_run_content_chunks(
|
||||
repository_id: int,
|
||||
analysis_run_id: int,
|
||||
service: RegistryService = Depends(get_service),
|
||||
) -> list[dict[str, object]]:
|
||||
try:
|
||||
return [
|
||||
asdict(chunk)
|
||||
for chunk in service.list_content_chunks(repository_id, analysis_run_id)
|
||||
]
|
||||
except NotFoundError as exc:
|
||||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
|
||||
|
||||
@app.get("/repos/{repository_id}/analysis-runs/{analysis_run_id}/candidate-graph")
|
||||
def get_candidate_graph(
|
||||
repository_id: int,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue