feat: add CLI debug snapshot command for one-shot instance state inspection
Adds `debug snapshot --id <int>` to query a running instance's current attribute values and alarm states without the subscribe/stream overhead of the debug view. Routes through ManagementActor → CommunicationService → site DeploymentManager → InstanceActor using the existing remote query pattern.
This commit is contained in:
@@ -104,6 +104,9 @@ public class SiteCommunicationActor : ReceiveActor, IWithTimers
|
||||
Receive<SubscribeDebugViewRequest>(msg => _deploymentManagerProxy.Forward(msg));
|
||||
Receive<UnsubscribeDebugViewRequest>(msg => _deploymentManagerProxy.Forward(msg));
|
||||
|
||||
// Pattern 6a: Debug Snapshot (one-shot) — forward to Deployment Manager
|
||||
Receive<DebugSnapshotRequest>(msg => _deploymentManagerProxy.Forward(msg));
|
||||
|
||||
// Pattern 7: Remote Queries
|
||||
Receive<EventLogQueryRequest>(msg =>
|
||||
{
|
||||
|
||||
@@ -130,7 +130,17 @@ public class CommunicationService
|
||||
GetActor().Tell(new SiteEnvelope(siteId, request));
|
||||
}
|
||||
|
||||
// ── Pattern 6: Health Reporting (site→central, Tell) ──
|
||||
// ── Pattern 6a: Debug Snapshot (one-shot, request/response) ──
|
||||
|
||||
public async Task<DebugViewSnapshot> RequestDebugSnapshotAsync(
|
||||
string siteId, DebugSnapshotRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var envelope = new SiteEnvelope(siteId, request);
|
||||
return await GetActor().Ask<DebugViewSnapshot>(
|
||||
envelope, _options.QueryTimeout, cancellationToken);
|
||||
}
|
||||
|
||||
// ── Pattern 6b: Health Reporting (site→central, Tell) ──
|
||||
// Health reports are received by central, not sent. No method needed here.
|
||||
|
||||
// ── Pattern 7: Remote Queries ──
|
||||
|
||||
Reference in New Issue
Block a user