Documentation ¶
Index ¶
- func GetAllLocal(rootDir string) (map[string]Monitor, mapset.Set, error)
- func GetAllRemote(esClient es.Client, destinationsMap map[string]string) (map[string]Monitor, mapset.Set, error)
- type Action
- type Condition
- type Cron
- type Monitor
- func (monitor *Monitor) Create(esClient es.Client) error
- func (monitor *Monitor) Delete(esClient es.Client) error
- func (monitor *Monitor) Prepare(remoteMonitor Monitor, destinationsMap map[string]string, isUpdate bool, ...) error
- func (monitor *Monitor) Run(esClient es.Client, dryRun bool) error
- func (monitor *Monitor) Update(esClient es.Client) error
- type Period
- type Schedule
- type Script
- type Search
- type Trigger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllLocal ¶
GetAllLocal Parse all local monitors under rootDir
Types ¶
type Action ¶
type Action struct { ID string `json:"id,omitempty" yaml:"-"` Name string `json:"name"` DestinationID string `json:"destination_id,omitempty" yaml:"destinationId"` // Why duplicated Subject and Message ? This is to simplify customer experience on writing new monitors. // Taking input which is important default are being filled by CLI Subject string `json:"-"` Message string `json:"-"` SubjectTemplate Script `json:"subject_template" yaml:"-"` MessageTemplate Script `json:"message_template" yaml:"-"` }
Action action model
type Condition ¶
type Condition struct {
Script Script `json:"script"`
}
Condition define condition for the triggers
type Monitor ¶
type Monitor struct { Name string `json:"name"` Enabled bool `json:"enabled"` Schedule Schedule `json:"schedule"` Inputs []Search `json:"inputs"` Triggers []Trigger `json:"triggers"` // contains filtered or unexported fields }
Monitor Alert monitor object
func (*Monitor) Prepare ¶
func (monitor *Monitor) Prepare( remoteMonitor Monitor, destinationsMap map[string]string, isUpdate bool, odVersion int) error
Prepare will modify the monitor to populate correct IDs
type Schedule ¶
type Schedule struct { Period *Period `json:"period,omitempty"` Cron *Cron `json:"cron,omitempty"` }
Schedule type of Monitor (Cron / Period)
type Search ¶
type Search struct { Search struct { Indices []string `json:"indices"` Query map[string]interface{} `json:"query"` } `json:"search"` }
Search hello
type Trigger ¶
type Trigger struct { ID string `json:"id,omitempty" yaml:"-"` Name string `json:"name"` Severity string `json:"severity"` //YCondition (YAML Condition), is to to minimize customer input for now YCondition string `json:"-" yaml:"condition"` Condition Condition `json:"condition" yaml:"-"` Actions []Action `json:"actions,omitempty"` }
Trigger define a Trigger struct
Click to show internal directories.
Click to hide internal directories.