Created
March 19, 2015 16:13
-
-
Save usmanismail/e8b93fb0253ec84fcdf6 to your computer and use it in GitHub Desktop.
A curl wrapper to get container info from the rancher API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
usage(){ | |
echo "Usage: $0 ACCESS_KEY ACCESS_SECRET CONATAINER_ID" | |
exit 1 | |
} | |
# call usage() function if filename not supplied | |
[[ $# -ne 3 ]] && usage | |
ACCESS_KEY=$1 | |
ACCESS_SECRET=$2 | |
CONTAINER_ID=$3 | |
curl -s -u "${ACCESS_KEY}:${ACCESS_SECRET}" -X Get \ | |
-H 'Accept: application/json' \ | |
-H 'Content-Type: application/json' \ | |
"http://rancher.maluuba.com:34080/v1/containers/${CONTAINER_ID}" | python -m json.tool | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment