first commit
This commit is contained in:
8
Services/Interfaces/IAuroraService.cs
Normal file
8
Services/Interfaces/IAuroraService.cs
Normal 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);
|
||||
}
|
||||
8
Services/Interfaces/IBackupService.cs
Normal file
8
Services/Interfaces/IBackupService.cs
Normal 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);
|
||||
}
|
||||
8
Services/Interfaces/ICleanerService.cs
Normal file
8
Services/Interfaces/ICleanerService.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using HanaToolbox.Config;
|
||||
|
||||
namespace HanaToolbox.Services.Interfaces;
|
||||
|
||||
public interface ICleanerService
|
||||
{
|
||||
Task RunAsync(CleanerConfig config, CancellationToken ct = default);
|
||||
}
|
||||
9
Services/Interfaces/IFirewallService.cs
Normal file
9
Services/Interfaces/IFirewallService.cs
Normal 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);
|
||||
}
|
||||
10
Services/Interfaces/IHdbClientLocator.cs
Normal file
10
Services/Interfaces/IHdbClientLocator.cs
Normal 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);
|
||||
}
|
||||
15
Services/Interfaces/IKeyManagerService.cs
Normal file
15
Services/Interfaces/IKeyManagerService.cs
Normal 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);
|
||||
}
|
||||
8
Services/Interfaces/IMonitorService.cs
Normal file
8
Services/Interfaces/IMonitorService.cs
Normal 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);
|
||||
}
|
||||
7
Services/Interfaces/IMonitorStateService.cs
Normal file
7
Services/Interfaces/IMonitorStateService.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace HanaToolbox.Services.Interfaces;
|
||||
|
||||
public interface IMonitorStateService
|
||||
{
|
||||
string? GetState(string key);
|
||||
void SetState(string key, string value);
|
||||
}
|
||||
6
Services/Interfaces/INotificationService.cs
Normal file
6
Services/Interfaces/INotificationService.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace HanaToolbox.Services.Interfaces;
|
||||
|
||||
public interface INotificationService
|
||||
{
|
||||
Task SendAsync(string title, string message, CancellationToken ct = default);
|
||||
}
|
||||
13
Services/Interfaces/IProcessRunner.cs
Normal file
13
Services/Interfaces/IProcessRunner.cs
Normal 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);
|
||||
}
|
||||
14
Services/Interfaces/IUserSwitcher.cs
Normal file
14
Services/Interfaces/IUserSwitcher.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using HanaToolbox.Services.Interfaces;
|
||||
|
||||
namespace HanaToolbox.Services.Interfaces;
|
||||
|
||||
public interface IUserSwitcher
|
||||
{
|
||||
/// <summary>
|
||||
/// Executes a shell command string as <sid>adm using `su - <sid>adm -c`.
|
||||
/// If already running as <sid>adm, runs the command directly.
|
||||
/// </summary>
|
||||
Task<ProcessResult> RunAsAsync(
|
||||
string sid, string shellCommand,
|
||||
CancellationToken ct = default);
|
||||
}
|
||||
Reference in New Issue
Block a user