mackerel

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2014 License: Apache-2.0 Imports: 11 Imported by: 0

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
}

func NewApi

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

func (*API) CreateGraphDefs added in v0.10.0

func (api *API) CreateGraphDefs(payloads []CreateGraphDefsPayload) error

func (*API) CreateHost

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

func (*API) Do

func (api *API) Do(req *http.Request) (resp *http.Response, err error)

func (*API) FindHost

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

func (*API) PostMetricsValues

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

func (*API) UpdateHost

func (api *API) UpdateHost(hostId string, name string, meta map[string]interface{}, interfaces []map[string]interface{}, roleFullnames []string) 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"`
}

type CreateGraphDefsPayloadMetric added in v0.10.0

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

type CreatingMetricsValue

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

type Host

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

type Metrics

type Metrics struct {
	Id     string `json:"id"`
	HostId string `json:"hostId"`
	Name   string `json:"name"`
}

Jump to

Keyboard shortcuts

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