Documentation ¶
Overview ¶
Package command contains functions that can be invoked via command-line e.g. "chaosmonkey schedule" invokes command.Schedule
Index ¶
- Constants
- func DumpConfig(c chaosmonkey.AppConfigGetter, app string)
- func DumpMonkeyConfig(cfg *config.Monkey)
- func Eligible(g chaosmonkey.AppConfigGetter, d deploy.Deployment, ...)
- func EnsureFileAbsent(path string) error
- func Execute()
- func FetchSchedule(s schedstore.SchedStore, cfg *config.Monkey)
- func Install(cfg *config.Monkey, exec CurrentExecutable, db mysql.MySQL)
- func InstallCron(cfg *config.Monkey, exec CurrentExecutable)
- func Migrate(db mysql.MySQL)
- func Outage(ou chaosmonkey.Outage)
- func Schedule(g chaosmonkey.AppConfigGetter, ss schedstore.SchedStore, cfg *config.Monkey, ...)
- func Terminate(d deps.Deps, app string, account string, region string, stack string, ...)
- func Usage()
- type ChaosmonkeyExecutable
- type CurrentExecutable
Constants ¶
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 ¶
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 ¶
EnsureFileAbsent ensures that a file is absent, returning an error otherwise
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 Outage ¶
func Outage(ou chaosmonkey.Outage)
Outage prints out "true" if an ongoing outage, else "false"
func Schedule ¶
func Schedule(g chaosmonkey.AppConfigGetter, ss schedstore.SchedStore, cfg *config.Monkey, d deploy.Deployment, apps []string)
Schedule executes the "schedule" command. This defines the schedule of terminations for the day and records them as cron jobs
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