29 lines
932 B
C#
29 lines
932 B
C#
|
|
using OTSSignsOrchestrator.Core.Models.DTOs;
|
||
|
|
|
||
|
|
namespace OTSSignsOrchestrator.Core.Services;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Abstraction for Docker CLI stack operations (deploy, remove, list, inspect).
|
||
|
|
/// Implementations may use local docker CLI or SSH-based remote execution.
|
||
|
|
/// </summary>
|
||
|
|
public interface IDockerCliService
|
||
|
|
{
|
||
|
|
Task<DeploymentResultDto> DeployStackAsync(string stackName, string composeYaml, bool resolveImage = false);
|
||
|
|
Task<DeploymentResultDto> RemoveStackAsync(string stackName);
|
||
|
|
Task<List<StackInfo>> ListStacksAsync();
|
||
|
|
Task<List<ServiceInfo>> InspectStackServicesAsync(string stackName);
|
||
|
|
}
|
||
|
|
|
||
|
|
public class StackInfo
|
||
|
|
{
|
||
|
|
public string Name { get; set; } = string.Empty;
|
||
|
|
public int ServiceCount { get; set; }
|
||
|
|
}
|
||
|
|
|
||
|
|
public class ServiceInfo
|
||
|
|
{
|
||
|
|
public string Name { get; set; } = string.Empty;
|
||
|
|
public string Image { get; set; } = string.Empty;
|
||
|
|
public string Replicas { get; set; } = string.Empty;
|
||
|
|
}
|