Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit 68bdb78

Browse files
Dashboard: Get folder UID from reads (#147)
It's easier to manage folders with UIDs than IDs. This will be used to add that functionality to the Terraform provider
1 parent 03fc2f5 commit 68bdb78

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

dashboard.go

+9-8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type DashboardMeta struct {
1212
IsStarred bool `json:"isStarred"`
1313
Slug string `json:"slug"`
1414
Folder int64 `json:"folderId"`
15+
FolderUID int64 `json:"folderUid"`
1516
URL string `json:"url"`
1617
}
1718

@@ -26,14 +27,14 @@ type DashboardSaveResponse struct {
2627

2728
// Dashboard represents a Grafana dashboard.
2829
type Dashboard struct {
29-
Meta DashboardMeta `json:"meta"`
30-
Model map[string]interface{} `json:"dashboard"`
31-
FolderID int64 `json:"folderId"`
32-
FolderUID string `json:"folderUid"`
33-
Overwrite bool `json:"overwrite"`
34-
35-
// This is only used when creating a new dashboard, it will always be empty when getting a dashboard.
36-
Message string `json:"message"`
30+
Meta DashboardMeta `json:"meta"`
31+
Model map[string]interface{} `json:"dashboard"`
32+
FolderID int64 `json:"folderId"`
33+
34+
// These fields are only used when creating a new dashboard, they will always be empty when getting a dashboard.
35+
Overwrite bool `json:"overwrite,omitempty"`
36+
Message string `json:"message,omitempty"`
37+
FolderUID string `json:"folderUid,omitempty"`
3738
}
3839

3940
// SaveDashboard is a deprecated method for saving a Grafana dashboard. Use NewDashboard.

0 commit comments

Comments
 (0)