LxcCommand

Composite command for the Proxmox /usr/sbin/pct (Proxmox Container Toolkit) binary. Builds an argv list via the fluent LxcCommand.Builder and executes either locally (production: on the Proxmox host) or returns the rendered string for SSH dispatch in tests (proxmox.Execute(PveCommand.From(cmd.ToArgString()))). All param+value pairs use AddNamed-style two-token argv emit; never single-string "--flag value" concat (would split on spaces in values containing whitespace).

public sealed class LxcCommand

1. Fields

1.1. PctBinary

Absolute path to the pct binary on Proxmox hosts.

public const string PctBinary

2. Properties

2.1. Argv

Full ordered argv list (including the leading subcommand and ctid token).

public IReadOnlyList<string> Argv { get; }

2.2. Subcommand

The pct subcommand verb (create/start/stop/destroy/exec/set/status).

public string Subcommand { get; }

3. Methods

3.1. ExecuteLocal(ILogger, TimeSpan?, string[])

Production execution path: assembles a LinuxCommandBase.Builder for PctBinary with each argv token appended via two-token Add() pairs already produced by the Builder, then executes synchronously. The optional timeout is currently advisory (the underlying LinuxCommandBase.Execute does not expose a per-call timeout); long-running pct invocations rely on systemd unit defaults instead.

public ICommandResult ExecuteLocal(ILogger logger, TimeSpan? timeout = null, params string[] secrets)
Table 1. Parameters
Name Type Description

logger

ILogger

timeout

TimeSpan?

secrets

string[]

Returns: ICommandResult

3.2. ToArgString()

Renders the argv list as a single shell-safe string suitable for proxmox.Execute(PveCommand.From("pct ...")) in tests. Tokens containing whitespace or shell metacharacters are single-quoted.

public string ToArgString()

Returns: string