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

Commit a550de4

Browse files
Datasources: Add xpack option (#81)
Also remove `omitempty` all boolean attributes of json_data. For booleans, it's annoying because it makes `false` values not show up, meaning that once enabled, an attribute can't be disabled It's fine to always send values for datasources, it just ignores the extra attributes for a datasource grafana/terraform-provider-grafana#300
1 parent 6eca1ed commit a550de4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

datasource.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ type JSONData struct {
115115
LogMessageField string `json:"logMessageField,omitempty"`
116116
LogLevelField string `json:"logLevelField,omitempty"`
117117
MaxConcurrentShardRequests int64 `json:"maxConcurrentShardRequests,omitempty"`
118+
XpackEnabled bool `json:"xpack"`
118119

119120
// Used by Cloudwatch
120121
CustomMetricsNamespaces string `json:"customMetricsNamespaces,omitempty"`
@@ -142,7 +143,7 @@ type JSONData struct {
142143
// Used by PostgreSQL
143144
Sslmode string `json:"sslmode,omitempty"`
144145
PostgresVersion int64 `json:"postgresVersion,omitempty"`
145-
Timescaledb bool `json:"timescaledb,omitempty"`
146+
Timescaledb bool `json:"timescaledb"`
146147

147148
// Used by MySQL, PostgreSQL and MSSQL
148149
MaxOpenConns int64 `json:"maxOpenConns,omitempty"`
@@ -161,14 +162,14 @@ type JSONData struct {
161162

162163
// Used by Prometheus and Elasticsearch
163164
SigV4AssumeRoleArn string `json:"sigV4AssumeRoleArn,omitempty"`
164-
SigV4Auth bool `json:"sigV4Auth,omitempty"`
165+
SigV4Auth bool `json:"sigV4Auth"`
165166
SigV4AuthType string `json:"sigV4AuthType,omitempty"`
166167
SigV4ExternalID string `json:"sigV4ExternalID,omitempty"`
167168
SigV4Profile string `json:"sigV4Profile,omitempty"`
168169
SigV4Region string `json:"sigV4Region,omitempty"`
169170

170171
// Used by Prometheus and Loki
171-
ManageAlerts bool `json:"manageAlerts,omitempty"`
172+
ManageAlerts bool `json:"manageAlerts"`
172173
AlertmanagerUID string `json:"alertmanagerUid,omitempty"`
173174

174175
// Used by Alertmanager
@@ -184,7 +185,7 @@ type JSONData struct {
184185
Version string `json:"version,omitempty"`
185186

186187
// Used by Azure Monitor
187-
AzureLogAnalyticsSameAs bool `json:"azureLogAnalyticsSameAs,omitempty"`
188+
AzureLogAnalyticsSameAs bool `json:"azureLogAnalyticsSameAs"`
188189
ClientID string `json:"clientId,omitempty"`
189190
CloudName string `json:"cloudName,omitempty"`
190191
LogAnalyticsClientID string `json:"logAnalyticsClientId,omitempty"`

0 commit comments

Comments
 (0)