68 lines
2.6 KiB
C#
68 lines
2.6 KiB
C#
namespace ZA.CoreService.ESBCertificateManager.Models;
|
|
|
|
public sealed class DeploymentTarget
|
|
{
|
|
public int Id { get; init; }
|
|
public required string Name { get; init; }
|
|
public required string Environment { get; init; }
|
|
public bool IsActive { get; init; } = true;
|
|
public required string TargetDirectory { get; init; }
|
|
public required string CertificateFileName { get; init; }
|
|
|
|
/// <summary>Name des Sonic-ESB-Containers (z.B. "sonic-container-a").</summary>
|
|
public string ContainerName { get; init; } = string.Empty;
|
|
|
|
public RestartType RestartType { get; init; } = RestartType.None;
|
|
|
|
// --- Command-basierter Neustart ---
|
|
public string RestartCommand { get; init; } = string.Empty;
|
|
public string RestartArguments { get; init; } = string.Empty;
|
|
public int RestartTimeoutSeconds { get; init; } = 60;
|
|
|
|
// --- Sonic-ESB-Management-Neustart ---
|
|
/// <summary>
|
|
/// Referenz auf den Namen einer <see cref="SonicConnection"/> in AppSettings.
|
|
/// Pflichtfeld bei RestartType = SonicContainer oder SonicContainerWithXapi.
|
|
/// </summary>
|
|
public string SonicConnectionName { get; init; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Pfad zur XApi-Ressourcendatei (.xml/.zip), die vor dem Neustart importiert wird.
|
|
/// Pflichtfeld bei RestartType = SonicContainerWithXapi.
|
|
/// </summary>
|
|
public string XapiSourcePath { get; init; } = string.Empty;
|
|
|
|
// --- TLS-Probe nach Deployment ---
|
|
public string TlsHost { get; init; } = string.Empty;
|
|
public int? TlsPort { get; init; }
|
|
|
|
/// <summary>
|
|
/// Hostname, der im TLS-Handshake als ServerName (SNI) verwendet wird.
|
|
/// Wichtig wenn TlsHost eine IP-Adresse ist, das Zertifikat aber einen DNS-Namen trägt.
|
|
/// Ist leer, wird TlsHost als ServerName verwendet.
|
|
/// </summary>
|
|
public string TlsServerName { get; init; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Erwarteter SHA-256-Fingerprint des Zertifikats nach dem Deployment (ohne Trennzeichen).
|
|
/// Wenn gesetzt, schlägt der TLS-Probe fehl wenn der Fingerprint abweicht.
|
|
/// </summary>
|
|
public string? ExpectedFingerprint { get; init; }
|
|
|
|
public int SortOrder { get; init; }
|
|
}
|
|
|
|
public enum RestartType
|
|
{
|
|
None = 0,
|
|
|
|
/// <summary>Neustart über einen lokalen Betriebssystem-Prozess (RestartCommand).</summary>
|
|
Command = 1,
|
|
|
|
/// <summary>Container-Neustart wie in der Sonic Management Console (stop/startcontainer bzw. SMC-API).</summary>
|
|
SonicContainer = 2,
|
|
|
|
/// <summary>XApi-Ressourcen importieren und danach Container neu starten (Sonic ESB).</summary>
|
|
SonicContainerWithXapi = 3
|
|
}
|