feat(lxc): LXC lifecycle write path — start/stop/shutdown/delete + CLI#17
Merged
Conversation
Adds PctWriter, the container counterpart to QemuWriter (#14), giving an IaC write path to tear a CT down instead of root SSH + pct. Motivated by Chrison-Homelab/Homelab#149 (decommissioning Teleport CT 9904 had no sanctioned write path). - PctWriter: StartAsync / StopAsync (hard kill) / ShutdownAsync (graceful + hard-stop fallback) / DeleteAsync (force + purge). Mirrors QemuWriter — raw form requests over the shared Kiota adapter (lifecycle ops carry forceStop/timeout/force/purge query flags), same token-auth/TLS + error-body surfacing, returns a task UPID; WaitForTaskAsync. - CLI: `proxmoxsharp lxc <start|stop|shutdown|delete> <node> <vmid>`; delete is gated on --confirm with --force/--no-purge, same discipline as `vm delete`. - Pure query-builder helpers (DeleteQuery/ShutdownQuery) unit-tested (5 new; suite green). Relates to Chrison-Homelab/Homelab#149 and the converge destroy lifecycle (#101). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
PctWriter, the container counterpart toQemuWriter(#14) — an IaC write path to start/stop/shutdown/destroy an LXC, so decommissioning a CT no longer needs root SSH +pct.Motivated by Chrison-dev/Homelab#149: retiring Teleport CT 9904 had no sanctioned write path (proxmoxsharp was read-only).
What
src/ProxmoxSharp/Lxc/PctWriter.cs—StartAsync,StopAsync(hard kill),ShutdownAsync(graceful + hard-stop fallback viaforceStop/timeout),DeleteAsync(force+purge). MirrorsQemuWriter: raw form requests over the shared Kiota adapter (lifecycle ops carry query flags the typed builders can't express), same token-auth/TLS + error-body surfacing (fix: surface Proxmox error body instead of opaque status code #16), returns a task UPID;WaitForTaskAsyncpolls it.proxmoxsharp lxc <start|stop|shutdown|delete> <node> <vmid>.deleteis gated on--confirm, with--force/--no-purge, same discipline asvm delete.DeleteQuery/ShutdownQuery) unit-tested (5 new). Full suite green (37 passed, 3 pre-existing skips).Notes
QemuWriter.DeleteAsync. The form-send + task-poll helpers mirrorQemuWriter; a shared base can be hoisted if a third writer appears.Relates to Chrison-Homelab/Homelab#149 and the converge destroy lifecycle (#101).
🤖 Generated with Claude Code