I'm getting warnings when I validate my old automations in DM version 10.5 about the arguments to SetAlarmStateMessage.
If I read the warnings correctly they indicate that I should rather use AlarmTreeID instead of the combination DataMinerID and AlarmID when I call SetAlarmStateMessage
SetAlarmStateMessage(AlarmTreeID, AlarmUserStatus, String)
vs
SetAlarmStateMessage(DataMinerID, AlarmID, AlarmUserStatus, String)
My question is how do I get the AlarmTreeID for an alarm?
The AlarmUserStatus is an enum that belongs to
Skyline.DataMiner.Net.Enums
In your case the code snippet will likely look similar to:
using Skyline.DataMiner.Net.Enums;
var request = new SetAlarmStateMessage(
alarm.TreeID,
AlarmUserStatus.Clear,
"Cleared by automation");engine.SendSLNetMessage(request);
Ref:
- Correlation Rule - DataMiner Dojo
- Alarm Type Update via Automation Script - DataMiner Dojo
- Namespace Skyline.DataMiner.Net | DataMiner Docs (holds more details on AlarmTreeID, not the enum)