command

package
v2.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2016 License: Apache-2.0 Imports: 23 Imported by: 15

Documentation

Overview

Package command contains functions that can be invoked via command-line e.g. "chaosmonkey schedule" invokes command.Schedule

Index

Constants

View Source
const Version = "2.0.2"

Version is the version number

Variables

This section is empty.

Functions

func DumpConfig

func DumpConfig(c chaosmonkey.AppConfigGetter, app string)

DumpConfig dumps the config for an app to stdout

func DumpMonkeyConfig

func DumpMonkeyConfig(cfg *config.Monkey)

DumpMonkeyConfig dumps the monkey-level config parameters to stdout

func Eligible

func Eligible(g chaosmonkey.AppConfigGetter, d deploy.Deployment, app, account, region, stack, cluster string)

Eligible prints out a list of instance ids eligible for termination It is intended only for testing

func EnsureFileAbsent

func EnsureFileAbsent(path string) error

EnsureFileAbsent ensures that a file is absent, returning an error otherwise

func Execute

func Execute()

Execute is the main entry point for the chaosmonkey cli.

func FetchSchedule

func FetchSchedule(s schedstore.SchedStore, cfg *config.Monkey)

FetchSchedule executes the "fetch-schedule" command. This checks if there is an existing schedule for today that was previously registered in chaosmonkey-api. If so, it downloads the schedule from chaosmonkey-api and installs it locally.

func Install

func Install(cfg *config.Monkey, exec CurrentExecutable, db mysql.MySQL)

Install installs chaosmonkey and runs database migration

func InstallCron

func InstallCron(cfg *config.Monkey, exec CurrentExecutable)

InstallCron installs chaosmonkey schedule generation cron

func Migrate

func Migrate(db mysql.MySQL)

Migrate executes database migration

func Outage

func Outage(ou chaosmonkey.Outage)

Outage prints out "true" if an ongoing outage, else "false"

func Schedule

Schedule executes the "schedule" command. This defines the schedule of terminations for the day and records them as cron jobs

func Terminate

func Terminate(d deps.Deps, app string, account string, region string, stack string, cluster string)

Terminate executes the "terminate" command. This selects an instance based on the app, account, region, stack, cluster passed

region, stack, and cluster may be blank

func Usage

func Usage()

Usage prints usage

Types

type ChaosmonkeyExecutable

type ChaosmonkeyExecutable struct {
}

ChaosmonkeyExecutable is a representation of Chaosmonkey executable

func (ChaosmonkeyExecutable) ExecutablePath

func (e ChaosmonkeyExecutable) ExecutablePath() (string, error)

ExecutablePath implements command.CurrentExecutable.ExecutablePath

type CurrentExecutable

type CurrentExecutable interface {
	// ExecutablePath returns the path to current executable
	ExecutablePath() (string, error)
}

CurrentExecutable provides an interface to extract information about the current executable

Jump to

Keyboard shortcuts

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