sln build fix (again), tests fixes, audit work and doctors work
This commit is contained in:
65
src/__Libraries/StellaOps.Doctor/Models/RemediationStep.cs
Normal file
65
src/__Libraries/StellaOps.Doctor/Models/RemediationStep.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System.Collections.Immutable;
|
||||
|
||||
namespace StellaOps.Doctor.Models;
|
||||
|
||||
/// <summary>
|
||||
/// A single step in a remediation workflow.
|
||||
/// </summary>
|
||||
public sealed record RemediationStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Order of this step in the remediation sequence (1-based).
|
||||
/// </summary>
|
||||
public required int Order { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Human-readable description of what this step does.
|
||||
/// </summary>
|
||||
public required string Description { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The command or action to execute.
|
||||
/// May contain placeholders like {HOSTNAME} or {PASSWORD}.
|
||||
/// </summary>
|
||||
public required string Command { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Type of command (shell, SQL, API, etc.).
|
||||
/// </summary>
|
||||
public CommandType CommandType { get; init; } = CommandType.Shell;
|
||||
|
||||
/// <summary>
|
||||
/// Placeholders in the command that need user-supplied values.
|
||||
/// Key is the placeholder name (e.g., "HOSTNAME"), value is the description.
|
||||
/// </summary>
|
||||
public IReadOnlyDictionary<string, string>? Placeholders { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remediation instructions for fixing a failed check.
|
||||
/// </summary>
|
||||
public sealed record Remediation
|
||||
{
|
||||
/// <summary>
|
||||
/// Ordered steps to remediate the issue.
|
||||
/// </summary>
|
||||
public required IReadOnlyList<RemediationStep> Steps { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Safety note about the remediation (e.g., "This will restart the service").
|
||||
/// </summary>
|
||||
public string? SafetyNote { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether a backup is recommended before applying remediation.
|
||||
/// </summary>
|
||||
public bool RequiresBackup { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates an empty remediation with no steps.
|
||||
/// </summary>
|
||||
public static Remediation Empty => new()
|
||||
{
|
||||
Steps = ImmutableArray<RemediationStep>.Empty
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user