sensu

package
v0.0.0-...-97a7976 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2016 License: MIT, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLimit int = 1000

DefaultLimit is used as the default limit parameter for endpoint that supports pagination

View Source
const NoLimit int = -1

NoLimit is used as a limit parameter

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Path    string
	URL     string
	Timeout int
	User    string
	Pass    string
	Client  http.Client
}

API struct contains the details of a specific Sensu API

func NewAPI

func NewAPI(path string, url string, timeout int, username string, password string, insecure bool) API

NewAPI initializes a new Sensu API struct

type Sensu

type Sensu struct {
	Name string
	APIs []API
}

Sensu struct contains the name and all the APIs for a particular datacenter

func (*Sensu) CreateStash

func (s *Sensu) CreateStash(payload interface{}) (map[string]interface{}, error)

CreateStash creates a stash by posting the provided interface as a JSON encoded payload

func (*Sensu) DeleteAggregate

func (s *Sensu) DeleteAggregate(check string) error

DeleteAggregate deletes an aggregate using its check name

func (*Sensu) DeleteCheckResult

func (s *Sensu) DeleteCheckResult(check, client string) error

DeleteCheckResult deletes a check result for a particular client

func (*Sensu) DeleteClient

func (s *Sensu) DeleteClient(client string) error

DeleteClient deletes a client using its name

func (*Sensu) DeleteEvent

func (s *Sensu) DeleteEvent(check, client string) error

DeleteEvent delete an event

func (*Sensu) DeleteStash

func (s *Sensu) DeleteStash(path string) error

DeleteStash deletes a stash using its path

func (*Sensu) GetAggregate

func (s *Sensu) GetAggregate(check string, age int) ([]interface{}, error)

GetAggregate returns a slice of a specific aggregate corresponding to the provided check name

func (*Sensu) GetAggregateIssued

func (s *Sensu) GetAggregateIssued(check string, issued string) (map[string]interface{}, error)

GetAggregateIssued returns a map containing the history of a specific check corresponding to the provided check name and the issued timestamp

func (*Sensu) GetAggregates

func (s *Sensu) GetAggregates() ([]interface{}, error)

GetAggregates returns a slice of all aggregates

func (*Sensu) GetCheck

func (s *Sensu) GetCheck(check string) (map[string]interface{}, error)

GetCheck returns a map of a specific check corresponding to the provided check name

func (*Sensu) GetChecks

func (s *Sensu) GetChecks() ([]interface{}, error)

GetChecks returns a slice of all checks

func (*Sensu) GetClient

func (s *Sensu) GetClient(client string) (map[string]interface{}, error)

GetClient returns a map of a specific client corresponding to the provided client name

func (*Sensu) GetClientHistory

func (s *Sensu) GetClientHistory(client string) ([]interface{}, error)

GetClientHistory returns a slice containing the history of a specific check corresponding to the provided client name

func (*Sensu) GetClients

func (s *Sensu) GetClients() ([]interface{}, error)

GetClients returns a slice of all clients

func (*Sensu) GetEvents

func (s *Sensu) GetEvents() ([]interface{}, error)

GetEvents returns a slice of all clients

func (*Sensu) GetInfo

func (s *Sensu) GetInfo() (*structs.Info, error)

GetInfo returns a pointer to a structs.Info struct containing the Sensu version and the transport and Redis connection information

func (*Sensu) GetName

func (s *Sensu) GetName() string

GetName returns the Name attribute

func (*Sensu) GetStash

func (s *Sensu) GetStash(path string) (map[string]interface{}, error)

GetStash returns a map of a specific stash corresponding to the provided path

func (*Sensu) GetStashes

func (s *Sensu) GetStashes() ([]interface{}, error)

GetStashes returns a slice of all stashes

func (*Sensu) IssueCheckExecution

func (s *Sensu) IssueCheckExecution(payload interface{}) (map[string]interface{}, error)

IssueCheckExecution send a POST request to the /request endpoint in order to issue a check execution request

func (*Sensu) Metric

func (s *Sensu) Metric(name string) (*structs.SERawMetric, error)

Metric returns the Sensu Enterprise metrics for the clients

Jump to

Keyboard shortcuts

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