Skip to content

Commit a5d8803

Browse files
Bump github.com/grafana/grafana-api-golang-client from 0.9.2 to 0.10.0 (#600)
* Bump github.com/grafana/grafana-api-golang-client from 0.9.2 to 0.10.0 Bumps [github.com/grafana/grafana-api-golang-client](https://github.com/grafana/grafana-api-golang-client) from 0.9.2 to 0.10.0. - [Release notes](https://github.com/grafana/grafana-api-golang-client/releases) - [Commits](grafana/grafana-api-golang-client@v0.9.2...v0.10.0) --- updated-dependencies: - dependency-name: github.com/grafana/grafana-api-golang-client dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Use FolderID Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Julien Duchesne <[email protected]>
1 parent 6803072 commit a5d8803

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.18
55
require (
66
github.com/Masterminds/semver/v3 v3.1.1
77
github.com/grafana/amixr-api-go-client v0.0.4
8-
github.com/grafana/grafana-api-golang-client v0.9.2
8+
github.com/grafana/grafana-api-golang-client v0.10.0
99
github.com/grafana/machine-learning-go-client v0.1.1
1010
github.com/grafana/synthetic-monitoring-agent v0.9.3
1111
github.com/grafana/synthetic-monitoring-api-go-client v0.6.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
114114
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
115115
github.com/grafana/amixr-api-go-client v0.0.4 h1:GD36YNbfZnyJlpfCS4DfvKv2H1oAHDcWL0ujW0rMzOE=
116116
github.com/grafana/amixr-api-go-client v0.0.4/go.mod h1:N6x26XUrM5zGtK5zL5vNJnAn2JFMxLFPPLTw/6pDkFE=
117-
github.com/grafana/grafana-api-golang-client v0.9.2 h1:13Zcl+5tnTgT1pJlYPmveN0s2oUEyBsyAlcGp/n2S/4=
118-
github.com/grafana/grafana-api-golang-client v0.9.2/go.mod h1:24W29gPe9yl0/3A9X624TPkAOR8DpHno490cPwnkv8E=
117+
github.com/grafana/grafana-api-golang-client v0.10.0 h1:R/dgpQOFynP/3Ivoh5SvEPKh4u9YoWuvoOKNe80wkH8=
118+
github.com/grafana/grafana-api-golang-client v0.10.0/go.mod h1:24W29gPe9yl0/3A9X624TPkAOR8DpHno490cPwnkv8E=
119119
github.com/grafana/machine-learning-go-client v0.1.1 h1:Gw6cX8xAd6IVF2LApkXOIdBK8Gzz07B3jQPukecw7fc=
120120
github.com/grafana/machine-learning-go-client v0.1.1/go.mod h1:QFfZz8NkqVF8++skjkKQXJEZfpCYd8S0yTWJUpsLLTA=
121121
github.com/grafana/synthetic-monitoring-agent v0.9.3 h1:1GAjyUMWPYndRF6tux8NWgk97bRFx9RVYMkEMerPNKU=

grafana/data_source_dashboard.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func dataSourceDashboardRead(ctx context.Context, d *schema.ResourceData, meta i
125125
d.Set("config_json", string(configJSONBytes))
126126
d.Set("version", int64(dashboard.Model["version"].(float64)))
127127
d.Set("title", dashboard.Model["title"].(string))
128-
d.Set("folder", dashboard.Folder)
128+
d.Set("folder", dashboard.FolderID)
129129
d.Set("is_starred", dashboard.Meta.IsStarred)
130130
d.Set("slug", dashboard.Meta.Slug)
131131
d.Set("url", strings.TrimRight(gapiURL, "/")+dashboard.Meta.URL)

grafana/resource_dashboard.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ func resourceDashboardV0() *schema.Resource {
139139

140140
// resourceDashboardStateUpgradeV0 migrates from version 0 of this resource's
141141
// schema to version 1.
142-
// * Use UID instead of slug. Slug was deprecated in Grafana 5 in favor of UID.
143-
// Slug API endpoints were removed in Grafana 8.
144-
// * Version field added to schema.
142+
// - Use UID instead of slug. Slug was deprecated in Grafana 5 in favor of UID.
143+
// Slug API endpoints were removed in Grafana 8.
144+
// - Version field added to schema.
145145
func resourceDashboardStateUpgradeV0(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
146146
client := meta.(*client).gapi
147147
dashboardID := int64(rawState["dashboard_id"].(float64))
@@ -216,8 +216,8 @@ func ReadDashboard(ctx context.Context, d *schema.ResourceData, meta interface{}
216216
d.Set("dashboard_id", int64(dashboard.Model["id"].(float64)))
217217
d.Set("version", int64(dashboard.Model["version"].(float64)))
218218
d.Set("url", strings.TrimRight(gapiURL, "/")+dashboard.Meta.URL)
219-
if dashboard.Folder > 0 {
220-
d.Set("folder", strconv.FormatInt(dashboard.Folder, 10))
219+
if dashboard.FolderID > 0 {
220+
d.Set("folder", strconv.FormatInt(dashboard.FolderID, 10))
221221
} else {
222222
d.Set("folder", "")
223223
}
@@ -293,7 +293,7 @@ func makeDashboard(d *schema.ResourceData) (gapi.Dashboard, error) {
293293
}
294294

295295
dashboard := gapi.Dashboard{
296-
Folder: parsedFolder,
296+
FolderID: parsedFolder,
297297
Overwrite: d.Get("overwrite").(bool),
298298
Message: d.Get("message").(string),
299299
}
@@ -335,10 +335,10 @@ func validateDashboardConfigJSON(config interface{}, k string) ([]string, []erro
335335
//
336336
// It removes the following fields:
337337
//
338-
// * `id`: an auto-incrementing ID Grafana assigns to dashboards upon
339-
// creation. We cannot know this before creation and therefore it cannot
340-
// be managed in code.
341-
// * `version`: is incremented by Grafana each time a dashboard changes.
338+
// - `id`: an auto-incrementing ID Grafana assigns to dashboards upon
339+
// creation. We cannot know this before creation and therefore it cannot
340+
// be managed in code.
341+
// - `version`: is incremented by Grafana each time a dashboard changes.
342342
func normalizeDashboardConfigJSON(config interface{}) string {
343343
var dashboardJSON map[string]interface{}
344344
switch c := config.(type) {

grafana/resource_dashboard_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ func testAccDashboardCheckExists(rn string, dashboard *gapi.Dashboard) resource.
201201

202202
func testAccDashboardCheckExistsInFolder(dashboard *gapi.Dashboard, folder *gapi.Folder) resource.TestCheckFunc {
203203
return func(s *terraform.State) error {
204-
if dashboard.Folder != folder.ID && folder.ID != 0 {
205-
return fmt.Errorf("dashboard.Folder(%d) does not match folder.ID(%d)", dashboard.Folder, folder.ID)
204+
if dashboard.FolderID != folder.ID && folder.ID != 0 {
205+
return fmt.Errorf("dashboard.Folder(%d) does not match folder.ID(%d)", dashboard.FolderID, folder.ID)
206206
}
207207
return nil
208208
}

0 commit comments

Comments
 (0)