digitalocean

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2014 License: MPL-2.0 Imports: 22 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"
View Source
const DefaultImage = "ubuntu-12-04-x64"

see https://api.digitalocean.com/images/?client_id=[client_id]&api_key=[api_key] name="Ubuntu 12.04.4 x64", id=3101045,

View Source
const DefaultRegion = "nyc1"

see https://api.digitalocean.com/regions/?client_id=[client_id]&api_key=[api_key] name="New York", id=1

View Source
const DefaultSize = "512mb"

see https://api.digitalocean.com/sizes/?client_id=[client_id]&api_key=[api_key] name="512MB", id=66 (the smallest droplet size)

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 string, image string, region string, keyId uint, privateNetworking bool) (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) Image added in v0.6.0

func (d DigitalOceanClient) Image(slug_or_name_or_id string) (Image, error)

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) Region added in v0.6.0

func (d DigitalOceanClient) Region(slug_or_name_or_id string) (Region, 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.

func (DigitalOceanClient) Size added in v0.6.0

func (d DigitalOceanClient) Size(slug_or_name_or_id string) (Size, error)

func (DigitalOceanClient) Sizes added in v0.6.0

func (d DigitalOceanClient) Sizes() ([]Size, error)

Returns all available sizes.

type Image

type Image struct {
	Id           uint
	Name         string
	Slug         string
	Distribution string
}

type ImagesResp

type ImagesResp struct {
	Images []Image
}

type Region added in v0.4.0

type Region struct {
	Id   uint
	Name string
	Slug string
}

type RegionsResp added in v0.4.0

type RegionsResp struct {
	Regions []Region
}

type Size added in v0.6.0

type Size struct {
	Id   uint
	Name string
	Slug string
}

type SizesResp added in v0.6.0

type SizesResp struct {
	Sizes []Size
}

Jump to

Keyboard shortcuts

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