Skip to main content

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:

  1. The AcquisitionDeviceEntity document in Cosmos DB is updated with isActive = true
  2. The Image Acquisition Engine detects this change via the Cosmos DB Change Feed
  3. A new Durable Functions orchestration is started for that device
  4. The orchestration enters its eternal loop (capture β†’ sleep β†’ repeat)

Stop​

  1. The document is updated with isActive = false
  2. The Change Feed triggers the engine
  3. The running orchestration is terminated

Redeploy​

  1. The existing orchestration is terminated
  2. A new orchestration is started with the latest configuration
  3. Useful when camera settings change (acquisition rate, image type, etc.)

Key Endpoints​

EndpointMethodPurpose
/imageacquisition/deployPOSTDeploy orchestration for one or more cameras
/imageacquisition/stopPOSTStop orchestration for one or more cameras
/imageacquisition/redeployPOSTRedeploy (restart) orchestrations
/imageacquisition/statusGETCheck orchestration status across all devices
/imageacquisition/status/{deviceId}GETCheck status of a specific device's orchestration

Batch Operations​

For multi-camera deployments, the API uses queue-based processing:

  1. Admin sends a batch deploy request with multiple device IDs
  2. Each device is enqueued to the orchestration-redeploy queue
  3. The Image Acquisition Engine processes the queue in parallel
  4. 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 DB
  • RedeployAcquisitionCommand β€” Terminates existing + writes deploy state
  • BulkDeployCommand β€” Batch deploy via queue

Queries​

  • GetOrchestrationStatusQuery β€” Reads durable entity state for a device
  • GetAllOrchestrationStatusesQuery β€” Aggregated status across all devices