do

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateFakeKey

func GenerateFakeKey() (string, error)

GenerateFakeKey generates a SSH key pair, returns the public key, and discards the private key. This is useful for droplets that don't need a public key, since DO insists on requiring one.

Types

type API

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

func New

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

func (*API) AddKey

func (a *API) AddKey(ctx context.Context, name, key string) (int, error)

func (*API) CreateDroplet

func (a *API) CreateDroplet(ctx context.Context, name string, sshKeyID int, userdata string) (*godo.Droplet, error)

func (*API) DeleteDroplet

func (a *API) DeleteDroplet(ctx context.Context, dropletID int) error

func (*API) DeleteImage

func (a *API) DeleteImage(ctx context.Context, imageID int) error

func (*API) DeleteKey

func (a *API) DeleteKey(ctx context.Context, keyID int) error

func (*API) GC

func (a *API) GC(ctx context.Context, gracePeriod time.Duration) error

func (*API) GetDroplet

func (a *API) GetDroplet(ctx context.Context, dropletID int) (*godo.Droplet, error)

func (*API) GetUserImage

func (a *API) GetUserImage(ctx context.Context, imageName string, inRegion bool) (*godo.Image, error)

func (*API) PreflightCheck

func (a *API) PreflightCheck(ctx context.Context) error

func (*API) SnapshotDroplet

func (a *API) SnapshotDroplet(ctx context.Context, dropletID int, name string) error

SnapshotDroplet creates a snapshot of a droplet and waits until complete. The Snapshot API doesn't return the snapshot ID, so we don't either.

type Options

type Options struct {
	*platform.Options

	// Config file. Defaults to $HOME/.config/digitalocean.json.
	ConfigPath string
	// Profile name
	Profile string
	// Personal access token (overrides config profile)
	AccessToken string

	// Region slug (e.g. "sfo2")
	Region string
	// Droplet size slug (e.g. "512mb")
	Size string
	// Numeric image ID, {alpha, beta, stable}, or user image name
	Image string
}

Jump to

Keyboard shortcuts

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