alert

package
v0.0.0-...-334dc12 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteOne

func DeleteOne(mongoClient *mongo.Client, id string) error

func GetDistinctClustersByEnvironment

func GetDistinctClustersByEnvironment(environment string, mongoClient *mongo.Client) ([]string, error)

func SeverityToLevel

func SeverityToLevel(severity string) int8

func UpdateStatus

func UpdateStatus(mongoClient *mongo.Client, id string, action string) error

Types

type Alert

type Alert struct {
	ID               string            `bson:"_id,omitempty"`
	Resource         string            `bson:"resource,omitempty"`
	Event            string            `bson:"event,omitempty"`
	Environment      string            `bson:"environment,omitempty"`
	Cluster          string            `bson:"cluster,omitempty"`
	SeverityCode     int8              `bson:"severityCode,omitempty"`
	SeverityName     string            `bson:"severityName,omitempty"`
	Correlate        map[string]string `bson:"correlate,omitempty"`
	Status           string            `bson:"status,omitempty"`
	Service          string            `bson:"service,omitempty"`
	Group            string            `bson:"group,omitempty"`
	Value            string            `bson:"value,omitempty"` // TODO: what is this?
	Text             string            `bson:"text,omitempty"`
	Summary          string            `bson:"summary,omitempty"`
	Tags             map[string]string `bson:"tags,omitempty"`
	Attributes       map[string]string `bson:"attributes,omitempty"`
	Origin           string            `bson:"origin,omitempty"`
	Type             string            `bson:"type,omitempty"`
	Fingerprint      string            `bson:"fingerprint,omitempty"`
	GeneratorURL     string            `bson:"generatorURL,omitempty"`
	RunbookURL       string            `bson:"runbookURL,omitempty"`
	CreateTime       time.Time         `bson:"createTime,omitempty"`
	Timeout          time.Time         `bson:"timeout,omitempty"`
	RawData          string            `bson:"rawData,omitempty"`
	DuplicateCount   int               `bson:"duplicateCount,omitempty"`
	Repeat           bool              `bson:"repeat,omitempty"`
	PreviousSeverity string            `bson:"previousSeverity,omitempty"`
	TrendIndication  string            `bson:"trendIndication,omitempty"`
	ReceiveTime      time.Time         `bson:"receiveTime,omitempty"`
	UpdateTime       time.Time         `bson:"updateTime,omitempty"`
}

func FindByFingerprint

func FindByFingerprint(mongoClient *mongo.Client, fingerprint string) (*Alert, error)

func GetAll

func GetAll(envFilter string, mongoClient *mongo.Client) ([]Alert, error)

func GetOne

func GetOne(mongoClient *mongo.Client, id string) (*Alert, error)

func (*Alert) Create

func (a *Alert) Create(c *mongo.Client) (interface{}, error)

func (*Alert) FindDuplicate

func (a *Alert) FindDuplicate(c *mongo.Client) *Alert

func (*Alert) UpdateDuplicated

func (a *Alert) UpdateDuplicated(c *mongo.Client, wa *Alert) (interface{}, error)

Jump to

Keyboard shortcuts

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