Documentation ¶
Overview ¶
The Sensu API provides access to the data that Sensu servers collect, such as client information & current events. The API can be used to resolve events and request check executions, among other things.
Index ¶
- type API
- func (api API) DeleteAggregatesCheck(check string) error
- func (api API) DeleteClientsClient(name string) error
- func (api API) DeleteEventsClientCheck(client string, check string) error
- func (api API) DeleteStashesPath(path string) error
- func (api API) GetAggregates(limit int, offset int) ([]IssueStruct, error)
- func (api API) GetAggregatesCheck(check string, age int) ([]int64, error)
- func (api API) GetAggregatesCheckIssued(check string, issued int64, summarize string, results bool) (*AggregateStruct, error)
- func (api API) GetChecks() ([]CheckStruct, error)
- func (api API) GetChecksCheck(name string) (*CheckStruct, error)
- func (api API) GetClients(limit int, offset int) ([]ClientStruct, error)
- func (api API) GetClientsClient(name string) (*ClientStruct, error)
- func (api API) GetClientsHistory(client string) ([]historyStruct, error)
- func (api API) GetEvents() ([]EventStruct, error)
- func (api API) GetEventsClient(client string) ([]EventStruct, error)
- func (api API) GetEventsClientCheck(client string, check string) (*EventStruct, error)
- func (api API) GetHealth(consumers int, messages int) error
- func (api API) GetInfo() (*InfoStruct, error)
- func (api API) GetResults() ([]ResultStruct, error)
- func (api API) GetResultsClient(client string) ([]ResultStruct, error)
- func (api API) GetResultsClientCheck(client string, check string) (*ResultStruct, error)
- func (api API) GetStashes(stashes interface{}, limit int, offset int) error
- func (api API) GetStashesPath(path string, content interface{}) error
- func (api API) PostClients(name string, address string, subscriptions []string) error
- func (api API) PostRequest(check string, subscribers []string) error
- func (api API) PostResolve(client string, check string) error
- func (api API) PostStashes(stash interface{}) error
- func (api API) PostStashesPath(path string, content interface{}) error
- type AggregateStruct
- type CheckStruct
- type ClientStruct
- type EventStruct
- type InfoStruct
- type IssueStruct
- type RequestStruct
- type ResolveStruct
- type Response
- type ResultStruct
- type StashStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
func (API) DeleteAggregatesCheck ¶
Deletes all aggregates for a check.
func (API) DeleteClientsClient ¶
Removes a client, resolving its current events.
func (API) DeleteEventsClientCheck ¶
Resolves an event for a given check on a given client.
func (API) GetAggregates ¶
func (api API) GetAggregates(limit int, offset int) ([]IssueStruct, error)
Returns the list of aggregates.
limit: The number of aggregates to return. offset: The number of aggregates to offset before returning items.
func (API) GetAggregatesCheck ¶
Returns the list of aggregates for a given check.
age: The number of seconds old an aggregate must be to be listed.
func (API) GetAggregatesCheckIssued ¶
func (api API) GetAggregatesCheckIssued(check string, issued int64, summarize string, results bool) (*AggregateStruct, error)
Returns an aggregate.
summarize: Summarizes the output field in the event data. (summarize=output) result: Return the raw result data.
func (API) GetChecks ¶
func (api API) GetChecks() ([]CheckStruct, error)
Returns the list of checks.
func (API) GetChecksCheck ¶
func (api API) GetChecksCheck(name string) (*CheckStruct, error)
Returns a check.
func (API) GetClients ¶
func (api API) GetClients(limit int, offset int) ([]ClientStruct, error)
Returns a list of clients.
limit: The number of clients to return. offset: The number of clients to offset before returning items.
func (API) GetClientsClient ¶
func (api API) GetClientsClient(name string) (*ClientStruct, error)
Returns a client.
func (API) GetClientsHistory ¶
Returns the history for a client.
func (API) GetEvents ¶
func (api API) GetEvents() ([]EventStruct, error)
Returns the list of current events.
func (API) GetEventsClient ¶
func (api API) GetEventsClient(client string) ([]EventStruct, error)
Returns the list of current events for a given client.
func (API) GetEventsClientCheck ¶
func (api API) GetEventsClientCheck(client string, check string) (*EventStruct, error)
Returns an event for a given client & check name.
func (API) GetHealth ¶
Returns health information on transport & Redis connections.
consumers: The minimum number of transport consumers to be considered healthy. messages: The maximum ammount of transport queued messages to be considered healthy.
func (API) GetResults ¶
func (api API) GetResults() ([]ResultStruct, error)
Returns a list of current check results for all clients.
func (API) GetResultsClient ¶
func (api API) GetResultsClient(client string) ([]ResultStruct, error)
Returns a list of current check results for a given client.
func (API) GetResultsClientCheck ¶
func (api API) GetResultsClientCheck(client string, check string) (*ResultStruct, error)
Returns a check result for a given client & check name.
func (API) GetStashes ¶
Returns a list of stashes.
limit: The number of stashes to return. offset: The number of stashes to offset before returning items.
func (API) GetStashesPath ¶
Get a stash.
func (API) PostClients ¶
Create or update client data (e.g. Sensu JIT clients).
func (API) PostRequest ¶
Issues a check execution request.
func (API) PostResolve ¶
Resolves an event.
func (API) PostStashesPath ¶
Create a stash.
type AggregateStruct ¶
type AggregateStruct struct { Ok int `json:"ok"` Warning int `json:"warning"` Critical int `json:"critical"` Unknown int `json:"unknown"` Total int `json:"total"` Outputs map[string]int `json:"outputs"` Results []struct { Client string `json:"client"` Output string `json:"output"` Status int `json:"status"` } `json:"results"` }
type CheckStruct ¶
type CheckStruct struct { Name string `json:"name"` Command string `json:"command"` Subscribers []string `json:"subscribers"` Interval int `json:"interval"` Handlers []string `json:"handlers"` Aggregate bool `json:"aggregate"` Issued int64 `json:"issued"` Executed int64 `json:"executed"` Output string `json:"output"` Status int `json:"status"` Duration float64 `json:"duration"` History []string `json:"history"` }
type ClientStruct ¶
type EventStruct ¶
type EventStruct struct { ID string `json:"id"` Client ClientStruct `json:"client"` Check CheckStruct `json:"check"` Occurrences int `json:"occurrences"` Action string `json:"action"` }
type InfoStruct ¶
type InfoStruct struct { Sensu struct { Version string `json:"version"` } `json:"sensu"` Transport struct { Keepalives struct { Messages int `json:"messages"` Consumers int `json:"consumers"` } `json:"keepalives"` Results struct { Messages int `json:"messages"` Consumers int `json:"consumers"` } `json:"results"` Connected bool `json:"connected"` } Redis struct { Connected bool `json:"connected"` } `json:"redis"` }
type IssueStruct ¶ added in v0.22.1
type RequestStruct ¶
type ResolveStruct ¶
type ResultStruct ¶
type ResultStruct struct { Client string `json:"client"` Check CheckStruct `json:"check"` }