apis

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MicroService = "micro_service"
	ClusterName  = "cluster_name"

	Org = "org"
	Msp = "msp"

	TriggerCondition = "trigger_condition"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertConditions added in v1.5.0

type AlertConditions struct {
	Scope      string        `yaml:"scope"`
	Conditions []*Conditions `yaml:"conditions"`
}

type Conditions added in v1.5.0

type Conditions struct {
	Key     string   `json:"key"`
	Index   string   `json:"index"`
	Filters []string `json:"filters"`
}

type MicroAlertAPI

type MicroAlertAPI interface {
	GetMicroServiceFilterTags() map[string]bool

	// micro alert apis
	QueryAlertRule(r *http.Request, scope, scopeId string) (*pb.AlertTypeRuleResp, error)
	QueryAlert(r *http.Request, scope, scopeId string, pageNum, pageSize uint64) ([]*pb.Alert, error)
	GetAlert(lang i18n.LanguageCodes, id uint64) (*pb.Alert, error)
	CountAlert(scope, scopeID string) (int, error)
	GetAlertDetail(r *http.Request, id uint64) (*pb.Alert, error)
	CheckAlert(alert *pb.Alert) interface{}
	CreateAlert(alert *pb.Alert) (alertID uint64, err error)
	UpdateAlert(alertID uint64, alert *pb.Alert) (err error)
	UpdateAlertEnable(id uint64, enable bool) (err error)
	DeleteAlert(id uint64) (err error)

	// micro custom alert apis
	CustomizeMetrics(lang i18n.LanguageCodes, scope, scopeID string, names []string) (*pb.CustomizeMetrics, error)
	NotifyTargetsKeys(lang i18n.LanguageCodes, orgId string) []*pb.DisplayKey
	CustomizeAlerts(lang i18n.LanguageCodes, scope, scopeID string, pageNo, pageSize int) ([]*pb.CustomizeAlertOverview, int, error)
	CustomizeAlert(id uint64) (*pb.CustomizeAlertDetail, error)
	CustomizeAlertDetail(id uint64) (*pb.CustomizeAlertDetail, error)
	CheckCustomizeAlert(alert *pb.CustomizeAlertDetail) error
	CreateCustomizeAlert(alertDetail *pb.CustomizeAlertDetail) (alertID uint64, err error)
	UpdateCustomizeAlert(alertDetail *pb.CustomizeAlertDetail) (err error)
	UpdateCustomizeAlertEnable(id uint64, enable bool) (err error)
	DeleteCustomizeAlert(id uint64) (err error)

	//micro custom alert records
	GetAlertRecordAttr(lang i18n.LanguageCodes, scope string) (*pb.AlertRecordAttr, error)
	QueryAlertRecord(lang i18n.LanguageCodes, scope, scopeId string, alertGroup, alertState, alertType,
		handleState, handlerId []string, pageNo, pageSize int64) ([]*pb.AlertRecord, error)
	CountAlertRecord(scope, scopeId string, alertGroups, alertStates, alertTypes, handleStates, handlerIDs []string) (int, error)
	GetAlertRecord(lang i18n.LanguageCodes, groupId string) (*pb.AlertRecord, error)
	QueryAlertHistory(lang i18n.LanguageCodes, groupId string, start, end int64, limit uint) ([]*pb.AlertHistory, error)
	CreateAlertRecordIssue(groupId string, issueCreate *apistructs.IssueCreateRequest) (uint64, error)
	UpdateAlertRecordIssue(groupId string, issueId uint64, request *apistructs.IssueUpdateRequest) error
	DashboardPreview(alert *pb.CustomizeAlertDetail) (res *block.View, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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