marathonctl is a CLI tool for Marathon
Switch branches/tags
Clone or download
Seth Hoenig
Latest commit 4863c50 Jul 22, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
hack fix issue #42 : provide a hack/docker-compose.yaml file for manual po… Jan 8, 2018
sample group create and destroy works Apr 6, 2015
.gitignore fix issue #43 : create releases with downloadable binaries Jan 9, 2018
.travis.yml fix issue #32 : add github.com/stretchr/testify to travis.yaml file Jan 8, 2018
Dockerfile changed things May 11, 2018
LICENSE Initial commit Apr 1, 2015
README.md fixup readme with note about binary downloads Jan 9, 2018
app.go Added response body output whenever marathon thwows back an error Jul 20, 2017
artifact.go Show error message if delete failed Aug 31, 2015
category.go separate categories and actions Apr 5, 2015
client.go Added response body output whenever marathon thwows back an error Jul 20, 2017
config.go fix issue #32 : add tests for default configfile locations Jan 8, 2018
config_test.go fix issue #32 : add tests for default configfile locations Jan 8, 2018
deploy.go deploy cancel should be deploy destroy (keep both) Feb 15, 2016
format.go make marathon commands like the others Apr 7, 2015
go.mod requires gox to publish Jul 22, 2018
go.sum requires gox to publish Jul 22, 2018
group.go Added response body output whenever marathon thwows back an error Jul 20, 2017
json.go group list works Apr 6, 2015
main.go fix issue #32 : support for semver semantics Jan 8, 2018
marathon.go Added response body output whenever marathon thwows back an error Jul 20, 2017
release.sh fix minor copy paste typo Jan 9, 2018
task.go Added response body output whenever marathon thwows back an error Jul 20, 2017
version.go fix issue #32 : support for semver semantics Jan 8, 2018
version.sh fix issue #32 : support for semver semantics Jan 8, 2018

README.md

marathonctl

marathonctl is a command line tool for Marathon

Go Report Card Build Status GoDoc License

Install

binary

Binary downloads available! Get the latest from the releases page.

source

go get -u github.com/shoenig/marathonctl

docker

# Add to ~/.bash_aliases
alias marathonctl='docker run --rm --net=host shoenig/marathonctl:latest'

Usage

marathonctl <flags...> [action] <args...>
 Actions
    app
       list                      - list all apps
       versions [id]             - list all versions of apps of id
       show [id]                 - show config and status of app of id (latest version)
       show [id] [version]       - show config and status of app of id and version
       create [jsonfile]         - deploy application defined in jsonfile
       update [id] [jsonfile]    - update application id as defined in jsonfile
       update cpu [id] [cpu%]    - update application id to have cpu% of cpu share
       update memory [id] [MB]   - update application id to have MB of memory
       update instances [id] [N] - update application id to have N instances
       restart [id]              - restart app of id
       destroy [id]              - destroy and remove all instances of id

    task
       list               - list all tasks
       list [id]          - list tasks of app of id
       kill [id]          - kill all tasks of app id
       kill [id] [taskid] - kill task taskid of app id
       queue              - list all queued tasks

    group
       list                        - list all groups
       list [groupid]              - list groups in groupid
       create [jsonfile]           - create a group defined in jsonfile
       update [groupid] [jsonfile] - update group groupid as defined in jsonfile
       destroy [groupid]           - destroy group of groupid

    deploy
       list               - list all active deploys
       destroy [deployid] - cancel deployment of [deployid]

    marathon
       leader   - get the current Marathon leader
       abdicate - force the current leader to relinquish control
       ping     - ping Marathon master host[s]

 Flags
  -c [config file]
  -h [host]
  -u [user:password] (separated by colon)
  -k - allow unverified tls connections
  -f [format]
       human  (simplified columns, default)
       json   (json on one line)
       jsonpp (json pretty printed)
       raw    (the exact response from Marathon)
  -v print git sha1
  -s print semver version

Configuration

  • Specify using "-c [file]" or "-h [host:port]"

Configuration Properties

marathon.host: [hosts] (ex http://node1.indeed.com,http://node2.indeed.com,http://node3.indeed.com)
marathon.user: [user]
marathon.password: [password]

Examples

Ping

  • This example demonstrates -h, -u for host/login information
$ ./marathonctl -h http://marathon1:8080,http://marathon2:8080,http://marathon3:8080 -u user:pass marathon ping
HOST                   DURATION
http://marathon1:8080  11.004071ms
http://marathon2:8080  25.422ms
http://marathon3:8080  6.927772ms

Leader

  • This example demonstrates -c and a file for host/login information
  • This example demonstrates -f and the jsonpp (pretty printed json) output format
$ ./marathonctl -f jsonpp -c /etc/marathonctl.properties marathon leader
{
    "leader": "tst-mcontrol1:8080"
}

Abdicate

  • This example demonstrates -f to specify one-line json output format
 ./marathonctl -f json -c /etc/marathonctl.properties marathon abdicate
{"message":"Leadership abdicted"}

Group List

  • This example demonstrates the default human readable output
$ ./marathonctl -c /etc/marathonctl.properties group list
GROUPID                                     VERSION                   GROUPS  APPS
/                                           2015-04-07T20:29:35.672Z  3       0
/websites                                   2015-04-07T20:29:35.672Z  2       0
/websites/indeed                            2015-04-07T20:29:35.672Z  1       0
/websites/indeed/indeed-pings               2015-04-07T20:29:35.672Z  1       0
/websites/indeed/indeed-pings/a.indeed.com  2015-04-07T20:29:35.672Z  0       2
/websites/google                            2015-04-07T20:29:35.672Z  2       0
/websites/google/news.google.com            2015-04-07T20:29:35.672Z  0       1
/websites/google/calendar.google.com        2015-04-07T20:29:35.672Z  0       1

App Create

  • This example demonstrates creating an app as specified in a json file
$ ./marathonctl -c /etc/marathonctl.properties app create sample/ping.google.json
APPID                VERSION
/hoenig/ping-google  2015-04-07T21:41:53.440Z