event

package
v0.0.0-...-5416f79 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2017 License: Apache-2.0, Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertEvent

func InsertEvent(eve *coommonModel.Event, alarmType string) error

func InsertExternalEvent

func InsertExternalEvent(exevent ExternalEvent) error

Types

type AlarmType

type AlarmType struct {
	Id           int       `json:"id" orm:"pk"`
	Name         string    `json:"name" orm:"column(name)"`
	InternalData int       `json:"internal_data" orm:"column(internal_data)"`
	Description  string    `json:"description" orm:"column(description)"`
	Created      time.Time `json:"created" orm:"column(created)"`
}

type EventCases

type EventCases struct {
	// uniuq
	Id       string `json:"id" orm:"pk"`
	Endpoint string `json:"endpoint"`
	Metric   string `json:"metric"`
	Func     string `json:"func"`
	Cond     string `json:"cond"`
	Note     string `json:"note"`
	//leftValue + operator + rightValue
	MaxStep       int       `json:"max_step"`
	CurrentStep   int       `json:"current_step"`
	Priority      int       `json:"priority"`
	Status        string    `json:"status"`
	Timestamp     time.Time `json:"start_at"`
	UpdateAt      time.Time `json:"update_at"`
	ProcessNote   int       `json:"process_note"`
	ProcessStatus string    `json:"process_status"`
	TplCreator    string    `json:"tpl_creator"`
	ExpressionId  int       `json:"expression_id"`
	StrategyId    int       `json:"strategy_id"`
	TemplateId    int       `json:"template_id"`
	Events        []*Events `json:"evevnts" orm:"reverse(many)"`
	// add on 2017/07
	AlarmTypeId  int    `json:"alarm_type_id" orm:"column(alarm_type_id)"`
	IP           string `json:"ip" orm:"column(ip)"`
	IDC          string `json:"idc" orm:"column(idc)"`
	Platform     string `json:"platform" orm:"column(platform)"`
	Contact      string `json:"contact" orm:"column(contact)"`
	ExtendedBLOB string `json:"extended_blob" orm:"column(extended_blob)"`
}

type Events

type Events struct {
	Id          int         `json:"id" orm:"pk"`
	Step        int         `json:"step"`
	Cond        string      `json:"cond"`
	Status      int         `json:"status"`
	Timestamp   time.Time   `json:"timestamp"`
	EventCaseId *EventCases `json:"event_caseId" orm:"rel(fk)"`
}

type ExternalEvent

type ExternalEvent struct {
	AlarmType          string            `json:"alarm_type"`
	Status             int               `json:"status"`
	Target             string            `json:"target"`
	Metric             string            `json:"metric"`
	CurrentStep        int               `json:"current_step"`
	EventTime          int64             `json:"event_time"`
	Priority           int               `json:"priority"`
	TriggerId          int               `json:"trigger_id"`
	TriggerDescription string            `json:"trigger_description"`
	TriggerCondition   string            `json:"trigger_condition"`
	Note               string            `json:"note"`
	PushedTags         map[string]string `json:"pushed_tags"`
	ExtendedBlob       map[string]string `json:"extended_blob"`
}

func (*ExternalEvent) CheckFormating

func (mine *ExternalEvent) CheckFormating() error

func (*ExternalEvent) ExpressionId

func (mine *ExternalEvent) ExpressionId() int

func (*ExternalEvent) ExtendedBlobStr

func (mine *ExternalEvent) ExtendedBlobStr() string

func (ExternalEvent) ForceFixStepWhenStatusOk

func (mine ExternalEvent) ForceFixStepWhenStatusOk() ExternalEvent

func (*ExternalEvent) GetKey

func (mine *ExternalEvent) GetKey(key string) string

func (*ExternalEvent) Id

func (mine *ExternalEvent) Id() string

func (*ExternalEvent) MaxStep

func (mine *ExternalEvent) MaxStep() int

set 99 is defult display value.

func (*ExternalEvent) StatusStr

func (mine *ExternalEvent) StatusStr() string

func (*ExternalEvent) StrategyId

func (mine *ExternalEvent) StrategyId() int

func (*ExternalEvent) TplId

func (mine *ExternalEvent) TplId() int

Jump to

Keyboard shortcuts

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