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

Commit

Permalink
Datasources: Add xpack option (#81)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
julienduchesne authored May 26, 2022
1 parent 6eca1ed commit a550de4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ type JSONData struct {
LogMessageField string `json:"logMessageField,omitempty"`
LogLevelField string `json:"logLevelField,omitempty"`
MaxConcurrentShardRequests int64 `json:"maxConcurrentShardRequests,omitempty"`
XpackEnabled bool `json:"xpack"`

// Used by Cloudwatch
CustomMetricsNamespaces string `json:"customMetricsNamespaces,omitempty"`
Expand Down Expand Up @@ -142,7 +143,7 @@ type JSONData struct {
// Used by PostgreSQL
Sslmode string `json:"sslmode,omitempty"`
PostgresVersion int64 `json:"postgresVersion,omitempty"`
Timescaledb bool `json:"timescaledb,omitempty"`
Timescaledb bool `json:"timescaledb"`

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

// Used by Prometheus and Elasticsearch
SigV4AssumeRoleArn string `json:"sigV4AssumeRoleArn,omitempty"`
SigV4Auth bool `json:"sigV4Auth,omitempty"`
SigV4Auth bool `json:"sigV4Auth"`
SigV4AuthType string `json:"sigV4AuthType,omitempty"`
SigV4ExternalID string `json:"sigV4ExternalID,omitempty"`
SigV4Profile string `json:"sigV4Profile,omitempty"`
SigV4Region string `json:"sigV4Region,omitempty"`

// Used by Prometheus and Loki
ManageAlerts bool `json:"manageAlerts,omitempty"`
ManageAlerts bool `json:"manageAlerts"`
AlertmanagerUID string `json:"alertmanagerUid,omitempty"`

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

// Used by Azure Monitor
AzureLogAnalyticsSameAs bool `json:"azureLogAnalyticsSameAs,omitempty"`
AzureLogAnalyticsSameAs bool `json:"azureLogAnalyticsSameAs"`
ClientID string `json:"clientId,omitempty"`
CloudName string `json:"cloudName,omitempty"`
LogAnalyticsClientID string `json:"logAnalyticsClientId,omitempty"`
Expand Down

0 comments on commit a550de4

Please sign in to comment.