api

package
v0.0.0-...-7cb0e1f Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2017 License: MIT Imports: 26 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 {
	Config       *config.Config
	MemberID     string
	Identifier   string
	MWHandler    *rye.MWHandler
	DebugUI      bool
	AccessTokens []string
}

func New

func New(cfg *config.Config, mwHandler *rye.MWHandler, debugUI bool, accessTokens []string) *Api

func (*Api) AlerterAddHandler

func (a *Api) AlerterAddHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

Add/Update alerter config

func (*Api) AlerterDeleteHandler

func (a *Api) AlerterDeleteHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

Delete alerter config

func (*Api) AlerterGetHandler

func (a *Api) AlerterGetHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

func (*Api) AlerterHandler

func (a *Api) AlerterHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

@Title Fetch Alerter Configuration @Description Fetch all (or specific) alerter configuration(s) from etcd @Accept json @Param check path string false "Specific check name" @Success 200 {array} fullAlerterConfig @Failure 500 {object} rye.JSONStatus @Router /alerter/{check} [get]

func (*Api) ClusterHandler

func (a *Api) ClusterHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

@Title Fetch Cluster Stats @Description Fetches cluster state data (membership, current director, heartbeats) @Success 200 {object} dal.ClusterStats @Failure 500 {object} rye.JSONStatus @Router /cluster [get]

func (*Api) EventHandler

func (a *Api) EventHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

@Title Fetch Events @Description Fetch event data (optionally filtered by one or more event types) @Accept json @Param type query string false "comma separated event types" @Success 200 {array} event.Event @Failure 500 {object} rye.JSONStatus @Router /event [get]

func (*Api) EventWithTypeHandler

func (a *Api) EventWithTypeHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

func (*Api) HomeHandler

func (a *Api) HomeHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

func (*Api) MonitorAddHandler

func (a *Api) MonitorAddHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

Add/Update monitor config

func (*Api) MonitorCheckHandler

func (a *Api) MonitorCheckHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

func (*Api) MonitorDeleteHandler

func (a *Api) MonitorDeleteHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

Delete monitor config

func (*Api) MonitorDisableHandler

func (a *Api) MonitorDisableHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

@Title Set Disabled State for Given Monitor @Description Enable or disable a specific monitor configuration (changes are immediate) @Accept json @Param check path string true "Specific check name" @Param disable query string false "Disable/enable a check" @Success 200 {array} rye.JSONStatus @Failure 500 {object} rye.JSONStatus @Router /monitor/{check} [get]

func (*Api) MonitorHandler

func (a *Api) MonitorHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

@Title Fetch Monitor Configuration @Description Fetch all (or specific) monitor configuration(s) from etcd @Accept json @Param check path string false "Specific check name" @Success 200 {array} fullMonitorConfig @Failure 500 {object} rye.JSONStatus @Router /monitor/{check} [get]

func (*Api) Run

func (a *Api) Run()

func (*Api) StateHandler

func (a *Api) StateHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

@Title Fetch Check State Data @Description Fetch check state data including latest check status, ownership, last check timestamp;

optionally filter the state data by checks that contain one or more tags.

@Accept json @Param tags query string false "One or more tags (comma separated)" @Success 200 {array} state.Message @Failure 500 {object} rye.JSONStatus @Router /state [get]

func (*Api) StateWithTagsHandler

func (a *Api) StateWithTagsHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

func (*Api) StatusHandler

func (a *Api) StatusHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

func (*Api) VersionHandler

func (a *Api) VersionHandler(rw http.ResponseWriter, r *http.Request) *rye.Response

type JSONStatus

type JSONStatus struct {
	Status  string
	Message string
}

Jump to

Keyboard shortcuts

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