opentofu/vendor/github.com/zorkian/go-datadog-api/checks.go
Otto Jongerius dc7a7219bf provider/datadog add 'require full window' and 'locked' (#6738)
* 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.
2016-05-19 09:29:23 +01:00

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)
}