Skip to content

Instantly share code, notes, and snippets.

@enxebre
Last active February 16, 2016 10:49
Show Gist options
  • Select an option

  • Save enxebre/59e732507104bbcc14d6 to your computer and use it in GitHub Desktop.

Select an option

Save enxebre/59e732507104bbcc14d6 to your computer and use it in GitHub Desktop.
Easy and quick debugging a Mesos/Marathon/Consul Cluster. Load the file by ". mesos-cluster.sh". Use it
#!/bin/bash
# Just because I'm tired of copy/paste from evernote.
export MARATHON_URL=${MARATHON_URL:-'127.0.0.1:8080'}
export CONSUL_URL=${CONSUL_URL:-'127.0.0.1:8500'}
export MESOS_URL=${MESOS_URL:-'127.0.0.1:5050'}
function mesosHealth() {
curl -v -x '' "${MESOS_URL}"/master/health
}
function mesosVersion() {
curl -v -x '' "${MESOS_URL}"/version
}
function marathonDeploy() {
curl -v -XPOST -x '' "${MARATHON_URL}"/v2/"${1}" -d@"${2}" -H "Content-type: application/json"
}
function marathonDelete() {
curl -v -XDELETE -x '' "${MARATHON_URL}"/v2/"${1}"/"${2}"
}
function marathonApps() {
curl -v -x '' "${MARATHON_URL}"/v2/apps
}
function marathonEventSubscriptions() {
curl -v -x '' "${MARATHON_URL}"/v2/eventSubscriptions
}
function marathonPing() {
curl -v -x '' "${MARATHON_URL}"/ping
}
function marathonLogging() {
curl -v -x '' "${MARATHON_URL}"/Logging
}
function marathonMetrics() {
curl -v -x '' "${MARATHON_URL}"/metrics
}
function consulServices() {
curl -v -x '' "${CONSUL_URL}"/v1/catalog/services
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment