Help us shape the future of Go! Take the 2026 Go Developer Survey

gcloud

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstanceIPs

func InstanceIPs(inst *compute.Instance) (intIP, extIP string)

Taken from: https://github.com/golang/build/blob/master/buildlet/gce.go

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func New

func New(opts *Options) (*API, error)

func (*API) Client

func (a *API) Client() *http.Client

func (*API) CreateImage

func (a *API) CreateImage(spec *ImageSpec, overwrite bool) (*compute.Operation, *Pending, error)

CreateImage creates an image on GCE and returns operation details and a Pending. If overwrite is true, an existing image will be overwritten if it exists.

func (*API) CreateInstance

func (a *API) CreateInstance(userdata string, keys []*agent.Key) (*compute.Instance, error)

CreateInstance creates a Google Compute Engine instance.

func (*API) DeleteImage added in v0.6.0

func (a *API) DeleteImage(name string) (*Pending, error)

func (*API) DeprecateImage added in v0.6.0

func (a *API) DeprecateImage(name string, state DeprecationState, replacement string) (*Pending, error)

func (*API) GC added in v0.8.0

func (a *API) GC(gracePeriod time.Duration) error

func (*API) GetConsoleOutput added in v0.6.0

func (a *API) GetConsoleOutput(name string) (string, error)

func (*API) GetPendingForImage added in v0.6.0

func (a *API) GetPendingForImage(image *compute.Image) (*Pending, error)

func (*API) ListImages

func (a *API) ListImages(ctx context.Context, prefix string) ([]*compute.Image, error)

func (*API) ListInstances

func (a *API) ListInstances(prefix string) ([]*compute.Instance, error)

func (*API) NewPending added in v0.6.0

func (a *API) NewPending(desc string, do doable) *Pending

func (*API) TerminateInstance

func (a *API) TerminateInstance(name string) error

type DeprecationState added in v0.6.0

type DeprecationState string
const (
	DeprecationStateActive     DeprecationState = "ACTIVE"
	DeprecationStateDeprecated DeprecationState = "DEPRECATED"
	DeprecationStateObsolete   DeprecationState = "OBSOLETE"
	DeprecationStateDeleted    DeprecationState = "DELETED"
)

type ImageSpec added in v0.6.0

type ImageSpec struct {
	SourceImage string
	Family      string
	Name        string
	Description string
	Licenses    []string // short names
}

type Options

type Options struct {
	Image       string
	Project     string
	Zone        string
	MachineType string
	DiskType    string
	Network     string
	JSONKeyFile string
	GVNIC       bool
	ServiceAuth bool
	*platform.Options
}

type Pending added in v0.6.0

type Pending struct {
	Interval time.Duration
	Timeout  time.Duration // for default progress function
	Progress func(desc string, elapsed time.Duration, op *compute.Operation) error
	// contains filtered or unexported fields
}

func (*Pending) Wait added in v0.6.0

func (p *Pending) Wait() error

Jump to

Keyboard shortcuts

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