diff --git a/dashboard.go b/dashboard.go index e30ab20c..683a879f 100644 --- a/dashboard.go +++ b/dashboard.go @@ -12,7 +12,7 @@ type DashboardMeta struct { IsStarred bool `json:"isStarred"` Slug string `json:"slug"` Folder int64 `json:"folderId"` - FolderUID int64 `json:"folderUid"` + FolderUID string `json:"folderUid"` URL string `json:"url"` } @@ -27,10 +27,12 @@ type DashboardSaveResponse struct { // Dashboard represents a Grafana dashboard. type Dashboard struct { - Meta DashboardMeta `json:"meta"` Model map[string]interface{} `json:"dashboard"` FolderID int64 `json:"folderId"` + // This field is read-only. It is not used when creating a new dashboard. + Meta DashboardMeta `json:"meta"` + // These fields are only used when creating a new dashboard, they will always be empty when getting a dashboard. Overwrite bool `json:"overwrite,omitempty"` Message string `json:"message,omitempty"` diff --git a/dashboard_test.go b/dashboard_test.go index ba79e030..aa38c17d 100644 --- a/dashboard_test.go +++ b/dashboard_test.go @@ -26,7 +26,9 @@ const ( "meta": { "isStarred": false, "url": "/d/cIBgcSjkk/production-overview", - "slug": "production-overview" + "slug": "production-overview", + "folderID": 3, + "folderUid": "test" } }`