mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
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)
|
o.NotifyNoData = attr.(bool)
|
||||||
}
|
}
|
||||||
if attr, ok := d.GetOk("no_data_timeframe"); ok {
|
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 {
|
if attr, ok := d.GetOk("renotify_interval"); ok {
|
||||||
o.RenotifyInterval = attr.(int)
|
o.RenotifyInterval = attr.(int)
|
||||||
@ -336,7 +336,7 @@ func resourceDatadogMonitorUpdate(d *schema.ResourceData, meta interface{}) erro
|
|||||||
o.NotifyNoData = attr.(bool)
|
o.NotifyNoData = attr.(bool)
|
||||||
}
|
}
|
||||||
if attr, ok := d.GetOk("no_data_timeframe"); ok {
|
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 {
|
if attr, ok := d.GetOk("renotify_interval"); ok {
|
||||||
o.RenotifyInterval = attr.(int)
|
o.RenotifyInterval = attr.(int)
|
||||||
|
@ -120,8 +120,10 @@ func appendRequests(datadogGraph *datadog.Graph, terraformRequests *[]interface{
|
|||||||
for _, t_ := range *terraformRequests {
|
for _, t_ := range *terraformRequests {
|
||||||
t := t_.(map[string]interface{})
|
t := t_.(map[string]interface{})
|
||||||
d := struct {
|
d := struct {
|
||||||
Query string `json:"q"`
|
Query string `json:"q"`
|
||||||
Stacked bool `json:"stacked"`
|
Stacked bool `json:"stacked"`
|
||||||
|
Aggregator string
|
||||||
|
ConditionalFormats []datadog.DashboardConditionalFormat `json:"conditional_formats,omitempty"`
|
||||||
}{Query: t["q"].(string)}
|
}{Query: t["q"].(string)}
|
||||||
if stacked, ok := t["stacked"]; ok {
|
if stacked, ok := t["stacked"]; ok {
|
||||||
d.Stacked = stacked.(bool)
|
d.Stacked = stacked.(bool)
|
||||||
|
15
vendor/github.com/zorkian/go-datadog-api/dashboards.go
generated
vendored
15
vendor/github.com/zorkian/go-datadog-api/dashboards.go
generated
vendored
@ -19,8 +19,10 @@ type Graph struct {
|
|||||||
Definition struct {
|
Definition struct {
|
||||||
Viz string `json:"viz"`
|
Viz string `json:"viz"`
|
||||||
Requests []struct {
|
Requests []struct {
|
||||||
Query string `json:"q"`
|
Query string `json:"q"`
|
||||||
Stacked bool `json:"stacked"`
|
Stacked bool `json:"stacked"`
|
||||||
|
Aggregator string
|
||||||
|
ConditionalFormats []DashboardConditionalFormat `json:"conditional_formats,omitempty"`
|
||||||
} `json:"requests"`
|
} `json:"requests"`
|
||||||
} `json:"definition"`
|
} `json:"definition"`
|
||||||
}
|
}
|
||||||
@ -64,6 +66,15 @@ type reqGetDashboard struct {
|
|||||||
Dashboard Dashboard `json:"dash"`
|
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.
|
// GetDashboard returns a single dashboard created on this account.
|
||||||
func (self *Client) GetDashboard(id int) (*Dashboard, error) {
|
func (self *Client) GetDashboard(id int) (*Dashboard, error) {
|
||||||
var out reqGetDashboard
|
var out reqGetDashboard
|
||||||
|
39
vendor/github.com/zorkian/go-datadog-api/monitors.go
generated
vendored
39
vendor/github.com/zorkian/go-datadog-api/monitors.go
generated
vendored
@ -11,6 +11,7 @@ package datadog
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ThresholdCount struct {
|
type ThresholdCount struct {
|
||||||
@ -19,18 +20,34 @@ type ThresholdCount struct {
|
|||||||
Warning json.Number `json:"warning,omitempty"`
|
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 {
|
type Options struct {
|
||||||
NoDataTimeframe int `json:"no_data_timeframe,omitempty"`
|
NoDataTimeframe NoDataTimeframe `json:"no_data_timeframe,omitempty"`
|
||||||
NotifyAudit bool `json:"notify_audit,omitempty"`
|
NotifyAudit bool `json:"notify_audit,omitempty"`
|
||||||
NotifyNoData bool `json:"notify_no_data,omitempty"`
|
NotifyNoData bool `json:"notify_no_data,omitempty"`
|
||||||
RenotifyInterval int `json:"renotify_interval,omitempty"`
|
RenotifyInterval int `json:"renotify_interval,omitempty"`
|
||||||
Silenced map[string]int `json:"silenced,omitempty"`
|
Silenced map[string]int `json:"silenced,omitempty"`
|
||||||
TimeoutH int `json:"timeout_h,omitempty"`
|
TimeoutH int `json:"timeout_h,omitempty"`
|
||||||
EscalationMessage string `json:"escalation_message,omitempty"`
|
EscalationMessage string `json:"escalation_message,omitempty"`
|
||||||
Thresholds ThresholdCount `json:"thresholds,omitempty"`
|
Thresholds ThresholdCount `json:"thresholds,omitempty"`
|
||||||
IncludeTags bool `json:"include_tags,omitempty"`
|
IncludeTags bool `json:"include_tags,omitempty"`
|
||||||
RequireFullWindow bool `json:"require_full_window,omitempty"`
|
RequireFullWindow bool `json:"require_full_window,omitempty"`
|
||||||
Locked bool `json:"locked,omitempty"`
|
Locked bool `json:"locked,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Monitor allows watching a metric or check that you care about,
|
// Monitor allows watching a metric or check that you care about,
|
||||||
|
1
vendor/github.com/zorkian/go-datadog-api/screenboards.go
generated
vendored
1
vendor/github.com/zorkian/go-datadog-api/screenboards.go
generated
vendored
@ -23,6 +23,7 @@ type Screenboard struct {
|
|||||||
Templated bool `json:"templated,omitempty"`
|
Templated bool `json:"templated,omitempty"`
|
||||||
TemplateVariables []TemplateVariable `json:"template_variables,omitempty"`
|
TemplateVariables []TemplateVariable `json:"template_variables,omitempty"`
|
||||||
Widgets []Widget `json:"widgets,omitempty"`
|
Widgets []Widget `json:"widgets,omitempty"`
|
||||||
|
ReadOnly bool `json:"read_only,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
//type Widget struct {
|
//type Widget struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user