sensu

package
v0.0.0-...-e319382 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 17 Imported by: 8

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 {
	CloseRequest      bool
	DisableKeepAlives bool
	Insecure          bool
	Pass              string
	Path              string
	Timeout           int
	Tracing           bool
	URL               string
	User              string
	Healthy           bool
	CheckingHealth    bool

	Client http.Client
}

API struct contains the details of a specific Sensu API

func (*API) Init

func (a *API) Init()

Init initializes a new Sensu API HTTP client

type Sensu

type Sensu struct {
	Name string
	APIs []API
}

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

func (*Sensu) ClearSilenced

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

ClearSilenced clears an entry from the silenced registry

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(name 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, invalidate, expire 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(name string) (map[string]interface{}, error)

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

func (*Sensu) GetAggregateChecks

func (s *Sensu) GetAggregateChecks(name string) ([]interface{}, error)

GetAggregateChecks returns a slice of all checks members of an aggregate

func (*Sensu) GetAggregateClients

func (s *Sensu) GetAggregateClients(name string) ([]interface{}, error)

GetAggregateClients returns a slice of all clients members of an aggregate

func (*Sensu) GetAggregateResults

func (s *Sensu) GetAggregateResults(name, severity string) ([]interface{}, error)

GetAggregateResults returns a slice of all check result members by severity

func (*Sensu) GetAggregates

func (s *Sensu) GetAggregates(ctx context.Context) ([]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(ctx context.Context) ([]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(ctx context.Context) ([]interface{}, error)

GetClients returns a slice of all clients

func (*Sensu) GetEvents

func (s *Sensu) GetEvents(ctx context.Context) ([]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) GetInfoFromAPI

func (s *Sensu) GetInfoFromAPI(i int) (*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) GetSilenced

func (s *Sensu) GetSilenced(ctx context.Context) ([]interface{}, error)

GetSilenced returns the complete silenced registry

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(ctx context.Context) ([]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

func (*Sensu) Silence

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

Silence updates the silenced registry with a new entry

func (*Sensu) UpdateClient

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

UpdateClient updates a client with the provided payload

Jump to

Keyboard shortcuts

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