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 BackgroundTasks to process the CompileRequest.

Parameters:
Return type:

starlette.responses.RedirectResponse

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 BackgroundTasks to enrich all nodes in the CompileRequest.

Parameters:
Return type:

starlette.responses.RedirectResponse

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:

str | starlette.responses.JSONResponse

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:
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:

starlette.responses.JSONResponse

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.

Parameters:

engine (Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)])

Return type:

list[uuid.UUID]

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:

starlette.responses.Response

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.

Parameters:

engine (Annotated[sqlalchemy.ext.asyncio.AsyncEngine, Depends(get_db_engine)])

Return type:

list[uuid.UUID]

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:

starlette.responses.Response

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:
Return type:

starlette.responses.Response

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:
Return type:

starlette.responses.Response

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:
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:
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:

str | starlette.responses.JSONResponse

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:
Return type:

starlette.responses.JSONResponse

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:
Return type:

str | starlette.responses.JSONResponse