Skip to content

Instantly share code, notes, and snippets.

@carlessanagustin
Created December 7, 2018 16:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlessanagustin/a5c3ea4ba0a35c1f57db3ec6aca4bd62 to your computer and use it in GitHub Desktop.
Save carlessanagustin/a5c3ea4ba0a35c1f57db3ec6aca4bd62 to your computer and use it in GitHub Desktop.
Chronograf dashboard import/export tool - EXPERIMENTAL
#!/usr/bin/env bash
URL=$2 # http://localhost:8888
FILENAME=$3 # dashboard.json
if [ $1 == "export" ]; then
curl -i -X GET $URL/chronograf/v1/dashboards > $FILENAME
elif [ $1 == "import" ]; then
curl -i -X POST -H "Content-Type: application/json" $URL/chronograf/v1/dashboards -d @$FILENAME
else
echo "Usage: $0 export|import <URL> <FILENAME>"
fi
# from: https://www.influxdata.com/blog/chronograf-dashboard-definitions/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment