cliaas

package module
v0.0.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2017 License: Apache-2.0 Imports: 8 Imported by: 2

README

cliaas

cliaas wraps multiple IaaS-specific libraries to perform some IaaS-agnostic functions. Presently it only supports upgrading a Pivotal Cloud Foundry Operations Manager VM.

Installing

Download the latest release.

Install from source

Requirements:

go get github.com/pivotal-cf/cliaas
cd $GOPATH/src/github.com/pivotal-cf/cliaas
glide install
go install github.com/pivotal-cf/cliaas/cmd/cliaas

Usage

cliaas -c config.yml replace-vm -i vm-identifier

Config

The -c, --config= flag is for specifying a YAML file with IaaS-specific configuration options to use when running a command. The config should only contain the configuration for a single IaaS for now.

AWS-specific Config
cat > config.yml <<EOF
  aws:
    access_key_id: example-access-key-id
    secret_access_key: example-secret-access-key
    region: us-east-1
    vpc: vpc-12345678
    ami: ami-019e4617
EOF
  • access_key_id: The AWS_ACCESS_KEY_ID to use. Must have the ability to stop VM, start VM, and associate an IP address.
  • secret_access_key: The AWS_SECRET_ACCESS_KEY to use. Must have the ability to stop VM, start VM, and associate an IP address.
  • region: The AWS region to use.
  • vpc: The AWS vpc to use.
  • ami: A Pivotal Cloud Foundry Operations Manager AMI, for the new VM in replace-vm.

Developing

go install github.com/onsi/ginkgo/ginkgo
ginkgo -r -p -race -skipPackage integration

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "0.0.0-dev"

Functions

This section is empty.

Types

type AWSClient added in v0.1.0

type AWSClient interface {
	CreateVM(ami, instanceType, name, keyName, subnetID, securityGroupID string) (string, error)
	DeleteVM(instanceID string) error
	GetVMInfo(name string) (VMInfo, error)
	StopVM(instanceID string) error
	AssignPublicIP(instance, ip string) error
	WaitForStatus(instanceID string, status string) error
}

func NewAWSClient added in v0.1.0

func NewAWSClient(
	ec2Client EC2Client,
	vpcName string,
	options ...OptionFunc,
) AWSClient

type Config added in v0.1.0

type Config struct {
	AWS struct {
		AccessKeyID     string `yaml:"access_key_id"`
		SecretAccessKey string `yaml:"secret_access_key"`
		Region          string `yaml:"region"`
		VPC             string `yaml:"vpc"`
		AMI             string `yaml:"ami"`
	} `yaml:"aws"`
}

type OptionFunc added in v0.1.0

type OptionFunc func(*client)

func Clock added in v0.1.0

func Clock(clock clock.Clock) OptionFunc

func Timeout added in v0.1.0

func Timeout(timeout time.Duration) OptionFunc

type VMInfo added in v0.1.0

type VMInfo struct {
	InstanceID       string
	InstanceType     string
	KeyName          string
	SubnetID         string
	SecurityGroupIDs []string
	PublicIP         string
}

type VMReplacer added in v0.1.0

type VMReplacer interface {
	Replace(identifier string) error
}

func NewAWSVMReplacer added in v0.1.0

func NewAWSVMReplacer(
	accessKeyID string,
	secretAccessKey string,
	region string,
	vpc string,
	ami string,
) (VMReplacer, error)

func NewVMReplacer added in v0.1.0

func NewVMReplacer(config Config) (VMReplacer, error)

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter
cmd
gcp
gcp/gcpfakes
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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