compute

package
v0.0.0-...-66439cb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package compute contains wrappers around the GCE compute API.

Index

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) Cleanup

func (i *Instance) Cleanup()

Cleanup deletes the Instance.

func (*Instance) GetGuestAttributes

func (i *Instance) GetGuestAttributes(queryPath string) ([]*computeApiBeta.GuestAttributesEntry, error)

GetGuestAttributes gets guest attributes for an instance.

func (*Instance) RecordSerialOutput

func (i *Instance) RecordSerialOutput(ctx context.Context, logsPath string, port int64)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL