Is there a way to query the list of grafana dashboards
Asked Answered
C

2

10

I have a requirement to list down all the dashboards available in the grafana server and list down all of them as a navigational list in my UI application. Is this even possible.

Caulescent answered 8/2, 2018 at 0:22 Comment(0)
C
14

Grafana exposes a Search API which could be used to retrieve all the dashboards available

http://<HOST>:<PORT>/api/search?query=%

Sample Response:

[
   {
      "id":2,
      "title":"Dashboard1",
      "uri":"db/Dashboard1",
      "type":"dash-db",
      "tags":[

      ],
      "isStarred":false
   },
   {
      "id":1,
      "title":"Service-Dashboard",
      "uri":"db/Service-Dashboard",
      "type":"dash-db",
      "tags":[

      ],
      "isStarred":false
   }
]

The response has a field by name uri which has the relative path from which the dashboard path can be constructed as

 http://<HOST>:<PORT>/dashboard/<uri>
Ceratoid answered 8/2, 2018 at 3:37 Comment(0)
R
1

https://<grafana>/api/search?type=dash-db

Reverend answered 12/12, 2022 at 20:28 Comment(1)
it's important to provide not only code, but also a clear and concise explanation of what the code is doing and why it is relevant to the question or problem at hand. This helps other users understand the context and purpose of the code, and can also make it easier for them to understand how to modify or extend the code to fit their own needs.Encipher

© 2022 - 2024 — McMap. All rights reserved.