Execute a scraping pipeline.
(pipeline_id: str)
| 79 | |
| 80 | @router.post("/{pipeline_id}/run") |
| 81 | async def run_pipeline(pipeline_id: str): |
| 82 | """Execute a scraping pipeline.""" |
| 83 | if pipeline_id not in pipelines_store: |
| 84 | raise HTTPException(status_code=404, detail="Pipeline not found") |
| 85 | |
| 86 | pipeline = pipelines_store[pipeline_id] |
| 87 | |
| 88 | if not pipeline.urls: |
| 89 | raise HTTPException(status_code=400, detail="No URLs defined in pipeline") |
| 90 | |
| 91 | if not pipeline.schema: |
| 92 | raise HTTPException(status_code=400, detail="No schema defined in pipeline") |
| 93 | |
| 94 | # TODO: Execute scraping through the agent |
| 95 | pipeline.status = "running" |
| 96 | |
| 97 | return { |
| 98 | "pipeline_id": pipeline_id, |
| 99 | "status": "running", |
| 100 | "message": "Pipeline execution started" |
| 101 | } |
| 102 | |
| 103 | @router.get("/{pipeline_id}/status") |
| 104 | async def get_pipeline_status(pipeline_id: str): |
nothing calls this directly
no outgoing calls
no test coverage detected