uchiwa

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 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FilterAggregates func(aggregates *[]interface{}, token *jwt.Token) []interface{}

FilterAggregates is a function that filters aggregates

View Source
var FilterChecks func(checks *[]interface{}, token *jwt.Token) []interface{}

FilterChecks is a function that filters checks

View Source
var FilterClients func(clients *[]interface{}, token *jwt.Token) []interface{}

FilterClients is a function that filters clients

View Source
var FilterDatacenters func(datacenters []*structs.Datacenter, token *jwt.Token) []*structs.Datacenter

FilterAggregates is a function that filters datacenters

View Source
var FilterEvents func(events *[]interface{}, token *jwt.Token) []interface{}

FilterEvents is a function that filters events

View Source
var FilterGetRequest func(string, *jwt.Token) bool

FilterGetRequest is a function that filters GET requests.

View Source
var FilterPostRequest func(*jwt.Token, *interface{}) bool

FilterPostRequest is a function that filters POST requests.

View Source
var FilterSensuData func(*jwt.Token, *structs.Data) *structs.Data

FilterSensuDataData is a function that filters Sensu Data.

View Source
var FilterStashes func(stashes *[]interface{}, token *jwt.Token) []interface{}

FilterAggregates is a function that filters aggregates

View Source
var FilterSubscriptions func(subscriptions *[]string, token *jwt.Token) []string

FilterAggregates is a function that filters aggregates

Functions

func GetRoleFromToken

func GetRoleFromToken(token *jwt.Token) (*auth.Role, error)

GetRoleFromToken ...

func MergeStringSlices

func MergeStringSlices(a1, a2 []string) []string

MergeStringSlices merges two slices of strings and remove duplicated values

func SliceIntersection

func SliceIntersection(a1, a2 []string) bool

SliceIntersection searches for values in both slices Returns true if there's at least one intersection

Types

type Uchiwa

type Uchiwa struct {
	Config       *config.Config
	Daemon       *daemon.Daemon
	Data         *structs.Data
	Datacenters  *[]sensu.Sensu
	Mu           *sync.Mutex
	PublicConfig *config.Config
}

Uchiwa structure is used to manage Uchiwa

func Init

func Init(c *config.Config) *Uchiwa

Init method initializes the Sensu structure with the provided configuration and start the Uchiwa daemon

func (*Uchiwa) DeleteCheckResult

func (u *Uchiwa) DeleteCheckResult(check, client, dc string) error

DeleteCheckResult sends a DELETE request in order to remove the result for a given check on a given client

func (*Uchiwa) DeleteClient

func (u *Uchiwa) DeleteClient(id string, dc string) error

DeleteClient send a DELETE request to the /clients/*client* endpoint in order to delete a client

func (*Uchiwa) DeleteStash

func (u *Uchiwa) DeleteStash(dc, path string) error

DeleteStash send a DELETE request to the /stashes/*path* endpoint in order to delete a stash

func (*Uchiwa) GetAggregate

func (u *Uchiwa) GetAggregate(check string, dc string) (*[]interface{}, error)

GetAggregate retrieves a list of issued timestamps from a specified DC

func (*Uchiwa) GetAggregateByIssued

func (u *Uchiwa) GetAggregateByIssued(check string, issued string, dc string) (*map[string]interface{}, error)

GetAggregateByIssued retrieves aggregate check info from a specified DC

func (*Uchiwa) GetClient

func (u *Uchiwa) GetClient(client, dc string) (map[string]interface{}, error)

GetClient retrieves client history from specified DC

func (*Uchiwa) IssueCheckExecution

func (u *Uchiwa) IssueCheckExecution(data structs.CheckExecution) error

IssueCheckExecution sends a POST request to the /stashes endpoint in order to create a stash

func (*Uchiwa) PostStash

func (u *Uchiwa) PostStash(data stash) error

PostStash send a POST request to the /stashes endpoint in order to create a stash

func (*Uchiwa) ResolveEvent

func (u *Uchiwa) ResolveEvent(check, client, dc string) error

ResolveEvent sends a DELETE request in order to resolve an event for a given check on a given client

func (*Uchiwa) WebServer

func (u *Uchiwa) WebServer(publicPath *string, auth auth.Config)

WebServer starts the web server and serves GET & POST requests

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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