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:
- Device document is created in the Cosmos DB
deviceConfigcontainer with camera metadata (IP, manufacturer, model, location) - Credentials are encrypted via
IEncryptionServiceand stored securely - SQL entity is created for relational queries (user-agency-camera relationships)
- ESRI feature layer is updated to show the camera on the map
- Durable Entity (
CameraState) is initialized for orchestration state tracking
Key Endpointsβ
| Endpoint | Method | Purpose |
|---|---|---|
/deviceconfig | GET | List all device configurations |
/deviceconfig/{id} | GET | Get a single device config |
/deviceconfig | POST | Create a new device config (onboarding) |
/deviceconfig/{id} | PUT | Update device configuration |
/deviceconfig/{id} | DELETE | Remove a device |
/deviceconfig/credentials/{id} | GET | Get device credentials (decrypted) |
/deviceconfig/credentials | PUT | Update 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 + ESRIUpdateDeviceConfigCommandβ Updates device configurationDeleteDeviceConfigCommandβ Removes device and cleans up related entitiesUpdateDeviceCredentialsCommandβ Encrypts and stores credentials
Queriesβ
GetAllDeviceConfigsQueryβ Lists all devices with optional filteringGetDeviceConfigByIdQueryβ Single device lookupGetDeviceCredentialsByIdQueryβ Decrypted credential retrieval
Data Modelβ
Device configurations are stored in Cosmos DB with the following key fields:
| Field | Description |
|---|---|
deviceId | Unique identifier |
deviceName | Human-readable name |
ipAddress | Camera network address (encrypted at rest) |
manufacturer | Camera manufacturer (Axis, Mobotix) |
modelNumber | Camera model |
latitude / longitude | Geographic coordinates |
isActive | Whether the camera is currently active |
acquisitionRate | Image capture interval in seconds |
imageType | SINGLE, PANO, or PRE_STITCHED |