Grafana: Use latest dashboard revision in import reference script (#14778)

This commit is contained in:
Tung Leo 2024-04-16 23:00:40 +07:00 committed by GitHub
parent 58b5eb322f
commit 458dca078d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ $ # The version of Istio to deploy
$ VERSION={{< istio_full_version >}}
$ # Import all Istio dashboards
$ for DASHBOARD in 7639 11829 7636 7630 7645 13277; do
$ REVISION="$(curl -s https://grafana.com/api/dashboards/${DASHBOARD}/revisions -s | jq ".items[] | select(.description | contains(\"${VERSION}\")) | .revision")"
$ REVISION="$(curl -s https://grafana.com/api/dashboards/${DASHBOARD}/revisions -s | jq ".items[] | select(.description | contains(\"${VERSION}\")) | .revision" | tail -n 1)"
$ curl -s https://grafana.com/api/dashboards/${DASHBOARD}/revisions/${REVISION}/download > /tmp/dashboard.json
$ echo "Importing $(cat /tmp/dashboard.json | jq -r '.title') (revision ${REVISION}, id ${DASHBOARD})..."
$ curl -s -k -u "$GRAFANA_CRED" -XPOST \