first commit

This commit is contained in:
2026-03-02 20:53:28 +01:00
commit d27c205106
63 changed files with 4593 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
using HanaToolbox.Config;
namespace HanaToolbox.Services.Interfaces;
public interface IAuroraService
{
Task RunAsync(AuroraConfig config, HanaConfig hana, string sid, CancellationToken ct = default);
}

View File

@@ -0,0 +1,8 @@
using HanaToolbox.Config;
namespace HanaToolbox.Services.Interfaces;
public interface IBackupService
{
Task RunAsync(BackupConfig config, HanaConfig hana, string sid, CancellationToken ct = default);
}

View File

@@ -0,0 +1,8 @@
using HanaToolbox.Config;
namespace HanaToolbox.Services.Interfaces;
public interface ICleanerService
{
Task RunAsync(CleanerConfig config, CancellationToken ct = default);
}

View File

@@ -0,0 +1,9 @@
using HanaToolbox.Config;
namespace HanaToolbox.Services.Interfaces;
public interface IFirewallService
{
/// <summary>Applies the saved firewall config non-interactively (cron mode).</summary>
Task ApplyAsync(FirewallConfig config, CancellationToken ct = default);
}

View File

@@ -0,0 +1,10 @@
namespace HanaToolbox.Services.Interfaces;
public interface IHdbClientLocator
{
/// <summary>Returns the resolved path to hdbsql. Throws if not found.</summary>
string LocateHdbsql(string? configuredPath, string sid, string instanceNumber);
/// <summary>Returns the resolved path to hdbuserstore. Throws if not found.</summary>
string LocateHdbuserstore(string? configuredPath, string sid, string instanceNumber);
}

View File

@@ -0,0 +1,15 @@
namespace HanaToolbox.Services.Interfaces;
public interface IKeyManagerService
{
Task<bool> CreateKeyAsync(
string keyName, string connectionString,
string user, string password,
string sid, CancellationToken ct = default);
Task<bool> DeleteKeyAsync(string keyName, string sid, CancellationToken ct = default);
Task<IReadOnlyList<string>> ListKeysAsync(string sid, CancellationToken ct = default);
Task<bool> TestKeyAsync(string hdbsqlPath, string keyName, string sid, CancellationToken ct = default);
}

View File

@@ -0,0 +1,8 @@
using HanaToolbox.Config;
namespace HanaToolbox.Services.Interfaces;
public interface IMonitorService
{
Task RunAsync(MonitorConfig config, HanaConfig hana, string sid, CancellationToken ct = default);
}

View File

@@ -0,0 +1,7 @@
namespace HanaToolbox.Services.Interfaces;
public interface IMonitorStateService
{
string? GetState(string key);
void SetState(string key, string value);
}

View File

@@ -0,0 +1,6 @@
namespace HanaToolbox.Services.Interfaces;
public interface INotificationService
{
Task SendAsync(string title, string message, CancellationToken ct = default);
}

View File

@@ -0,0 +1,13 @@
namespace HanaToolbox.Services.Interfaces;
public sealed record ProcessResult(int ExitCode, string StdOut, string StdErr)
{
public bool Success => ExitCode == 0;
}
public interface IProcessRunner
{
Task<ProcessResult> RunAsync(
string executable, string[] args,
CancellationToken ct = default);
}

View File

@@ -0,0 +1,14 @@
using HanaToolbox.Services.Interfaces;
namespace HanaToolbox.Services.Interfaces;
public interface IUserSwitcher
{
/// <summary>
/// Executes a shell command string as &lt;sid&gt;adm using `su - &lt;sid&gt;adm -c`.
/// If already running as &lt;sid&gt;adm, runs the command directly.
/// </summary>
Task<ProcessResult> RunAsAsync(
string sid, string shellCommand,
CancellationToken ct = default);
}