digitalocean

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2013 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const BuilderId = "pearkes.digitalocean"

The unique id for the builder

View Source
const DIGITALOCEAN_API_URL = "https://api.digitalocean.com"

Variables

This section is empty.

Functions

func NewRequest

func NewRequest(d DigitalOceanClient, path string, params string) (map[string]interface{}, error)

Sends an api request and returns a generic map[string]interface of the response.

Types

type Artifact

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

func (*Artifact) BuilderId

func (*Artifact) BuilderId() string

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

func (*Artifact) Files

func (*Artifact) Files() []string

func (*Artifact) Id

func (a *Artifact) Id() string

func (*Artifact) String

func (a *Artifact) String() string

type Builder

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

func (*Builder) Cancel

func (b *Builder) Cancel()

func (*Builder) Prepare

func (b *Builder) Prepare(raws ...interface{}) error

func (*Builder) Run

func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error)

type DigitalOceanClient

type DigitalOceanClient struct {

	// The base URL of the API
	BaseURL string

	// Credentials
	ClientID string
	APIKey   string
	// contains filtered or unexported fields
}

func (DigitalOceanClient) CreateDroplet

func (d DigitalOceanClient) CreateDroplet(name string, size uint, image uint, region uint, keyId uint) (uint, error)

Creates a droplet and returns it's id

func (DigitalOceanClient) CreateKey

func (d DigitalOceanClient) CreateKey(name string, pub string) (uint, error)

Creates an SSH Key and returns it's id

func (DigitalOceanClient) CreateSnapshot

func (d DigitalOceanClient) CreateSnapshot(id uint, name string) error

Creates a snaphot of a droplet by it's ID

func (DigitalOceanClient) DestroyDroplet

func (d DigitalOceanClient) DestroyDroplet(id uint) error

Destroys a droplet

func (DigitalOceanClient) DestroyImage

func (d DigitalOceanClient) DestroyImage(id uint) error

Destroys an image by its ID.

func (DigitalOceanClient) DestroyKey

func (d DigitalOceanClient) DestroyKey(id uint) error

Destroys an SSH key

func (DigitalOceanClient) DropletStatus

func (d DigitalOceanClient) DropletStatus(id uint) (string, string, error)

Returns DO's string representation of status "off" "new" "active" etc.

func (DigitalOceanClient) Images

func (d DigitalOceanClient) Images() ([]Image, error)

Returns all available images.

func (DigitalOceanClient) New

func (d DigitalOceanClient) New(client string, key string) *DigitalOceanClient

Creates a new client for communicating with DO

func (DigitalOceanClient) PowerOffDroplet

func (d DigitalOceanClient) PowerOffDroplet(id uint) error

Powers off a droplet

type Image

type Image struct {
	Id           uint
	Name         string
	Distribution string
}

type ImagesResp

type ImagesResp struct {
	Images []Image
}

Jump to

Keyboard shortcuts

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