Documentation ¶
Overview ¶
Package compute contains wrappers around the GCE compute API.
Index ¶
- func BuildInstanceMetadataItem(key, value string) *computeApi.MetadataItems
- type Instance
- func (i *Instance) AddMetadata(mdi ...*computeApi.MetadataItems) error
- func (i *Instance) Cleanup()
- func (i *Instance) GetGuestAttributes(queryPath string) ([]*computeApiBeta.GuestAttributesEntry, error)
- func (i *Instance) RecordSerialOutput(ctx context.Context, logsPath string, port int64)
- func (i *Instance) WaitForGuestAttributes(queryPath string, interval, timeout time.Duration) ([]*computeApiBeta.GuestAttributesEntry, error)
- func (i *Instance) WaitForSerialOutput(positiveRegexes []*regexp.Regexp, negativeRegexes []*regexp.Regexp, port int64, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildInstanceMetadataItem ¶
func BuildInstanceMetadataItem(key, value string) *computeApi.MetadataItems
BuildInstanceMetadataItem create an metadata item
Types ¶
type Instance ¶
type Instance struct { *computeApi.Instance Project, Zone string // contains filtered or unexported fields }
Instance is a compute instance.
func CreateInstance ¶
func CreateInstance(client daisyCompute.Client, project, zone string, i *computeApi.Instance) (*Instance, error)
CreateInstance creates a compute instance.
func (*Instance) AddMetadata ¶
func (i *Instance) AddMetadata(mdi ...*computeApi.MetadataItems) error
AddMetadata adds metadata to the instance.
func (*Instance) GetGuestAttributes ¶
func (i *Instance) GetGuestAttributes(queryPath string) ([]*computeApiBeta.GuestAttributesEntry, error)
GetGuestAttributes gets guest attributes for an instance.
func (*Instance) RecordSerialOutput ¶
RecordSerialOutput stores the serial output of an instance to GCS bucket
func (*Instance) WaitForGuestAttributes ¶
func (i *Instance) WaitForGuestAttributes(queryPath string, interval, timeout time.Duration) ([]*computeApiBeta.GuestAttributesEntry, error)
WaitForGuestAttributes waits for guest attribute (queryPath, variableKey) to appear.
func (*Instance) WaitForSerialOutput ¶
func (i *Instance) WaitForSerialOutput(positiveRegexes []*regexp.Regexp, negativeRegexes []*regexp.Regexp, port int64, interval, timeout time.Duration) error
WaitForSerialOutput waits for all positive regex matches and reports error for any negative regex match on a serial port.
Click to show internal directories.
Click to hide internal directories.