mackerel

package
v0.60.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2019 License: Apache-2.0 Imports: 10 Imported by: 32

Documentation

Index

Constants

View Source
const (
	// NotificationIntervalFallback is the minimum minutes of Mackerel API's
	// notification_interval.
	NotificationIntervalFallback = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	BaseURL        *url.URL
	APIKey         string
	Verbose        bool
	UA             string
	DefaultHeaders http.Header
}

API is the main interface of Mackerel API.

func NewAPI added in v0.14.1

func NewAPI(rawurl string, apiKey string, verbose bool) (*API, error)

NewAPI creates a new instance of API.

func (*API) CreateGraphDefs added in v0.10.0

func (api *API) CreateGraphDefs(payloads []*mkr.GraphDefsParam) error

CreateGraphDefs register graph defs

func (*API) CreateHost

func (api *API) CreateHost(hostParam mkr.CreateHostParam) (string, error)

CreateHost register the host to mackerel

func (*API) FindHost

func (api *API) FindHost(id string) (*mkr.Host, error)

FindHost find the host

func (*API) FindHostByCustomIdentifier added in v0.31.0

func (api *API) FindHostByCustomIdentifier(customIdentifier string) (*mkr.Host, error)

FindHostByCustomIdentifier find the host by the custom identifier

func (*API) PostMetricValues added in v0.60.0

func (api *API) PostMetricValues(metricsValues [](*mkr.HostMetricValue)) error

PostMetricValues post metrics

func (*API) PutMetadata added in v0.40.0

func (api *API) PutMetadata(hostID string, namespace string, metadata interface{}) (*http.Response, error)

PutMetadata creates or updates metadata of a host.

func (*API) ReportCheckMonitors added in v0.16.0

func (api *API) ReportCheckMonitors(hostID string, reports []*checks.Report) error

ReportCheckMonitors sends reports of *checks.Checker() to Mackrel API server.

func (*API) RetireHost added in v0.20.0

func (api *API) RetireHost(hostID string) error

RetireHost retires the host

func (*API) UpdateHost

func (api *API) UpdateHost(hostID string, hostParam mkr.UpdateHostParam) error

UpdateHost updates the host information on Mackerel.

func (*API) UpdateHostStatus added in v0.17.0

func (api *API) UpdateHostStatus(hostID string, status string) error

UpdateHostStatus updates the status of the host

type Error added in v0.18.0

type Error struct {
	StatusCode int
	Message    string
}

Error represents API error

func (*Error) Error added in v0.18.0

func (aperr *Error) Error() string

func (*Error) IsClientError added in v0.18.0

func (aperr *Error) IsClientError() bool

IsClientError 4xx

func (*Error) IsServerError added in v0.18.0

func (aperr *Error) IsServerError() bool

IsServerError 5xx

type InfoError added in v0.54.1

type InfoError struct {
	Message string
}

InfoError represents Error of log level INFO

func (*InfoError) Error added in v0.54.1

func (e *InfoError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL