feat(cli): --mes-reportable on template alarm add/update and instance alarm-override set

Claude-Session: https://claude.ai/code/session_01Y5ef34iUUMjmwnMpL9xgmB
This commit is contained in:
Joseph Doherty
2026-09-11 10:08:28 -04:00
parent c259614a78
commit f1a7c34b69
4 changed files with 25 additions and 8 deletions
@@ -682,6 +682,8 @@ public static class TemplateCommands
var triggerConfigOption = new Option<string?>("--trigger-config") { Description = "Trigger configuration JSON" };
var lockedOption = new Option<bool>("--locked") { Description = "Lock status" };
lockedOption.DefaultValueFactory = _ => false;
var mesReportableOption = new Option<bool>("--mes-reportable") { Description = "Report this alarm to MES (IsFlaggedForMES on the alarm-status API)" };
mesReportableOption.DefaultValueFactory = _ => false;
// Typed setpoint flags (alternative to raw --trigger-config; raw wins when both supplied).
var attributeOption = new Option<string?>("--attribute") { Description = "Attribute name the trigger watches (all trigger types except Expression)" };
@@ -714,6 +716,7 @@ public static class TemplateCommands
addCmd.Add(descOption);
addCmd.Add(triggerConfigOption);
addCmd.Add(lockedOption);
addCmd.Add(mesReportableOption);
addCmd.Add(attributeOption);
addCmd.Add(matchValueOption);
addCmd.Add(notEqualsOption);
@@ -751,7 +754,8 @@ public static class TemplateCommands
result.GetValue(priorityOption)!,
result.GetValue(descOption),
triggerConfig,
result.GetValue(lockedOption)));
result.GetValue(lockedOption),
result.GetValue(mesReportableOption)));
});
group.Add(addCmd);
@@ -763,6 +767,8 @@ public static class TemplateCommands
var updateTriggerConfigOption = new Option<string?>("--trigger-config") { Description = "Trigger configuration JSON" };
var updateLockedOption = new Option<bool>("--locked") { Description = "Lock status" };
updateLockedOption.DefaultValueFactory = _ => false;
var updateMesReportableOption = new Option<bool>("--mes-reportable") { Description = "Report this alarm to MES (IsFlaggedForMES on the alarm-status API)" };
updateMesReportableOption.DefaultValueFactory = _ => false;
// --trigger-kind for update (same semantics as add)
var updateTriggerKindOption = new Option<string?>("--trigger-kind")
{
@@ -777,6 +783,7 @@ public static class TemplateCommands
updateCmd.Add(updateDescOption);
updateCmd.Add(updateTriggerConfigOption);
updateCmd.Add(updateLockedOption);
updateCmd.Add(updateMesReportableOption);
updateCmd.Add(updateTriggerKindOption);
updateCmd.SetAction(async (ParseResult result) =>
{
@@ -794,7 +801,8 @@ public static class TemplateCommands
result.GetValue(updatePriorityOption)!,
result.GetValue(updateDescOption),
triggerConfig,
result.GetValue(updateLockedOption)));
result.GetValue(updateLockedOption),
result.GetValue(updateMesReportableOption)));
});
group.Add(updateCmd);