MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / findVM

Method findVM

internal/cli/cli_helpers.go:78–87  ·  view source on GitHub ↗

findVM locates a guest by VMID across all profiles.

(ctx context.Context, vmid int)

Source from the content-addressed store, hash-verified

76
77// findVM locates a guest by VMID across all profiles.
78func (s *cliSession) findVM(ctx context.Context, vmid int) (*api.VM, error) {
79 if s.group != nil {
80 vm, _, err := s.group.FindVMByIDInGroup(ctx, vmid)
81 // Propagate the error as-is: AmbiguousVMIDError carries a full
82 // disambiguation message; not-found errors are also meaningful.
83 return vm, err
84 }
85
86 return findGuestByVMID(s.single, vmid)
87}
88
89// clientForNode returns the API client for the cluster that hosts nodeName.
90// In single mode it returns the single client; in group mode it resolves via

Callers 6

runGuestsShowFunction · 0.80
runGuestsDeleteFunction · 0.80
makeLifecycleCmdFunction · 0.80
runGuestsExecFunction · 0.80
runGuestsShellFunction · 0.80
runGuestsMigrateFunction · 0.80

Calls 2

findGuestByVMIDFunction · 0.85
FindVMByIDInGroupMethod · 0.80

Tested by

no test coverage detected