This section is empty.


This section is empty.


This section is empty.


type API

type API struct {
	// contains filtered or unexported fields

func New

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

    New creates a new AWS API wrapper. It uses credentials from any of the standard credentials sources, including the environment and the profile configured in ~/.aws. No validation is done that credentials exist and before using the API a preflight check is recommended via api.PreflightCheck

    func (*API) AddKey

    func (a *API) AddKey(name, key string) error

    func (*API) CheckInstances

    func (a *API) CheckInstances(ids []*string, d time.Duration) error

      CheckInstances waits until a set of EC2 instances are accessible by SSH, waiting a maximum of 'd' time.

      func (*API) CopyImage

      func (a *API) CopyImage(sourceImageID string, regions []string) (map[string]string, error)

      func (*API) CreateHVMImage

      func (a *API) CreateHVMImage(snapshotID string, name string, description string) (string, error)

      func (*API) CreateImportRole

      func (a *API) CreateImportRole(bucket string) error

      func (*API) CreateInstances

      func (a *API) CreateInstances(keyname, userdata string, count uint64, wait bool) ([]*ec2.Instance, error)

        CreateInstances creates EC2 instances with a given ssh key name, user data. The image ID, instance type, and security group set in the API will be used. If wait is true, CreateInstances will block until all instances are reachable by SSH.

        func (*API) CreatePVImage

        func (a *API) CreatePVImage(snapshotID string, name string, description string) (string, error)

        func (*API) CreateSnapshot

        func (a *API) CreateSnapshot(imageName, sourceURL string, format EC2ImageFormat) (*Snapshot, error)

          CreateSnapshot creates an AWS Snapshot

          func (*API) CreateTags

          func (a *API) CreateTags(resources []string, tags map[string]string) error

          func (*API) DeleteKey

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

          func (*API) DeleteObject

          func (a *API) DeleteObject(bucket, path string) error

          func (*API) FindImage

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

            Find an image we own with the specified name. Return ID or "".

            func (*API) FindSnapshot

            func (a *API) FindSnapshot(imageName string) (*Snapshot, error)

              Look up a Snapshot by name. Return nil if not found.

              func (*API) GrantLaunchPermission

              func (a *API) GrantLaunchPermission(imageID string, userIDs []string) error

              func (*API) InitializeBucket

              func (a *API) InitializeBucket(bucket string) error

              func (*API) PreflightCheck

              func (a *API) PreflightCheck() error

                PreflightCheck validates that the aws configuration provided has valid credentials

                func (*API) PublishImage

                func (a *API) PublishImage(imageID string) error

                  Grant everyone launch permission on the specified image and create-volume permission on its underlying snapshot.

                  func (*API) TerminateInstance

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

                    TerminateInstance schedules an EC2 instance to be terminated.

                    func (*API) UploadObject

                    func (a *API) UploadObject(r io.Reader, bucket, path string, force bool) error

                      UploadObject uploads an object to S3

                      type EC2ImageFormat

                      type EC2ImageFormat string
                      const (
                      	EC2ImageFormatRaw  EC2ImageFormat = ec2.DiskImageFormatRaw
                      	EC2ImageFormatVmdk                = ec2.DiskImageFormatVmdk

                      func (*EC2ImageFormat) Set

                      func (e *EC2ImageFormat) Set(s string) error

                      func (*EC2ImageFormat) String

                      func (e *EC2ImageFormat) String() string

                      func (*EC2ImageFormat) Type

                      func (e *EC2ImageFormat) Type() string

                      type EC2ImageType

                      type EC2ImageType string
                      const (
                      	EC2ImageTypeHVM EC2ImageType = "hvm"
                      	EC2ImageTypePV  EC2ImageType = "paravirtual"

                      type Options

                      type Options struct {
                      	// The AWS region regional api calls should use
                      	Region string
                      	// The path to the shared credentials file, if not ~/.aws/credentials
                      	CredentialsFile string
                      	// The profile to use when resolving credentials, if applicable
                      	Profile string
                      	// AccessKeyID is the optional access key to use. It will override all other sources
                      	AccessKeyID string
                      	// SecretKey is the optional secret key to use. It will override all other sources
                      	SecretKey string
                      	AMI           string
                      	InstanceType  string
                      	SecurityGroup string

                      type Snapshot

                      type Snapshot struct {
                      	SnapshotID string