diff options
author | Albin Suresh <albin.suresh@softwareag.com> | 2022-02-25 19:22:54 +0530 |
---|---|---|
committer | Albin Suresh <albin.suresh@softwareag.com> | 2022-03-11 12:40:05 +0530 |
commit | 77408c75a7f62a80a9d6a43e9757d9980e845798 (patch) | |
tree | 36778779830abc657f1250d7cb8354d48c5dc823 /crates/core/c8y_smartrest/src | |
parent | 122670b6553b1070f0914b32d1401613a7250577 (diff) |
Rename message field to text in Thin Edge JSON alarms payload
Diffstat (limited to 'crates/core/c8y_smartrest/src')
-rw-r--r-- | crates/core/c8y_smartrest/src/alarm.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/core/c8y_smartrest/src/alarm.rs b/crates/core/c8y_smartrest/src/alarm.rs index 630debe9..970dd991 100644 --- a/crates/core/c8y_smartrest/src/alarm.rs +++ b/crates/core/c8y_smartrest/src/alarm.rs @@ -21,7 +21,7 @@ pub fn serialize_alarm(alarm: ThinEdgeAlarm) -> Result<String, SmartRestSerializ "{},{},\"{}\",{}", smartrest_code, alarm.name, - alarm_data.message.unwrap_or_default(), + alarm_data.text.unwrap_or_default(), alarm_data.time.map_or_else( || current_timestamp.format(&Rfc3339), |timestamp| timestamp.format(&Rfc3339) @@ -47,7 +47,7 @@ mod tests { name: "temperature_alarm".into(), severity: AlarmSeverity::Critical, data: Some(ThinEdgeAlarmData { - message: Some("I raised it".into()), + text: Some("I raised it".into()), time: Some(datetime!(2021-04-23 19:00:00 +05:00)), }), }, @@ -59,7 +59,7 @@ mod tests { name: "temperature_alarm".into(), severity: AlarmSeverity::Major, data: Some(ThinEdgeAlarmData { - message: Some("I raised it".into()), + text: Some("I raised it".into()), time: Some(datetime!(2021-04-23 19:00:00 +05:00)), }), }, @@ -71,7 +71,7 @@ mod tests { name: "temperature_alarm".into(), severity: AlarmSeverity::Minor, data: Some(ThinEdgeAlarmData { - message: None, + text: None, time: Some(datetime!(2021-04-23 19:00:00 +05:00)), }), }, @@ -83,7 +83,7 @@ mod tests { name: "temperature_alarm".into(), severity: AlarmSeverity::Warning, data: Some(ThinEdgeAlarmData { - message: Some("I, raised, it".into()), + text: Some("I, raised, it".into()), time: Some(datetime!(2021-04-23 19:00:00 +05:00)), }), }, @@ -119,7 +119,7 @@ mod tests { name: "temperature_alarm".into(), severity: AlarmSeverity::Warning, data: Some(ThinEdgeAlarmData { - message: Some("I raised it".into()), + text: Some("I raised it".into()), time: None, }), }; |