Coder Social home page Coder Social logo

Comments (4)

pcuzner avatar pcuzner commented on August 20, 2024

starred dashboards can be added as default dashboards. In our case we can assume there is only one org in grafana, and assign our dashboard as the default to the org, that way any users the customer creates lands on the same home page

Process is as follows (with curl);
get the at-a-glance dashboard
extract the dashboards id (mine was 16)
star the dashboard with
curl -u admin:admin -H "Content-Type: application/json" -X POST http://localhost:3000/api/user/stars/dashboard/16

update the org using a json file (org.json)
{
"name":"Main Org.",
"homeDashboardId":16
}
then
curl -u admin@localhost:admin -H "Content-Type: application/json" -X PUT http://localhost:3000/api/org/preferences --data @org.json

If these steps can be confirmed we could add this to the dashUpdater code.
@zmc when you get a chance can you please confirm the above

from cephmetrics.

zmc avatar zmc commented on August 20, 2024
$ curl -u admin:admin http://XXX:3000/api/dashboards/db/ceph-at-a-glance | jq '.["dashboard"]["id"]'
12
$ curl -u admin:admin -X POST -H "Content-Type: application/json" http://XXX:3000/api/user/stars/dashboard/12
{"message":"Failed to star dashboard"}

Edit: It was already starred! Unstarred and retried, and it worked. Will update with the rest of the steps in a sec

Update: It worked!

$ curl -u admin:admin -H "Content-Type: application/json" -X PUT http://XXX:3000/api/org/preferences --data @/tmp/org.json
{"message":"Preferences updated"}

from cephmetrics.

pcuzner avatar pcuzner commented on August 20, 2024

@zmc I've updated dashUpdater to handle this now. will push tommorrow

from cephmetrics.

pcuzner avatar pcuzner commented on August 20, 2024

commit 9772526 adds this functionality

from cephmetrics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.