List data sources via API

List the names of all configured data sources

curl -s http://admin:admin@localhost:3000/api/datasources | jq .[].name

tool
grafana11 commands
tags
grafanaapidatasource

More grafana commands

  • curl -X POST -H "Content-Type: application/json" -d @ds.json http://admin:admin@localhost:3000/api/datasources

    Add a new data source through the Grafana API

  • # Place YAML in /etc/grafana/provisioning/dashboards/

    Grafana auto-loads dashboards from provisioning directory on startup

  • cat > /etc/grafana/provisioning/dashboards/default.yaml <<EOF apiVersion: 1 providers: - name: default type: file folder: '' options: path: /var/lib/grafana/dashboards EOF

    Create a provisioning config for Grafana dashboards, then restart Grafana

  • systemctl start grafana-server

    Start the Grafana service with systemd

  • systemctl status grafana-server

    Check if the Grafana service is running

all 11 grafana commands