File: checks.go

package info (click to toggle)
golang-github-zorkian-go-datadog-api 2.30.0-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 1,616 kB
  • sloc: makefile: 28; sh: 13
file content (25 lines) | stat: -rw-r--r-- 576 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package datadog

type Check struct {
	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"`
	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)
}