Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DiskNameRX contains the regex pattern for matching a valid GCE disk // name the first character must be a lowercase letter, and all following // characters must be a dash, lowercase letter, or digit, except the // last character, which cannot be a dash. DiskNameRX = `[a-z](?:[-a-z0-9]*[a-z0-9])?$` )
Variables ¶
This section is empty.
Functions ¶
func GetDisks ¶
GetDisks returns a string slice containing the names of all the disks attached to the local instance
func InstanceID ¶
func InstanceID(ctx types.Context) (*types.InstanceID, error)
InstanceID returns the instance ID for the local host.
func IsGCEInstance ¶
IsGCEInstance returns a flag indicating whether the executing host is a GCE instance based on whether or not the metadata URL can be accessed.
func IsValidDiskName ¶
IsValidDiskName returns a boolean of whether the given name is valid for a GCE disk
Types ¶
Click to show internal directories.
Click to hide internal directories.