feat: achieve CLI parity with Central UI

Add 33 new management message records, ManagementActor handlers, and CLI
commands to close all functionality gaps between the Central UI and the
Management CLI. New capabilities include:

- Template member CRUD (attributes, alarms, scripts, compositions)
- Shared script CRUD
- Database connection definition CRUD
- Inbound API method CRUD
- LDAP scope rule management
- API key enable/disable
- Area update
- Remote event log and parked message queries
- Missing get/update commands for templates, sites, instances, data
  connections, external systems, notifications, and SMTP config

Includes 12 new ManagementActor unit tests covering authorization,
happy-path queries, and error handling. Updates CLI README and component
design documents (Component-CLI.md, Component-ManagementService.md).
This commit is contained in:
Joseph Doherty
2026-03-18 01:21:20 -04:00
parent b2385709f8
commit c63fb1c4a6
24 changed files with 2500 additions and 15 deletions

View File

@@ -12,6 +12,8 @@ public static class HealthCommands
command.Add(BuildSummary(contactPointsOption, formatOption));
command.Add(BuildSite(contactPointsOption, formatOption));
command.Add(BuildEventLog(contactPointsOption, formatOption));
command.Add(BuildParkedMessages(contactPointsOption, formatOption));
return command;
}
@@ -40,4 +42,67 @@ public static class HealthCommands
});
return cmd;
}
private static Command BuildEventLog(Option<string> contactPointsOption, Option<string> formatOption)
{
var siteOption = new Option<string>("--site") { Description = "Site identifier", Required = true };
var eventTypeOption = new Option<string?>("--event-type") { Description = "Filter by event type" };
var severityOption = new Option<string?>("--severity") { Description = "Filter by severity" };
var keywordOption = new Option<string?>("--keyword") { Description = "Keyword search" };
var fromOption = new Option<DateTimeOffset?>("--from") { Description = "Start date (ISO 8601)" };
var toOption = new Option<DateTimeOffset?>("--to") { Description = "End date (ISO 8601)" };
var pageOption = new Option<int>("--page") { Description = "Page number" };
pageOption.DefaultValueFactory = _ => 1;
var pageSizeOption = new Option<int>("--page-size") { Description = "Page size" };
pageSizeOption.DefaultValueFactory = _ => 50;
var cmd = new Command("event-log") { Description = "Query site event logs" };
cmd.Add(siteOption);
cmd.Add(eventTypeOption);
cmd.Add(severityOption);
cmd.Add(keywordOption);
cmd.Add(fromOption);
cmd.Add(toOption);
cmd.Add(pageOption);
cmd.Add(pageSizeOption);
cmd.SetAction(async (ParseResult result) =>
{
return await CommandHelpers.ExecuteCommandAsync(
result, contactPointsOption, formatOption,
new QueryEventLogsCommand(
result.GetValue(siteOption)!,
result.GetValue(eventTypeOption),
result.GetValue(severityOption),
result.GetValue(keywordOption),
result.GetValue(fromOption),
result.GetValue(toOption),
result.GetValue(pageOption),
result.GetValue(pageSizeOption)));
});
return cmd;
}
private static Command BuildParkedMessages(Option<string> contactPointsOption, Option<string> formatOption)
{
var siteOption = new Option<string>("--site") { Description = "Site identifier", Required = true };
var pageOption = new Option<int>("--page") { Description = "Page number" };
pageOption.DefaultValueFactory = _ => 1;
var pageSizeOption = new Option<int>("--page-size") { Description = "Page size" };
pageSizeOption.DefaultValueFactory = _ => 50;
var cmd = new Command("parked-messages") { Description = "Query parked messages at a site" };
cmd.Add(siteOption);
cmd.Add(pageOption);
cmd.Add(pageSizeOption);
cmd.SetAction(async (ParseResult result) =>
{
return await CommandHelpers.ExecuteCommandAsync(
result, contactPointsOption, formatOption,
new QueryParkedMessagesCommand(
result.GetValue(siteOption)!,
result.GetValue(pageOption),
result.GetValue(pageSizeOption)));
});
return cmd;
}
}