mackerel

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2015 License: Apache-2.0 Imports: 12 Imported by: 32

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	BaseURL *url.URL
	APIKey  string
	Verbose bool
}

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 []CreateGraphDefsPayload) error

CreateGraphDefs XXX

func (*API) CreateHost

func (api *API) CreateHost(name string, meta map[string]interface{}, interfaces []map[string]interface{}, roleFullnames []string) (string, error)

CreateHost XXX

func (*API) FindHost

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

FindHost XXX

func (*API) PostMetricsValues

func (api *API) PostMetricsValues(metricsValues [](*CreatingMetricsValue)) error

PostMetricsValues XXX

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

func (api *API) UpdateHost(hostID string, hostSpec map[string]interface{}) error

UpdateHost updates the host information on Mackerel.

type CreateGraphDefsPayload added in v0.10.0

type CreateGraphDefsPayload struct {
	Name        string                         `json:"name"`
	DisplayName string                         `json:"displayName"`
	Unit        string                         `json:"unit"`
	Metrics     []CreateGraphDefsPayloadMetric `json:"metrics"`
}

CreateGraphDefsPayload XXX

type CreateGraphDefsPayloadMetric added in v0.10.0

type CreateGraphDefsPayloadMetric struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
	IsStacked   bool   `json:"isStacked"`
}

CreateGraphDefsPayloadMetric XXX

type CreatingMetricsValue

type CreatingMetricsValue struct {
	HostID string      `json:"hostId"`
	Name   string      `json:"name"`
	Time   float64     `json:"time"`
	Value  interface{} `json:"value"`
}

CreatingMetricsValue XXX

type Host

type Host struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Type   string `json:"type"` // TODO ENUM
	Status string `json:"status"`
}

Host XXX

type Time added in v0.16.0

type Time time.Time

Time is a type for sending time information to Mackerel API server. It is encoded as an epoch seconds integer in JSON.

func (Time) MarshalJSON added in v0.16.0

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

Jump to

Keyboard shortcuts

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