2016-05-19 10:29:23 +02:00
|
|
|
package datadog
|
|
|
|
|
|
|
|
type Check struct {
|
2017-02-20 13:48:32 +01:00
|
|
|
Check *string `json:"check,omitempty"`
|
|
|
|
HostName *string `json:"host_name,omitempty"`
|
|
|
|
Status *Status `json:"status,omitempty"`
|
|
|
|
Timestamp *string `json:"timestamp,omitempty"`
|
|
|
|
Message *string `json:"message,omitempty"`
|
2016-05-19 10:29:23 +02:00
|
|
|
Tags []string `json:"tags,omitempty"`
|
|
|
|
}
|
|
|
|
|
2016-12-05 14:16:47 +01:00
|
|
|
type Status int
|
2016-05-19 10:29:23 +02:00
|
|
|
|
|
|
|
const (
|
2016-12-05 14:16:47 +01:00
|
|
|
OK Status = iota
|
2016-05-19 10:29:23 +02:00
|
|
|
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)
|
|
|
|
}
|