Documentation ¶
Overview ¶
Package hvutils provies utility methods to access the Hivelocity API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMoreThanOneTagFound gets returned if more than one caphv-device-type tag was found via the HV API. ErrMoreThanOneTagFound = fmt.Errorf("more than one caphv-device-type tag found") // ErrInvalidLabelValue gets returned if the HV tag contains a value which is an invalid K8s label. ErrInvalidLabelValue = fmt.Errorf("invalid label value") // ErrNoInstanceTypeFound gets returned if no caphv-device-type tag was found via the HV API. ErrNoInstanceTypeFound = fmt.Errorf("no caphv-device-type tag found") // ErrMoreThanOneNameFound gets returned if more than one caphv-machine-name tag was found via the HV API. ErrMoreThanOneNameFound = fmt.Errorf("more than one caphv-machine-name tag found") // ErrNoMachineNameFound gets returned if no caphv-machine-name tag was found via the HV API. ErrNoMachineNameFound = fmt.Errorf("no caphv-machine-name tag found") )
Functions ¶
func GetInstanceTypeFromTags ¶
GetInstanceTypeFromTags is a utility method to read the caphv-device-type from a slice of strings. The slice is usually from the Hivelocity API of a device. Example: {"caphv-device-type=foo", "other-label"} would return "foo".
func GetMachineNameFromTags ¶
GetMachineNameFromTags is a utility method to read the caphv-machine-name from a slice of strings. The slice is usually from the Hivelocity API of a device. Example: {"caphv-machine-name=foo", "other-label"} would return "foo".
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.