findVM locates a guest by VMID across all profiles.
(ctx context.Context, vmid int)
| 76 | |
| 77 | // findVM locates a guest by VMID across all profiles. |
| 78 | func (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 |
no test coverage detected