digitalocean

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2013 License: MPL-2.0 Imports: 21 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 url.Values) (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{}) ([]string, 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

func (DigitalOceanClient) RegionName added in v0.4.0

func (d DigitalOceanClient) RegionName(region_id uint) (string, error)

func (DigitalOceanClient) Regions added in v0.4.0

func (d DigitalOceanClient) Regions() ([]Region, error)

Returns all available regions.

func (DigitalOceanClient) ShutdownDroplet added in v0.3.5

func (d DigitalOceanClient) ShutdownDroplet(id uint) error

Shutsdown a droplet. This is a "soft" shutdown.

type Image

type Image struct {
	Id           uint
	Name         string
	Distribution string
}

type ImagesResp

type ImagesResp struct {
	Images []Image
}

type Region added in v0.4.0

type Region struct {
	Id   uint
	Name string
}

type RegionsResp added in v0.4.0

type RegionsResp struct {
	Regions []Region
}

Jump to

Keyboard shortcuts

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