Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dashboard import api #8

Open
snoby opened this issue Aug 15, 2017 · 0 comments
Open

dashboard import api #8

snoby opened this issue Aug 15, 2017 · 0 comments

Comments

@snoby
Copy link

snoby commented Aug 15, 2017

Hi,
I noticed that the code is doing some cool stuff to import dashboards via the http interface:

              for file in *-dashboard.json ; do
                if [ -e "$file" ] ; then
                  # wrap exported Grafana dashboard into valid json
                  echo "importing $file" &&
                  (echo '{"dashboard":';cat "$file";echo ',"inputs":[{"name":"DS_PROMETHEUS","pluginId":"prometheus","type":"datasource","value":"prometheus"}]}') | curl --silent --fail --show-error \
                    --request POST http://localhost:3000/api/dashboards/import \
                    --header "Content-Type: application/json" \
                    --data-binary @-;
                  echo "" ;
                fi
              done ;

This seems to be an undocumented api, at least I can't find it on the grafana website. Where can I find more about this api? I've enabled persistent storage and I don't want to import the dashboards every time I bounce the container.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant