using MaksIT.PodmanClientDotNet.Dtos.Common;
using MaksIT.PodmanClientDotNet.Dtos.Container;
using MaksIT.PodmanClientDotNet.Models;
using MaksIT.PodmanClientDotNet.Streaming;
using MaksIT.Results;
///
/// Container lifecycle, inspection, attach, logs, archive, and related libpod endpoints.
///
public interface IPodmanContainersClient {
Task> CreateContainerAsync(
string name,
string image,
List? command = null,
Dictionary? env = null,
bool? remove = null,
bool? stdin = null,
bool? terminal = null,
List? mounts = null,
bool? privileged = null,
string? hostname = null,
Namespace? netns = null,
List? portMappings = null,
string? restartPolicy = null,
ulong? stopTimeout = null,
List? capAdd = null,
List? capDrop = null,
List? dnsServers = null,
List? dnsSearch = null,
List? dnsOptions = null,
bool? publishImagePorts = null,
List? cniNetworks = null,
Dictionary? labels = null,
bool? readOnlyFilesystem = null,
List? rLimits = null,
List? devices = null,
string? ociRuntime = null,
string? pod = null,
bool? noNewPrivileges = null,
string? cgroupsMode = null,
Dictionary? storageOpts = null,
bool? unsetenvall = null,
Dictionary? secretEnv = null,
string? timezone = null,
Dictionary? sysctl = null,
string? seccompProfilePath = null,
string? seccompPolicy = null,
Dictionary? annotations = null,
string? apparmorProfile = null,
string? baseHostsFile = null,
string? cgroupParent = null,
Namespace? cgroupns = null,
List? chrootDirectories = null,
string? conmonPidFile = null,
List? containerCreateCommand = null,
bool? createWorkingDir = null,
List? dependencyContainers = null,
List? deviceCgroupRule = null,
List? devicesFrom = null,
List? entrypoint = null,
bool? envHost = null,
List? envMerge = null,
Dictionary? expose = null,
string? groupEntry = null,
List? groups = null,
long? healthCheckOnFailureAction = null,
Schema2HealthConfig? healthConfig = null,
List? hostDeviceList = null,
List? hostAdd = null,
List? hostUsers = null,
bool? envHTTPProxy = null,
IDMappingOptions? idMappings = null,
string? imageArch = null,
string? imageOS = null,
string? imageVariant = null,
string? imageVolumeMode = null,
List? imageVolumes = null,
bool? init = null,
string? initContainerType = null,
string? initPath = null,
LinuxIntelRdt? intelRdt = null,
Namespace? ipcns = null,
bool? labelNested = null,
LogConfigLibpod? logConfiguration = null,
bool? managePassword = null,
List? mask = null,
Dictionary? networkOptions = null,
Dictionary? networks = null,
long? oomScoreAdj = null,
List? overlayVolumes = null,
string? passwdEntry = null,
LinuxPersonality? personality = null,
Namespace? pidns = null,
string? rawImageName = null,
bool? readWriteTmpfs = null,
LinuxResources? resourceLimits = null,
ulong? restartTries = null,
string? rootfs = null,
string? rootfsMapping = null,
bool? rootfsOverlay = null,
string? rootfsPropagation = null,
string? sdnotifyMode = null,
List? secrets = null,
List? selinuxOpts = null,
long? shmSize = null,
long? shmSizeSystemd = null,
StartupHealthConfig? startupHealthConfig = null,
long? stopSignal = null,
string? systemd = null,
Dictionary? throttleReadBpsDevice = null,
Dictionary? throttleReadIopsDevice = null,
Dictionary? throttleWriteBpsDevice = null,
Dictionary? throttleWriteIopsDevice = null,
ulong? timeout = null,
string? umask = null,
Dictionary? unified = null,
List? unmask = null,
bool? useImageHosts = null,
bool? useImageResolvConf = null,
string? user = null,
Namespace? userns = null,
Namespace? utsns = null,
bool? volatileFlag = null,
List? volumes = null,
List? volumesFrom = null,
Dictionary? weightDevice = null,
string? workDir = null
);
Task StartContainerAsync(string containerId, string detachKeys = "ctrl-p,ctrl-q");
Task StopContainerAsync(string containerId, int timeout = 10, bool ignoreAlreadyStopped = false);
Task> ForceDeleteContainerAsync(string containerId, bool deleteVolumes = false, int timeout = 10);
Task> DeleteContainerAsync(string containerId, bool depend = false, bool ignore = false, int timeout = 10);
Task ExtractArchiveToContainerAsync(string containerId, Stream tarStream, string path, bool pause = true);
Task?>> ListContainersAsync(
bool all = false,
int? limit = null,
bool size = false,
bool sync = false,
string? filters = null,
CancellationToken cancellationToken = default
);
Task> InspectContainerAsync(string name, CancellationToken cancellationToken = default);
Task ContainerExistsAsync(string name, CancellationToken cancellationToken = default);
Task RestartContainerAsync(string name, int timeout = 10, CancellationToken cancellationToken = default);
Task KillContainerAsync(string name, string signal = "TERM", CancellationToken cancellationToken = default);
Task PauseContainerAsync(string name, CancellationToken cancellationToken = default);
Task UnpauseContainerAsync(string name, CancellationToken cancellationToken = default);
Task> WaitContainerAsync(string name, string? condition = null, CancellationToken cancellationToken = default);
Task> GetContainerLogsAsync(
string name,
bool follow = false,
bool stdout = true,
bool stderr = true,
bool timestamps = false,
string? since = null,
string? until = null,
string? tail = null,
CancellationToken cancellationToken = default
);
Task> GetContainerStatsAsync(string name, bool stream = false, CancellationToken cancellationToken = default);
Task> GetContainersStatsAsync(
IEnumerable? containers = null,
bool stream = false,
CancellationToken cancellationToken = default
);
Task?>> PruneContainersAsync(string? filters = null, CancellationToken cancellationToken = default);
Task RenameContainerAsync(string name, string newName, CancellationToken cancellationToken = default);
Task InitContainerAsync(string name, CancellationToken cancellationToken = default);
Task> CheckpointContainerAsync(
string name,
bool keep = false,
bool leaveRunning = false,
bool tcpEstablished = false,
bool export = false,
bool ignoreRootFS = false,
CancellationToken cancellationToken = default
);
Task RestoreContainerAsync(
string name,
string? importPath = null,
bool keep = false,
bool leaveRunning = false,
bool tcpEstablished = false,
bool ignoreRootFS = false,
bool ignoreStaticIP = false,
bool ignoreStaticMAC = false,
CancellationToken cancellationToken = default
);
Task> MountContainerAsync(string name, CancellationToken cancellationToken = default);
Task UnmountContainerAsync(string name, CancellationToken cancellationToken = default);
Task> ExportContainerAsync(string name, CancellationToken cancellationToken = default);
Task> GetContainerArchiveAsync(string name, string path, CancellationToken cancellationToken = default);
Task PutContainerArchiveAsync(string containerId, Stream tarStream, string path, bool pause = true, CancellationToken cancellationToken = default);
Task> AttachContainerAsync(
string name,
bool logs = false,
bool stream = true,
bool stdout = true,
bool stderr = true,
bool stdin = false,
string? detachKeys = null,
CancellationToken cancellationToken = default
);
///
/// Opens a full-duplex attach session (multiplexed or raw TTY) over a hijacked HTTP connection.
///
Task> AttachContainerSessionAsync(
string name,
bool logs = false,
bool stream = true,
bool stdout = true,
bool stderr = true,
bool stdin = true,
bool tty = false,
string? detachKeys = null,
CancellationToken cancellationToken = default
);
Task> GetContainerChangesAsync(string name, CancellationToken cancellationToken = default);
Task> CommitContainerAsync(
string container,
string? repo = null,
string? tag = null,
string? comment = null,
string? author = null,
bool pause = true,
IEnumerable? changes = null,
string? format = null,
CancellationToken cancellationToken = default
);
Task> HealthCheckContainerAsync(string name, CancellationToken cancellationToken = default);
Task>?>> GetMountedContainersAsync(CancellationToken cancellationToken = default);
Task> TopContainerAsync(string name, string psArgs = "-ef", bool stream = true, CancellationToken cancellationToken = default);
}