diff --git a/datasource.go b/datasource.go index e4673b8..f600db0 100644 --- a/datasource.go +++ b/datasource.go @@ -17,13 +17,15 @@ type DataSource struct { Database string `json:"database,omitempty"` User string `json:"user,omitempty"` + // Deprecated in favor of secureJsonData.password Password string `json:"password,omitempty"` OrgId int64 `json:"orgId,omitempty"` IsDefault bool `json:"isDefault"` - BasicAuth bool `json:"basicAuth"` - BasicAuthUser string `json:"basicAuthUser,omitempty"` + BasicAuth bool `json:"basicAuth"` + BasicAuthUser string `json:"basicAuthUser,omitempty"` + // Deprecated in favor of secureJsonData.basicAuthPassword BasicAuthPassword string `json:"basicAuthPassword,omitempty"` JSONData JSONData `json:"jsonData,omitempty"` @@ -32,18 +34,62 @@ type DataSource struct { // JSONData is a representation of the datasource `jsonData` property type JSONData struct { - AssumeRoleArn string `json:"assumeRoleArn,omitempty"` + // Used by all datasources + TlsAuth bool `json:"tlsAuth,omitempty"` + TlsAuthWithCACert bool `json:"tlsAuthWithCACert,omitempty"` + TlsSkipVerify bool `json:"tlsSkipVerify,omitempty"` + + // Used by Graphite + GraphiteVersion string `json:"graphiteVersion,omitempty"` + + // Used by Prometheus, Elasticsearch, InfluxDB, MySQL, PostgreSQL and MSSQL + TimeInterval string `json:"timeInterval,omitempty"` + + // Used by Elasticsearch + EsVersion int64 `json:"esVersion,omitempty"` + TimeField string `json:"timeField,omitempty"` + Interval string `json:"inteval,omitempty"` + LogMessageField string `json:"logMessageField,omitempty"` + LogLevelField string `json:"logLevelField,omitempty"` + + // Used by Cloudwatch AuthType string `json:"authType,omitempty"` - CustomMetricsNamespaces string `json:"customMetricsNamespaces,omitempty"` + AssumeRoleArn string `json:"assumeRoleArn,omitempty"` DefaultRegion string `json:"defaultRegion,omitempty"` - TlsSkipVerify bool `json:"tlsSkipVerify,omitempty"` - HttpMethod string `json:"httpMethod,omitempty"` - QueryTimeout string `json:"queryTimeout,omitempty"` - TimeInterval string `json:"timeInterval,omitempty"` + CustomMetricsNamespaces string `json:"customMetricsNamespaces,omitempty"` + + // Used by OpenTSDB + TsdbVersion string `json:"tsdbVersion,omitempty"` + TsdbResolution string `json:"tsdbResolution,omitempty"` + + // Used by MSSQL + Encrypt string `json:"encrypt,omitempty"` + + // Used by PostgreSQL + Sslmode string `json:"sslmode,omitempty"` + PostgresVersion int64 `json:"postgresVersion,omitempty"` + Timescaledb bool `json:"timescaledb,omitempty"` + + // Used by MySQL, PostgreSQL and MSSQL + MaxOpenConns int64 `json:"maxOpenConns,omitempty"` + MaxIdleConns int64 `json:"maxIdleConns,omitempty"` + ConnMaxLifetime int64 `json:"connMaxLifetime,omitempty"` + + // Used by Prometheus + HttpMethod string `json:"httpMethod,omitempty"` + QueryTimeout string `json:"queryTimeout,omitempty"` } // SecureJSONData is a representation of the datasource `secureJsonData` property type SecureJSONData struct { + // Used by all datasources + TlsCACert string `json:"tlsCACert,omitempty"` + TlsClientCert string `json:"tlsClientCert,omitempty"` + TlsClientKey string `json:"tlsClientKey,omitempty"` + Password string `json:"password,omitempty"` + BasicAuthPassword string `json:"basicAuthPassword,omitempty"` + + // Used by Cloudwatch AccessKey string `json:"accessKey,omitempty"` SecretKey string `json:"secretKey,omitempty"` }