Documentation
¶
Index ¶
- Constants
- Variables
- func CheckVMImpactsHead(vmID string) bool
- func CleanupAfterDeletion(deletedVMIDs []string) bool
- func ClearHead() error
- func GetCurrentHeadVM() (string, error)
- func GetVmAndNodeIP(ctx context.Context, client *vers.Client, vmID string) (*vers.Vm, string, error)
- func IsHostLocal(hostName string) bool
- func SetHead(vmID string) error
- type VMInfo
- func CreateVMInfoFromVM(vm vers.Vm) *VMInfo
- func GetCurrentHeadVMInfo(ctx context.Context, client *vers.Client) (*VMInfo, error)
- func ResolveVMIdentifier(ctx context.Context, client *vers.Client, vmID string) (*VMInfo, error)
- func SetHeadFromIdentifier(ctx context.Context, client *vers.Client, identifier string) (*VMInfo, error)
Constants ¶
View Source
const ( VersDir = ".vers" HeadFile = "HEAD" )
Variables ¶
View Source
var ( ErrHeadNotFound = errors.New("head not found") ErrHeadEmpty = errors.New("head empty") )
Functions ¶
func CheckVMImpactsHead ¶
CheckVMImpactsHead checks if a specific VM deletion will affect HEAD
func CleanupAfterDeletion ¶
CleanupAfterDeletion clears HEAD if any of the deleted VM IDs match current HEAD
func GetCurrentHeadVM ¶
GetCurrentHeadVM returns the VM ID from the current HEAD
func GetVmAndNodeIP ¶
func GetVmAndNodeIP(ctx context.Context, client *vers.Client, vmID string) (*vers.Vm, string, error)
GetVmAndNodeIP retrieves VM information and the node IP from headers in a single request. We use the lower-level client.Get() instead of client.Vm.List() because we need response headers.
func IsHostLocal ¶
Types ¶
type VMInfo ¶
VMInfo contains both ID and display name for a VM
func CreateVMInfoFromVM ¶ added in v0.5.0
CreateVMInfoFromVM creates VMInfo from a Vm struct
func GetCurrentHeadVMInfo ¶
GetCurrentHeadVMInfo returns both the HEAD VM ID and its display information
func ResolveVMIdentifier ¶
ResolveVMIdentifier takes a VM ID and returns the VM info Note: Alias lookups are no longer supported in the new SDK
Click to show internal directories.
Click to hide internal directories.