forked from grafana/grafana-api-golang-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfolder_dashboard_search.go
29 lines (26 loc) · 964 Bytes
/
folder_dashboard_search.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package gapi
import (
"net/url"
)
// FolderDashboardSearchResponse represents the Grafana API dashboard search response.
type FolderDashboardSearchResponse struct {
ID uint `json:"id"`
UID string `json:"uid"`
Title string `json:"title"`
URI string `json:"uri"`
URL string `json:"url"`
Slug string `json:"slug"`
Type string `json:"type"`
Tags []string `json:"tags"`
IsStarred bool `json:"isStarred"`
FolderID uint `json:"folderId"`
FolderUID string `json:"folderUid"`
FolderTitle string `json:"folderTitle"`
FolderURL string `json:"folderUrl"`
}
// FolderDashboardSearch uses the folder and dashboard search endpoint to find
// dashboards based on the params passed in.
func (c *Client) FolderDashboardSearch(params url.Values) (resp []FolderDashboardSearchResponse, err error) {
err = c.request("GET", "/api/search", params, nil, &resp)
return
}