Image Acquisition Management
The ImageAcquisitionController provides the control plane for managing camera orchestrations β the long-running durable functions that continuously capture images from cameras.
Orchestration Lifecycleβ
Deployβ
When a deploy command is issued through the Admin API:
- The
AcquisitionDeviceEntitydocument in Cosmos DB is updated withisActive = true - The Image Acquisition Engine detects this change via the Cosmos DB Change Feed
- A new Durable Functions orchestration is started for that device
- The orchestration enters its eternal loop (capture β sleep β repeat)
Stopβ
- The document is updated with
isActive = false - The Change Feed triggers the engine
- The running orchestration is terminated
Redeployβ
- The existing orchestration is terminated
- A new orchestration is started with the latest configuration
- Useful when camera settings change (acquisition rate, image type, etc.)
Key Endpointsβ
| Endpoint | Method | Purpose |
|---|---|---|
/imageacquisition/deploy | POST | Deploy orchestration for one or more cameras |
/imageacquisition/stop | POST | Stop orchestration for one or more cameras |
/imageacquisition/redeploy | POST | Redeploy (restart) orchestrations |
/imageacquisition/status | GET | Check orchestration status across all devices |
/imageacquisition/status/{deviceId} | GET | Check status of a specific device's orchestration |
Batch Operationsβ
For multi-camera deployments, the API uses queue-based processing:
- Admin sends a batch deploy request with multiple device IDs
- Each device is enqueued to the
orchestration-redeployqueue - The Image Acquisition Engine processes the queue in parallel
- This prevents overwhelming the system when deploying hundreds of cameras simultaneously
CQRS Handlersβ
Commandsβ
DeployAcquisitionCommandβ Writes deploy state to Cosmos DB (triggers change feed)StopAcquisitionCommandβ Writes stop state to Cosmos DBRedeployAcquisitionCommandβ Terminates existing + writes deploy stateBulkDeployCommandβ Batch deploy via queue
Queriesβ
GetOrchestrationStatusQueryβ Reads durable entity state for a deviceGetAllOrchestrationStatusesQueryβ Aggregated status across all devices