Skip to content

Commit bbb20e9

Browse files
julienduchesneYury Bushmelev
andauthored
Fix json_data field types for opentsdb datasource (#398)
* Fix json_data field types for opentsdb datasource `tsdb_resolution` and `tsdb_version` were declared as strings though those fields are integers. * Update client * Generate docs Co-authored-by: Yury Bushmelev <[email protected]>
1 parent e6aa9ae commit bbb20e9

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

docs/resources/data_source.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ Optional:
146146
- **tls_auth_with_ca_cert** (Boolean) (All) Enable TLS authentication using CA cert.
147147
- **tls_skip_verify** (Boolean) (All) Controls whether a client verifies the server’s certificate chain and host name.
148148
- **token_uri** (String) (Stackdriver) The token URI used, provided in the service account key.
149-
- **tsdb_resolution** (String) (OpenTSDB) Resolution.
150-
- **tsdb_version** (String) (OpenTSDB) Version.
149+
- **tsdb_resolution** (Number) (OpenTSDB) Resolution.
150+
- **tsdb_version** (Number) (OpenTSDB) Version.
151151
- **version** (String) (InfluxDB) InfluxQL or Flux.
152152
- **workgroup** (String) (Athena) Workgroup to use.
153153

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.16
44

55
require (
66
github.com/Masterminds/semver/v3 v3.1.1
7-
github.com/grafana/grafana-api-golang-client v0.3.1
7+
github.com/grafana/grafana-api-golang-client v0.4.0
88
github.com/grafana/machine-learning-go-client v0.1.1
99
github.com/grafana/synthetic-monitoring-agent v0.6.2
1010
github.com/grafana/synthetic-monitoring-api-go-client v0.5.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,8 @@ github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51
455455
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
456456
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
457457
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
458-
github.com/grafana/grafana-api-golang-client v0.3.1 h1:QrHv0RKrYmhVvDN3Pyr+KcoPWY5HG2FEJDz+6fh7y9Y=
459-
github.com/grafana/grafana-api-golang-client v0.3.1/go.mod h1:24W29gPe9yl0/3A9X624TPkAOR8DpHno490cPwnkv8E=
458+
github.com/grafana/grafana-api-golang-client v0.4.0 h1:lUaTh8G4vHtG3mKg4bkZrZsYvraWq8nTeKXWLAY+CoA=
459+
github.com/grafana/grafana-api-golang-client v0.4.0/go.mod h1:24W29gPe9yl0/3A9X624TPkAOR8DpHno490cPwnkv8E=
460460
github.com/grafana/machine-learning-go-client v0.1.1 h1:Gw6cX8xAd6IVF2LApkXOIdBK8Gzz07B3jQPukecw7fc=
461461
github.com/grafana/machine-learning-go-client v0.1.1/go.mod h1:QFfZz8NkqVF8++skjkKQXJEZfpCYd8S0yTWJUpsLLTA=
462462
github.com/grafana/synthetic-monitoring-agent v0.6.2 h1:JGTdlcu8y/ujwGQwTs1q9b1RLAQUr5oV1v4r7Cz5O9g=

grafana/resource_data_source.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,12 @@ source selected (via the 'type' argument).
318318
Description: "(Stackdriver) The token URI used, provided in the service account key.",
319319
},
320320
"tsdb_resolution": {
321-
Type: schema.TypeString,
321+
Type: schema.TypeInt,
322322
Optional: true,
323323
Description: "(OpenTSDB) Resolution.",
324324
},
325325
"tsdb_version": {
326-
Type: schema.TypeString,
326+
Type: schema.TypeInt,
327327
Optional: true,
328328
Description: "(OpenTSDB) Version.",
329329
},
@@ -622,8 +622,8 @@ func makeJSONData(d *schema.ResourceData) gapi.JSONData {
622622
TLSAuthWithCACert: d.Get("json_data.0.tls_auth_with_ca_cert").(bool),
623623
TLSSkipVerify: d.Get("json_data.0.tls_skip_verify").(bool),
624624
TokenURI: d.Get("json_data.0.token_uri").(string),
625-
TsdbResolution: d.Get("json_data.0.tsdb_resolution").(string),
626-
TsdbVersion: d.Get("json_data.0.tsdb_version").(string),
625+
TsdbResolution: int64(d.Get("json_data.0.tsdb_resolution").(int)),
626+
TsdbVersion: int64(d.Get("json_data.0.tsdb_version").(int)),
627627
Version: d.Get("json_data.0.version").(string),
628628
Workgroup: d.Get("json_data.0.workgroup").(string),
629629
}

0 commit comments

Comments
 (0)