put https://api.freedomrobotics.ai/accounts//devices//alerts
- action - "trigger" or "clear"
- attributes - dictionary of alert-specific attributes which are being reported
- description - human-readable explanation
- name - unique identifier for this alert within the device
- level - "info", "warn", "error", "fatal"
- type - the well-known name for the alert type which was triggered
Actions this does:
- Checks the mc.alerts.enabled attribute to validate if this device should be reporting alerts. If it is not enabled, the alert is disregarded.
- Checks if the alert already exists for the device and disregards if there is no change, or updates if the level is different.
- Updates the read only device attribute mc.alerts.active_alerts either adding a new alert, clearing a resolved one or resolving and recreating the alert with the new severity level.
- Records the alert to the mission_control_controller data endpoint for logging and replay.
- Broadcasts the alert to the enabled account endpoints based on mc.alerts.emitters for the account.
Example Alert Body:
[
{
"name": "DILITHIUM CRYSTAL FAILURE",
"action": "trigger",
"level": "error",
"type": "mc.data_outside_bounds",
"description": "The dilithium crystal's resonant frequency is too low. Please add more fuel.",
"attributes": {
"remaining_mass": "12.212",
"frequency": 31211233212321.21
},
}
]