app.main
All fastapi endpoints available.
Module Contents
- async app.main.post_compile(processor: Annotated[app.processing.MergingProcessor, Depends(MergingProcessor.from_compile_request)], background_tasks: fastapi.BackgroundTasks, settings: Annotated[app.config.Settings, Depends(get_settings)], engine: Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)]) starlette.responses.RedirectResponse
Enqueue a
BackgroundTasks
to process theCompileRequest
.- Parameters:
processor (Annotated[app.processing.MergingProcessor, Depends(MergingProcessor.from_compile_request)])
background_tasks (fastapi.BackgroundTasks)
settings (Annotated[app.config.Settings, Depends(get_settings)])
engine (Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)])
- Return type:
- async app.main.post_enrich(processor: Annotated[app.processing.EnrichingProcessor, Depends(EnrichingProcessor.from_compile_request)], background_tasks: fastapi.BackgroundTasks, settings: Annotated[app.config.Settings, Depends(get_settings)], engine: Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)]) starlette.responses.RedirectResponse
Enqueue a
BackgroundTasks
to enrich all nodes in theCompileRequest
.- Parameters:
processor (Annotated[app.processing.EnrichingProcessor, Depends(EnrichingProcessor.from_compile_request)])
background_tasks (fastapi.BackgroundTasks)
settings (Annotated[app.config.Settings, Depends(get_settings)])
engine (Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)])
- Return type:
- async app.main.post_insert(inserter: Annotated[app.processing.EnrichmentInserter, Depends(EnrichmentInserter.from_insert_request)]) str | starlette.responses.JSONResponse
Insert enrichments via
InsertRequest
.- Parameters:
inserter (Annotated[app.processing.EnrichmentInserter, Depends(EnrichmentInserter.from_insert_request)])
- Return type:
- async app.main.get_status(uuid: uuid.UUID, engine: Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)]) app.model.StatusResponse.StatusResponse
Fetch status of a compile request.
- Raises:
HTTPException – (Status 404) If no compile request with uuid is found
- Parameters:
uuid (uuid.UUID)
engine (Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)])
- Return type:
app.model.StatusResponse.StatusResponse
- async app.main.get_result(uuid: uuid.UUID, engine: Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)]) starlette.responses.PlainTextResponse | starlette.responses.JSONResponse
Fetch result of a compile request.
- Raises:
HTTPException – (Status 404) If no compile request with uuid is found
- Parameters:
uuid (uuid.UUID)
engine (Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)])
- Return type:
starlette.responses.PlainTextResponse | starlette.responses.JSONResponse
- async app.main.process_compile_request(uuid: uuid.UUID, createdAt: datetime.datetime, processor: app.processing.MergingProcessor, settings: app.config.Settings, engine: sqlalchemy.ext.asyncio.AsyncEngine) None
Process the
CompileRequest
.- Parameters:
uuid (uuid.UUID) – ID of the compile request
processor (app.processing.MergingProcessor) – Processor for this request
settings (app.config.Settings) – Settings from .env file
engine (sqlalchemy.ext.asyncio.AsyncEngine) – Database engine to use
createdAt (datetime.datetime)
- Return type:
None
- async app.main.process_enrich_request(uuid: uuid.UUID, createdAt: datetime.datetime, processor: app.processing.EnrichingProcessor, settings: app.config.Settings, engine: sqlalchemy.ext.asyncio.AsyncEngine) None
Enrich all nodes in the
CompileRequest
.- Parameters:
uuid (uuid.UUID) – ID of the compile request
processor (app.processing.EnrichingProcessor) – Processor for this request
settings (app.config.Settings) – Settings from .env file
engine (sqlalchemy.ext.asyncio.AsyncEngine) – Database engine to use
createdAt (datetime.datetime)
- Return type:
None
- async app.main.post_debug_compile(processor: Annotated[app.processing.MergingProcessor, Depends(MergingProcessor.from_compile_request)]) str | starlette.responses.JSONResponse
Compiles the request to an openqasm3 program in one request. No redirects and no polling of different endpoints needed.
This endpoint should only be used for debugging purposes.
- Parameters:
processor (Annotated[app.processing.MergingProcessor, Depends(MergingProcessor.from_compile_request)])
- Return type:
- async app.main.post_debug_enrich(processor: Annotated[app.processing.EnrichingProcessor, Depends(EnrichingProcessor.from_compile_request)]) list[app.model.CompileRequest.ImplementationNode] | starlette.responses.JSONResponse
Enriches all nodes in the compile request in one request. No redirects and no polling of different endpoints needed.
This endpoint should only be used for debugging purposes.
- Parameters:
processor (Annotated[app.processing.EnrichingProcessor, Depends(EnrichingProcessor.from_compile_request)])
- Return type:
list[app.model.CompileRequest.ImplementationNode] | starlette.responses.JSONResponse