Skip to main content

Device Configuration

The DeviceConfigController and its backing CQRS handlers manage the lifecycle of camera devices β€” from initial onboarding through configuration updates and credential management.

Onboarding Workflow​

The IOnboardingService orchestrates the multi-step process of adding a new camera to the system:

  1. Device document is created in the Cosmos DB deviceConfig container with camera metadata (IP, manufacturer, model, location)
  2. Credentials are encrypted via IEncryptionService and stored securely
  3. SQL entity is created for relational queries (user-agency-camera relationships)
  4. ESRI feature layer is updated to show the camera on the map
  5. Durable Entity (CameraState) is initialized for orchestration state tracking

Key Endpoints​

EndpointMethodPurpose
/deviceconfigGETList all device configurations
/deviceconfig/{id}GETGet a single device config
/deviceconfigPOSTCreate a new device config (onboarding)
/deviceconfig/{id}PUTUpdate device configuration
/deviceconfig/{id}DELETERemove a device
/deviceconfig/credentials/{id}GETGet device credentials (decrypted)
/deviceconfig/credentialsPUTUpdate device credentials

Bulk Operations​

The IBulkOperationsService allows batch operations across multiple cameras:

  • Bulk deploy β€” Start image acquisition on multiple cameras simultaneously
  • Bulk stop β€” Stop acquisition on multiple cameras
  • Bulk redeploy β€” Restart orchestrations for a set of cameras
  • Bulk update β€” Apply configuration changes across a group

CQRS Handlers​

Commands​

  • CreateDeviceConfigCommand β€” Creates device in Cosmos + SQL + ESRI
  • UpdateDeviceConfigCommand β€” Updates device configuration
  • DeleteDeviceConfigCommand β€” Removes device and cleans up related entities
  • UpdateDeviceCredentialsCommand β€” Encrypts and stores credentials

Queries​

  • GetAllDeviceConfigsQuery β€” Lists all devices with optional filtering
  • GetDeviceConfigByIdQuery β€” Single device lookup
  • GetDeviceCredentialsByIdQuery β€” Decrypted credential retrieval

Data Model​

Device configurations are stored in Cosmos DB with the following key fields:

FieldDescription
deviceIdUnique identifier
deviceNameHuman-readable name
ipAddressCamera network address (encrypted at rest)
manufacturerCamera manufacturer (Axis, Mobotix)
modelNumberCamera model
latitude / longitudeGeographic coordinates
isActiveWhether the camera is currently active
acquisitionRateImage capture interval in seconds
imageTypeSINGLE, PANO, or PRE_STITCHED