smartem_backend.api_server
#
Members
HTTP endpoint for instruction acknowledgements with database persistence |
|
Agent heartbeat endpoint to update connection health status. |
|
Check database connectivity and basic functionality |
|
Check RabbitMQ connectivity |
|
Close a session using the connection manager |
|
Create a new acquisition |
|
Create a new grid for a specific acquisition |
|
Create a new tile for a specific atlas |
|
Create a new micrograph for a specific foil hole |
|
Create a new atlas for a grid |
|
Create a new grid square for a specific grid |
|
Create a new foil hole for a specific grid square |
|
Create a session using the connection manager |
|
|
|
|
|
Debug endpoint to create test instructions |
|
Debug endpoint to create test sessions |
|
Delete an acquisition |
|
Delete an atlas by publishing to RabbitMQ |
|
Delete an atlas tile by publishing to RabbitMQ |
|
Delete a foil hole by publishing to RabbitMQ |
|
Delete a grid by publishing to RabbitMQ |
|
Delete a grid square by publishing to RabbitMQ |
|
Delete a micrograph by publishing to RabbitMQ |
|
|
|
Get a single acquisition by ID |
|
Get all grids for a specific acquisition |
|
Get all acquisitions |
|
Debug endpoint to view active agent connections |
|
Debug endpoint to view all active sessions |
|
Get a single atlas by ID |
|
Get a single atlas tile by ID |
|
Get all atlas tiles |
|
Get all tiles for a specific atlas |
|
Get all atlases |
|
Get real-time connection and session statistics |
|
|
|
Get a single foil hole by ID |
|
Get all micrographs for a specific foil hole |
|
Get time ordered predictions for all models that provide them for this square |
|
|
Get time ordered predictions for all models that provide them for this square |
Get all foil holes |
|
Get a single grid by ID |
|
Get the atlas for a specific grid |
|
Get a single grid by ID |
|
Get all grid squares for a specific grid |
|
|
|
|
|
Get all grids |
|
Get a single grid square by ID |
|
|
|
Get all foil holes for a specific grid square |
|
Get a single grid square by ID |
|
Get time ordered predictions for all models that provide them for this square |
|
|
|
Get all grid squares |
|
Health check endpoint with actual connectivity checks |
|
|
|
Get a single micrograph by ID |
|
Get all micrographs |
|
Get time series of model weights for grid |
|
|
|
|
|
|
|
|
|
|
|
|
|
Debug endpoint to view instructions for a session |
|
|
|
Get API status and configuration information |
|
|
|
All squares on a grid have been registered at low mag |
|
All holes on a grid square have been registered at square mag |
|
Manage application lifespan events. |
|
Connect a grid square to a tile with its position information |
|
Connect mutliple grid squares to a tile with its position information |
|
|
|
SSE endpoint for streaming instructions to agents for a specific session |
|
Update an acquisition |
|
Update an atlas |
|
Update an atlas tile |
|
Update a foil hole |
|
Update a grid |
|
Update a grid square |
|
Update a micrograph |
|
|
- smartem_backend.api_server.check_database_health()[source]#
Check database connectivity and basic functionality
- smartem_backend.api_server.get_health()[source]#
Health check endpoint with actual connectivity checks
- smartem_backend.api_server.get_acquisitions(db: Session = Depends(get_db))[source]#
Get all acquisitions
- smartem_backend.api_server.create_acquisition(acquisition: AcquisitionCreateRequest, db: Session = Depends(get_db))[source]#
Create a new acquisition
- smartem_backend.api_server.get_acquisition(acquisition_uuid: str, db: Session = Depends(get_db))[source]#
Get a single acquisition by ID
- smartem_backend.api_server.update_acquisition(acquisition_uuid: str, acquisition: AcquisitionUpdateRequest, db: Session = Depends(get_db))[source]#
Update an acquisition
- smartem_backend.api_server.delete_acquisition(acquisition_uuid: str, db: Session = Depends(get_db))[source]#
Delete an acquisition
- smartem_backend.api_server.get_grid(grid_uuid: str, db: Session = Depends(get_db))[source]#
Get a single grid by ID
- smartem_backend.api_server.update_grid(grid_uuid: str, grid: GridUpdateRequest, db: Session = Depends(get_db))[source]#
Update a grid
- smartem_backend.api_server.delete_grid(grid_uuid: str, db: Session = Depends(get_db))[source]#
Delete a grid by publishing to RabbitMQ
- smartem_backend.api_server.get_acquisition_grids(acquisition_uuid: str, db: Session = Depends(get_db))[source]#
Get all grids for a specific acquisition
- smartem_backend.api_server.create_acquisition_grid(acquisition_uuid: str, grid: GridCreateRequest, db: Session = Depends(get_db))[source]#
Create a new grid for a specific acquisition
- smartem_backend.api_server.grid_registered(grid_uuid: str) bool [source]#
All squares on a grid have been registered at low mag
- smartem_backend.api_server.get_atlas(atlas_uuid: str, db: Session = Depends(get_db))[source]#
Get a single atlas by ID
- smartem_backend.api_server.update_atlas(atlas_uuid: str, atlas: AtlasUpdateRequest, db: Session = Depends(get_db))[source]#
Update an atlas
- smartem_backend.api_server.delete_atlas(atlas_uuid: str, db: Session = Depends(get_db))[source]#
Delete an atlas by publishing to RabbitMQ
- smartem_backend.api_server.get_grid_atlas(grid_uuid: str, db: Session = Depends(get_db))[source]#
Get the atlas for a specific grid
- smartem_backend.api_server.create_grid_atlas(grid_uuid: str, atlas: AtlasCreateRequest, db: Session = Depends(get_db))[source]#
Create a new atlas for a grid
- smartem_backend.api_server.get_atlas_tiles(db: Session = Depends(get_db))[source]#
Get all atlas tiles
- smartem_backend.api_server.get_atlas_tile(tile_uuid: str, db: Session = Depends(get_db))[source]#
Get a single atlas tile by ID
- smartem_backend.api_server.update_atlas_tile(tile_uuid: str, tile: AtlasTileUpdateRequest, db: Session = Depends(get_db))[source]#
Update an atlas tile
- smartem_backend.api_server.delete_atlas_tile(tile_uuid: str, db: Session = Depends(get_db))[source]#
Delete an atlas tile by publishing to RabbitMQ
- smartem_backend.api_server.get_atlas_tiles_by_atlas(atlas_uuid: str, db: Session = Depends(get_db))[source]#
Get all tiles for a specific atlas
- smartem_backend.api_server.create_atlas_tile_for_atlas(atlas_uuid: str, tile: AtlasTileCreateRequest, db: Session = Depends(get_db))[source]#
Create a new tile for a specific atlas
- smartem_backend.api_server.link_atlas_tile_to_gridsquare(tile_uuid: str, gridsquare_uuid: str, gridsquare_position: GridSquarePositionRequest, db: Session = Depends(get_db))[source]#
Connect a grid square to a tile with its position information
- smartem_backend.api_server.link_atlas_tile_to_gridsquares(tile_uuid: str, gridsquare_positions: list[GridSquarePositionRequest], db: Session = Depends(get_db))[source]#
Connect mutliple grid squares to a tile with its position information
- smartem_backend.api_server.get_gridsquares(db: Session = Depends(get_db))[source]#
Get all grid squares
- smartem_backend.api_server.get_gridsquare(gridsquare_uuid: str, db: Session = Depends(get_db))[source]#
Get a single grid square by ID
- smartem_backend.api_server.update_gridsquare(gridsquare_uuid: str, gridsquare: GridSquareUpdateRequest, db: Session = Depends(get_db))[source]#
Update a grid square
- smartem_backend.api_server.delete_gridsquare(gridsquare_uuid: str, db: Session = Depends(get_db))[source]#
Delete a grid square by publishing to RabbitMQ
- smartem_backend.api_server.get_grid_gridsquares(grid_uuid: str, db: Session = Depends(get_db))[source]#
Get all grid squares for a specific grid
- smartem_backend.api_server.create_grid_gridsquare(grid_uuid: str, gridsquare: GridSquareCreateRequest, db: Session = Depends(get_db))[source]#
Create a new grid square for a specific grid
- smartem_backend.api_server.gridsquare_registered(gridsquare_uuid: str, count: int | None = None, db: Session = Depends(get_db)) bool [source]#
All holes on a grid square have been registered at square mag
- smartem_backend.api_server.get_foilhole(foilhole_uuid: str, db: Session = Depends(get_db))[source]#
Get a single foil hole by ID
- smartem_backend.api_server.update_foilhole(foilhole_uuid: str, foilhole: FoilHoleUpdateRequest, db: Session = Depends(get_db))[source]#
Update a foil hole
- smartem_backend.api_server.delete_foilhole(foilhole_uuid: str, db: Session = Depends(get_db))[source]#
Delete a foil hole by publishing to RabbitMQ
- smartem_backend.api_server.get_gridsquare_foilholes(gridsquare_uuid: str, on_square_only: bool = False, db: Session = Depends(get_db))[source]#
Get all foil holes for a specific grid square
- smartem_backend.api_server.create_gridsquare_foilhole(gridsquare_uuid: str, foilholes: list[FoilHoleCreateRequest], db: Session = Depends(get_db))[source]#
Create a new foil hole for a specific grid square
- smartem_backend.api_server.get_micrographs(db: Session = Depends(get_db))[source]#
Get all micrographs
- smartem_backend.api_server.get_micrograph(micrograph_uuid: str, db: Session = Depends(get_db))[source]#
Get a single micrograph by ID
- smartem_backend.api_server.update_micrograph(micrograph_uuid: str, micrograph: MicrographUpdateRequest, db: Session = Depends(get_db))[source]#
Update a micrograph
- smartem_backend.api_server.delete_micrograph(micrograph_uuid: str, db: Session = Depends(get_db))[source]#
Delete a micrograph by publishing to RabbitMQ
- smartem_backend.api_server.get_foilhole_micrographs(foilhole_uuid: str, db: Session = Depends(get_db))[source]#
Get all micrographs for a specific foil hole
- smartem_backend.api_server.create_foilhole_micrograph(foilhole_uuid: str, micrograph: MicrographCreateRequest, db: Session = Depends(get_db))[source]#
Create a new micrograph for a specific foil hole
- async smartem_backend.api_server.stream_instructions(agent_id: str, session_id: str, db: Session = Depends(get_db)) EventSourceResponse [source]#
SSE endpoint for streaming instructions to agents for a specific session
- async smartem_backend.api_server.acknowledge_instruction(agent_id: str, session_id: str, instruction_id: str, acknowledgement: AgentInstructionAcknowledgement, db: Session = Depends(get_db)) AgentInstructionAcknowledgementResponse [source]#
HTTP endpoint for instruction acknowledgements with database persistence
- async smartem_backend.api_server.agent_heartbeat(agent_id: str, session_id: str, db: Session = Depends(get_db))[source]#
Agent heartbeat endpoint to update connection health status.
- Parameters:
agent_id – The agent identifier
session_id – The session identifier
db – Database session
- Returns:
Heartbeat response with status and timestamp
- async smartem_backend.api_server.get_active_connections(db: Session = Depends(get_db))[source]#
Debug endpoint to view active agent connections
- async smartem_backend.api_server.get_session_instructions(session_id: str, db: Session = Depends(get_db))[source]#
Debug endpoint to view instructions for a session
- async smartem_backend.api_server.get_active_sessions(db: Session = Depends(get_db))[source]#
Debug endpoint to view all active sessions
- async smartem_backend.api_server.get_connection_stats()[source]#
Get real-time connection and session statistics
- async smartem_backend.api_server.create_managed_session(session_data: dict)[source]#
Create a session using the connection manager
- async smartem_backend.api_server.close_managed_session(session_id: str)[source]#
Close a session using the connection manager
- async smartem_backend.api_server.create_test_instruction(session_id: str, instruction_data: dict, db: Session = Depends(get_db))[source]#
Debug endpoint to create test instructions
- async smartem_backend.api_server.create_test_session(session_data: dict, db: Session = Depends(get_db))[source]#
Debug endpoint to create test sessions
- smartem_backend.api_server.get_model_weights_for_grid(grid_uuid: str, db: Session = Depends(get_db))[source]#
Get time series of model weights for grid
- smartem_backend.api_server.get_gridsquare_quality_prediction_time_series(gridsquare_uuid: str, db: Session = Depends(get_db))[source]#
Get time ordered predictions for all models that provide them for this square
- smartem_backend.api_server.get_foilhole_quality_prediction_time_series_for_gridsquare(gridsquare_uuid: str, db: Session = Depends(get_db))[source]#
Get time ordered predictions for all models that provide them for this square
- smartem_backend.api_server.get_foilhole_quality_prediction_time_series_for_gridsquare_for_metric(metric_name: str, gridsquare_uuid: str, db: Session = Depends(get_db))[source]#
Get time ordered predictions for all models that provide them for this square