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: 9 Imported by: 0

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

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

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

type Config

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

type OptionFunc func(*client)

func Clock

func Clock(clock clock.Clock) OptionFunc

func Timeout

func Timeout(timeout time.Duration) OptionFunc

type VMInfo

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

type VMReplacer

type VMReplacer interface {
	Replace(identifier string) error
}

func NewAWSVMReplacer

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

func NewVMReplacer

func NewVMReplacer(config Config) (VMReplacer, error)

Directories

Path Synopsis
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

Jump to

Keyboard shortcuts

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