model

package
v0.0.0-...-2f28f2a Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Name            string `yaml:"name" json:"name"`
	DestinationName string `json:"destination_name,omitempty"`
	DestinationID   string `yaml:"destinationID" json:"destination_id"`
	SubjectTemplate Script `yaml:"subject" json:"subject_template"`
	MessageTemplate Script `yaml:"message" json:"message_template"`
}

type BoolParam

type BoolParam struct {
	Must               []MustParam `yaml:"must" json:"must"`
	MustNot            []MustParam `yaml:"must_not" json:"must_not"`
	Boost              float64     `yaml:"boost" json:"boost"`
	AdjustPureNegative bool        `yaml:"adjust_pure_negative" json:"adjust_pure_negative"`
}

type Condition

type Condition struct {
	Script Script `yaml:"script" json:"script"`
}

type CustomWebhook

type CustomWebhook struct {
	HeaderParams map[string]string `json:"header_params,omitempty" yaml:",omitempty"`
	QueryParams  map[string]string `json:"query_params,omitempty" yaml:",omitempty"`
	Path         string            `json:"path,omitempty" yaml:",omitempty"`
	Password     string            `json:"password,omitempty" yaml:",omitempty"`
	Scheme       string            `json:"scheme,omitempty" yaml:",omitempty"`
	Host         string            `json:"host,omitempty" yaml:",omitempty"`
	URL          string            `json:"url,omitempty" yaml:",omitempty"`
	Username     string            `json:"username,omitempty" yaml:",omitempty"`
	Port         int               `json:"port,omitempty" yaml:",omitempty"`
}

type Destination

type Destination struct {
	ID            string        `json:"id"`
	Name          string        `json:"name"`
	Type          string        `json:"type"`
	Slack         Slack         `json:"slack,omitempty" yaml:",omitempty"`
	CustomWebhook CustomWebhook `json:"custom_webhook,omitempty" yaml:",omitempty"`
}

type ElasticFetchResponse

type ElasticFetchResponse struct {
	Hits struct {
		Hits []struct {
			ID     string `json:"_id"`
			Source struct {
				Destination Destination `json:"destination,omitempty"`
				Monitor     Monitor     `json:"monitor,omitempty"`
			} `json:"_source"`
		} `json:"hits"`
	} `json:"hits"`
}

type InnerQuery

type InnerQuery struct {
	Bool BoolParam `yaml:"bool" json:"bool"`
}

type Input

type Input struct {
	Search Search `yaml:"search" json:"search"`
}

type Monitor

type Monitor struct {
	Schedule Schedule  `yaml:"schedule" json:"schedule"`
	ID       string    `yaml:"-" json:"-"`
	Type     string    `yaml:"type" json:"type"`
	Name     string    `yaml:"name" json:"name"`
	Inputs   []Input   `yaml:"inputs" json:"inputs"`
	Triggers []Trigger `yaml:"triggers" json:"triggers"`
	Enabled  bool      `yaml:"enabled" json:"enabled"`
}

type MustParam

type MustParam struct {
	Match map[string]any `yaml:"match" json:"match,omitempty"`
	Range map[string]any `yaml:"range" json:"range,omitempty"`
}

type Period

type Period struct {
	Unit     string `yaml:"unit" json:"unit"`
	Interval int    `yaml:"interval" json:"interval"`
}

type QueryParam

type QueryParam struct {
	Query InnerQuery `yaml:"query" json:"query"`
}

type RangeParam

type RangeParam struct {
	Field        string `yaml:"field" json:"field"`
	From         string `yaml:"from" json:"from"`
	TimeZone     string `yaml:"time_zone" json:"timeZone"`
	To           string `yaml:"to" json:"to"`
	Boost        int    `yaml:"boost" json:"boost"`
	IncludeLower bool   `yaml:"include_lower" json:"include_lower"`
	IncludeUpper bool   `yaml:"include_upper" json:"includeUpper"`
}

type Schedule

type Schedule struct {
	Period Period `yaml:"period" json:"period"`
}

type Script

type Script struct {
	Source string `json:"source"`
	Lang   string `json:"lang"`
}
type Search struct {
	Indices []string   `yaml:"indices" json:"indices"`
	Query   QueryParam `yaml:"query" json:"query"`
}

type Slack

type Slack struct {
	URL string `json:"url,omitempty" yaml:",omitempty"`
}

type Trigger

type Trigger struct {
	ID        string    `yaml:"-" json:"id"`
	Name      string    `yaml:"name" json:"name"`
	Severity  string    `yaml:"severity" json:"severity"`
	Condition Condition `yaml:"condition" json:"condition"`
	Actions   []Action  `yaml:"actions" json:"actions"`
}

type UpdateMonitorResponse

type UpdateMonitorResponse struct {
	ID          string  `json:"_id"`
	Monitor     Monitor `json:"monitor"`
	Version     int     `json:"_version"`
	SeqNo       int     `json:"_seq_no"`
	PrimaryTerm int     `json:"_primary_term"`
}

Jump to

Keyboard shortcuts

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