aws

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2016 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsCommand

type AwsCommand struct {
	*AwsImages
}

AwsCommand implements the images various interfaces, such as Fetcher, Deleter, Modifier, etc..

func NewCommand

func NewCommand(args []string) (*AwsCommand, []string, error)

NewCommand returns a new instance of AwsCommand

func (*AwsCommand) Copy

func (a *AwsCommand) Copy(args []string) error

func (*AwsCommand) Delete

func (a *AwsCommand) Delete(args []string) error

func (*AwsCommand) Help

func (a *AwsCommand) Help(command string) string

Help prints the help message for the given command

func (*AwsCommand) List

func (a *AwsCommand) List(args []string) error

List implements the command.Lister interface

func (*AwsCommand) Modify

func (a *AwsCommand) Modify(args []string) error

Modify manages the tags of the given images. It can create, override or delete tags associated with the given AMI ids.

type AwsConfig

type AwsConfig struct {
	Regions        []string `toml:"regions" json:"regions"`
	RegionsExclude []string `toml:"regions_exclude" json:"regions_exclude"`
	AccessKey      string   `toml:"access_key" json:"access_key"`
	SecretKey      string   `toml:"secret_key" json:"secret_key"`
}

type AwsImages

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

AwsImages is responsible of managing AWS images (AMI's)

func New

func New(conf *AwsConfig) (*AwsImages, error)

func (*AwsImages) CopyImages

func (a *AwsImages) CopyImages(opts *CopyOptions) error

Copy transfers the images to other regions

func (*AwsImages) CreateTags

func (a *AwsImages) CreateTags(tags string, dryRun bool, images ...string) error

CreateTags adds or overwrites all tags for the specified images. Tags is in the form of "key1=val1,key2=val2,key3,key4=". One or more tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value (i.e: "key3" or "key4=" both works)

func (*AwsImages) DeleteImages

func (a *AwsImages) DeleteImages(opts *DeleteOptions) error

Delete deletes the given images.

func (*AwsImages) DeleteTags

func (a *AwsImages) DeleteTags(tags string, dryRun bool, images ...string) error

DeleteTags deletes the given tags for the given images. Tags is in the form of "key1=val1,key2=val2,key3,key4=" One or more tags to delete. If you omit the value parameter(i.e "key3"), we delete the tag regardless of its value. If you specify this parameter with an empty string (i.e: "key4=" as the value, we delete the key only if its value is an empty string.

func (*AwsImages) Images

func (a *AwsImages) Images(input *ec2.DescribeImagesInput) (Images, error)

type CopyOptions

type CopyOptions struct {
	// Image to be copied to other regions
	ImageID string

	// SourceRegions defines a list of regions  which the image
	// is being copied. i.e: ["us-east-1", "eu-west-1"]
	SourceRegions []string

	// Descroption for the newly created AMI (optional)
	Desc string

	// DryRun doesn't run the command, but shows the action
	DryRun bool
	// contains filtered or unexported fields
}

type DeleteOptions

type DeleteOptions struct {
	// Images to be deleted
	ImageIds []string

	// DryRun doesn't run the command, but shows the action
	DryRun bool
	// contains filtered or unexported fields
}

type Images

type Images map[string][]*ec2.Image

Images defines and represents regions to images

func (Images) Print

func (i Images) Print(mode utils.OutputMode) error

Print prints the images to standard output.

func (Images) RegionFromId

func (i Images) RegionFromId(id string) (string, error)

RegionFromId returns the region for the given id

Jump to

Keyboard shortcuts

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