app.main
All fastapi endpoints available.
Module Contents
- async app.main.post_compile(processor: Annotated[app.transformation_manager.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
BackgroundTasksto process theCompileRequest.- Parameters:
processor (Annotated[app.transformation_manager.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.transformation_manager.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
BackgroundTasksto enrich all nodes in theCompileRequest.- Parameters:
processor (Annotated[app.transformation_manager.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.transformation_manager.EnrichmentInserter, Depends(EnrichmentInserter.from_insert_request)]) str | starlette.responses.JSONResponse
Insert enrichments via
InsertRequest.- Parameters:
inserter (Annotated[app.transformation_manager.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(engine: Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)], uuid: uuid.UUID | None = None, status: app.model.StatusResponse.StatusType | None = None) starlette.responses.PlainTextResponse | starlette.responses.JSONResponse
Fetch all results metadata or a specific result if a UUID is provided.
- Parameters:
engine (Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)])
uuid (uuid.UUID | None)
status (app.model.StatusResponse.StatusType | None)
- Return type:
starlette.responses.PlainTextResponse | starlette.responses.JSONResponse
- async app.main.get_result_by_path(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 by UUID path parameter.
- 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.get_request_payload(uuid: uuid.UUID, engine: Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)]) starlette.responses.JSONResponse
Fetch the original compile request payload associated with a UUID.
- Parameters:
uuid (uuid.UUID)
engine (Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)])
- Return type:
- async app.main.list_qrms(engine: Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)]) list[uuid.UUID]
Return all UUIDs that currently have stored Quantum Resource Models.
- async app.main.get_qrms_payload(uuid: uuid.UUID, engine: Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)]) starlette.responses.Response
Fetch the Quantum Resource Models file associated with a UUID.
- Parameters:
uuid (uuid.UUID)
engine (Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)])
- Return type:
- async app.main.list_service_deployment_models(engine: Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)]) list[uuid.UUID]
Return all UUIDs that currently have stored service deployment models.
- async app.main.get_service_deployment_models_payload(uuid: uuid.UUID, engine: Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)]) starlette.responses.Response
Fetch the Service Deployment Models file associated with a UUID.
- Parameters:
uuid (uuid.UUID)
engine (Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)])
- Return type:
- async app.main.put_qrms_payload(uuid: uuid.UUID, engine: Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)], file: fastapi.UploadFile = File(...)) starlette.responses.Response
Store or update the Quantum Resource Models file for the given UUID.
- Parameters:
uuid (uuid.UUID)
engine (Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)])
file (fastapi.UploadFile)
- Return type:
- async app.main.put_service_deployment_models_payload(uuid: uuid.UUID, engine: Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)], file: fastapi.UploadFile = File(...)) starlette.responses.Response
Store or update the Service Deployment Models file for the given UUID.
- Parameters:
uuid (uuid.UUID)
engine (Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)])
file (fastapi.UploadFile)
- Return type:
- async app.main.process_compile_request(uuid: uuid.UUID, createdAt: datetime.datetime, processor: app.transformation_manager.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.transformation_manager.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.transformation_manager.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.transformation_manager.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.transformation_manager.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.transformation_manager.MergingProcessor, Depends(MergingProcessor.from_compile_request)])
- Return type:
- async app.main.post_debug_workflow(processor: Annotated[app.transformation_manager.MergingProcessor, Depends(MergingProcessor.from_compile_request)], settings: Annotated[app.config.Settings, Depends(get_settings)], engine: Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)]) starlette.responses.JSONResponse
Process a compile request directly into a workflow representation, optionally including QRMs and service deployment models supplied by the client.
This endpoint should only be used for debugging purposes.
- Parameters:
processor (Annotated[app.transformation_manager.MergingProcessor, Depends(MergingProcessor.from_compile_request)])
settings (Annotated[app.config.Settings, Depends(get_settings)])
engine (Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)])
- Return type:
- async app.main.post_debug_enrich(processor: Annotated[app.transformation_manager.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.transformation_manager.EnrichingProcessor, Depends(EnrichingProcessor.from_compile_request)])
- Return type:
list[app.model.CompileRequest.ImplementationNode] | starlette.responses.JSONResponse
- async app.main.post_compileGroup(processor: Annotated[app.transformation_manager.MergingProcessor, Depends(MergingProcessor.from_compile_request)], groupID: int = 0) str | starlette.responses.JSONResponse
Compiles the request to an openqasm3 program for the specified quantum group (groupID) in one request. No redirects and no polling of different endpoints needed.
- Parameters:
processor (Annotated[app.transformation_manager.MergingProcessor, Depends(MergingProcessor.from_compile_request)])
groupID (int)
- Return type: