mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-09 07:33:58 -06:00
dc7a7219bf
* provider/datadog Update go-datadog-api. * provider/datadog Add support for "require_full_window" and "locked". * provider/datadog Update tests, update doco, gofmt. * provider/datadog Add options to update resource. * provider/datadog "require_full_window" defaults to True, "locked" to False. Use those initial values as the starting configuration. * provider/datadog Update notify_audit tests to use the default value for testAccCheckDatadogMonitorConfig and a custom value for testAccCheckDatadogMonitorConfigUpdated. This catches a situation where the code ignores setting the option on creation, and the update function merely asserts the default value, versus actually changing the value.
26 lines
546 B
Go
26 lines
546 B
Go
package datadog
|
|
|
|
type Check struct {
|
|
Check string `json:"check"`
|
|
HostName string `json:"host_name"`
|
|
Status status `json:"status"`
|
|
Timestamp string `json:"timestamp,omitempty"`
|
|
Message string `json:"message,omitempty"`
|
|
Tags []string `json:"tags,omitempty"`
|
|
}
|
|
|
|
type status int
|
|
|
|
const (
|
|
OK status = iota
|
|
WARNING
|
|
CRITICAL
|
|
UNKNOWN
|
|
)
|
|
|
|
// PostCheck posts the result of a check run to the server
|
|
func (client *Client) PostCheck(check Check) error {
|
|
return client.doJsonRequest("POST", "/v1/check_run",
|
|
check, nil)
|
|
}
|