alert

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleListAlertTemplates

func HandleListAlertTemplates(svc *Service, tag string, suppliedAlertVariableNames []string) http.HandlerFunc

Types

type Alert

type Alert struct {
	ID          string    `json:"id"`
	Resource    string    `json:"resource"`
	Metric      string    `json:"metric"`
	Value       string    `json:"value"`
	Severity    string    `json:"severity"`
	Rule        string    `json:"Rule"`
	TriggeredAt time.Time `json:"triggered_at"`
}

type Policy

type Policy struct {
	Resource string `json:"resource"`
	Rules    []Rule `json:"rules"`
}

type Rule

type Rule struct {
	ID        string     `json:"id"`
	Template  string     `json:"Template"`
	Enabled   bool       `json:"enabled"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	Variables []Variable `json:"variables"`
}

type Service

type Service struct {
	Siren sirenv1beta1.SirenServiceClient
}

func (*Service) GetAlertPolicy

func (s *Service) GetAlertPolicy(ctx context.Context, projectSlug string, resource string) (*Policy, error)

func (*Service) GetAlertTemplate

func (s *Service) GetAlertTemplate(ctx context.Context, urn string) (*Template, error)

func (*Service) GetProjectDataSource

func (s *Service) GetProjectDataSource(ctx context.Context, projectSlug string) (string, error)

func (*Service) ListAlertTemplates

func (s *Service) ListAlertTemplates(ctx context.Context, tag string) ([]Template, error)

func (*Service) ListAlerts

func (s *Service) ListAlerts(ctx context.Context, projectSlug string, resource string) ([]Alert, error)

func (*Service) UpsertAlertPolicy

func (s *Service) UpsertAlertPolicy(ctx context.Context, projectSlug string, update Policy) (*Policy, error)

type Template

type Template struct {
	ID        string     `json:"id"`
	Name      string     `json:"name"`
	Body      string     `json:"body"`
	Tags      []string   `json:"tags"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	Variables []Variable `json:"variables"`
}

type Variable

type Variable struct {
	Name        string `json:"name"`
	Value       string `json:"value,omitempty"`
	Default     string `json:"default,omitempty"`
	Type        string `json:"type"`
	Description string `json:"description"`
}

Jump to

Keyboard shortcuts

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