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

Commit

Permalink
Dashboard: Get folder UID from reads (#147)
Browse files Browse the repository at this point in the history
It's easier to manage folders with UIDs than IDs. This will be used to add that functionality to the Terraform provider
  • Loading branch information
julienduchesne authored Apr 27, 2023
1 parent 03fc2f5 commit 68bdb78
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type DashboardMeta struct {
IsStarred bool `json:"isStarred"`
Slug string `json:"slug"`
Folder int64 `json:"folderId"`
FolderUID int64 `json:"folderUid"`
URL string `json:"url"`
}

Expand All @@ -26,14 +27,14 @@ 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"`
FolderUID string `json:"folderUid"`
Overwrite bool `json:"overwrite"`

// This is only used when creating a new dashboard, it will always be empty when getting a dashboard.
Message string `json:"message"`
Meta DashboardMeta `json:"meta"`
Model map[string]interface{} `json:"dashboard"`
FolderID int64 `json:"folderId"`

// 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"`
FolderUID string `json:"folderUid,omitempty"`
}

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

0 comments on commit 68bdb78

Please sign in to comment.