provider/datadog: Govendor update dependencies (#8428)
* Includes bugfixes in zorkian/go-datadog-api * Struct changes upstream required small changes to provider code
This commit is contained in:
parent
dea2860735
commit
a4fd7ce23b
|
@ -159,7 +159,7 @@ func buildMonitorStruct(d *schema.ResourceData) *datadog.Monitor {
|
|||
o.NotifyNoData = attr.(bool)
|
||||
}
|
||||
if attr, ok := d.GetOk("no_data_timeframe"); ok {
|
||||
o.NoDataTimeframe = attr.(int)
|
||||
o.NoDataTimeframe = datadog.NoDataTimeframe(attr.(int))
|
||||
}
|
||||
if attr, ok := d.GetOk("renotify_interval"); ok {
|
||||
o.RenotifyInterval = attr.(int)
|
||||
|
@ -336,7 +336,7 @@ func resourceDatadogMonitorUpdate(d *schema.ResourceData, meta interface{}) erro
|
|||
o.NotifyNoData = attr.(bool)
|
||||
}
|
||||
if attr, ok := d.GetOk("no_data_timeframe"); ok {
|
||||
o.NoDataTimeframe = attr.(int)
|
||||
o.NoDataTimeframe = datadog.NoDataTimeframe(attr.(int))
|
||||
}
|
||||
if attr, ok := d.GetOk("renotify_interval"); ok {
|
||||
o.RenotifyInterval = attr.(int)
|
||||
|
|
|
@ -122,6 +122,8 @@ func appendRequests(datadogGraph *datadog.Graph, terraformRequests *[]interface{
|
|||
d := struct {
|
||||
Query string `json:"q"`
|
||||
Stacked bool `json:"stacked"`
|
||||
Aggregator string
|
||||
ConditionalFormats []datadog.DashboardConditionalFormat `json:"conditional_formats,omitempty"`
|
||||
}{Query: t["q"].(string)}
|
||||
if stacked, ok := t["stacked"]; ok {
|
||||
d.Stacked = stacked.(bool)
|
||||
|
|
|
@ -21,6 +21,8 @@ type Graph struct {
|
|||
Requests []struct {
|
||||
Query string `json:"q"`
|
||||
Stacked bool `json:"stacked"`
|
||||
Aggregator string
|
||||
ConditionalFormats []DashboardConditionalFormat `json:"conditional_formats,omitempty"`
|
||||
} `json:"requests"`
|
||||
} `json:"definition"`
|
||||
}
|
||||
|
@ -64,6 +66,15 @@ type reqGetDashboard struct {
|
|||
Dashboard Dashboard `json:"dash"`
|
||||
}
|
||||
|
||||
type DashboardConditionalFormat struct {
|
||||
Palette string `json:"palette,omitempty"`
|
||||
Comparator string `json:"comparator,omitempty"`
|
||||
CustomBgColor string `json:"custom_bg_color,omitempty"`
|
||||
Value float64 `json:"value,omitempty"`
|
||||
Inverted bool `json:"invert,omitempty"`
|
||||
CustomFgColor string `json:"custom_fg_color,omitempty"`
|
||||
}
|
||||
|
||||
// GetDashboard returns a single dashboard created on this account.
|
||||
func (self *Client) GetDashboard(id int) (*Dashboard, error) {
|
||||
var out reqGetDashboard
|
||||
|
|
|
@ -11,6 +11,7 @@ package datadog
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type ThresholdCount struct {
|
||||
|
@ -19,8 +20,24 @@ type ThresholdCount struct {
|
|||
Warning json.Number `json:"warning,omitempty"`
|
||||
}
|
||||
|
||||
type NoDataTimeframe int
|
||||
|
||||
func (tf *NoDataTimeframe) UnmarshalJSON(data []byte) error {
|
||||
s := string(data)
|
||||
if s == "false" {
|
||||
*tf = 0
|
||||
} else {
|
||||
i, err := strconv.ParseInt(s, 10, 32)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*tf = NoDataTimeframe(i)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Options struct {
|
||||
NoDataTimeframe int `json:"no_data_timeframe,omitempty"`
|
||||
NoDataTimeframe NoDataTimeframe `json:"no_data_timeframe,omitempty"`
|
||||
NotifyAudit bool `json:"notify_audit,omitempty"`
|
||||
NotifyNoData bool `json:"notify_no_data,omitempty"`
|
||||
RenotifyInterval int `json:"renotify_interval,omitempty"`
|
||||
|
|
|
@ -23,6 +23,7 @@ type Screenboard struct {
|
|||
Templated bool `json:"templated,omitempty"`
|
||||
TemplateVariables []TemplateVariable `json:"template_variables,omitempty"`
|
||||
Widgets []Widget `json:"widgets,omitempty"`
|
||||
ReadOnly bool `json:"read_only,omitempty"`
|
||||
}
|
||||
|
||||
//type Widget struct {
|
||||
|
|
Loading…
Reference in New Issue