grafana-tools / grafana-backup

[ON HOLD] CLI tool for backup/restore Grafana dashboards and datasources.
GNU General Public License v3.0
28 stars 3 forks source link

How do we want to handle existing datasources #10

Closed omadawn closed 6 years ago

omadawn commented 6 years ago

The datasource API does not provides "Create or update" method like the dashboard API.

So we have a couple of options:

Use the "Create" method and return an error if it already exists.

Check to see if the datasource already exists and use the appropriate method. This could allow us to error out if it exists unless -force is provided.

Howerver it would be significantly more work to implement.

omadawn commented 6 years ago

Just answered my own question. Based on the usage message this should throw an error unless -force is applied.