Documentation
¶
Index ¶
- Constants
- func AddNote(username string, processNote string, eventcaseid string, processStatus string, ...) (err error)
- func CloseEvent(username string, colsed_note string, id string) (err error)
- func CountNumOfTlp() (c int, err error)
- func GetActionIdsFromTeamNames(teamNames string) ([]int, string, error)
- func GetCasePermission(username string) (isAdmin bool, tplIds string, err error)
- func GetTeamIdsFromUser(uid int64) ([]int64, string, error)
- func GetTeamNameFromTeamIds(teamIds []int64) ([]int64, string)
- func GetTplIdFromActionId(aids string) ([]int, string, error)
- func UpdateCloseNote(eventCaseID []string, closedNote string) error
- func WhenEndpointOnMaintain(hostId int, maintainBegin int64, maintainEnd int64) (err error, affectedRows int)
- func WhenEndpointUnbind(hostId int, hostgroupId int) (err error, affectedRows int)
- func WhenStrategyDeleted(strategyId int) (err error, affectedRows int)
- func WhenStrategyUpdated(strategyId int) (err error, affectedRows int)
- func WhenTempleteDeleted(templateId int) (err error, affectedRows int)
- func WhenTempleteUnbind(templateId int, hostgroupId int) (err error, affectedRows int)
- type Action
- type AlarmType
- type AlertsResp
- func AlertsConvert(result []EventCases) (resp []AlertsResp, endpointSet *hashset.Set, err error)
- func GetAlertInfo(resp []AlertsResp, endpointList *hashset.Set, showAll bool) (respComplete []AlertsResp)
- func GetAlertInfoFromDB(resp []AlertsResp, endpointList *hashset.Set, showAll bool) (respComplete []AlertsResp)
- func GetAlertsNotes(alerts []AlertsResp) (alertsResp []AlertsResp)
- type EventCases
- type EventNote
- type Events
- type EventsRsp
- type Host
- type PlatformExtend
- type Tpl
Constants ¶
View Source
const SkipFilter = "ALL"
Variables ¶
This section is empty.
Functions ¶
func CloseEvent ¶
will deprecated
func CountNumOfTlp ¶
func GetActionIdsFromTeamNames ¶
get actionIds from teamNames
func GetCasePermission ¶
func GetTeamIdsFromUser ¶
get teamid from userid
func GetTeamNameFromTeamIds ¶
get teamNames from teamids
func UpdateCloseNote ¶
func WhenEndpointOnMaintain ¶
func WhenEndpointUnbind ¶
func WhenStrategyDeleted ¶
func WhenStrategyUpdated ¶
func WhenTempleteDeleted ¶
Types ¶
type Action ¶
type Action struct {
Id int `json:"id"`
Uic string `json:"uic"`
Url string `json:"url"`
Callback int `json:"callback"`
BeforeCallbackSms int `json:"before_callback_sms"`
BeforeCallbackMail int `json:"before_callback_mail"`
AfterCallbackSms int `json:"after_callback_sms"`
AfterCallbackMail int `json:"after_callback_mail"`
}
type AlarmType ¶
type AlarmType struct {
Id int `json:"id" orm:"pk"`
Name string `json:"name" orm:"column(name)"`
Color string `json:"color" orm:"column(color)"`
InternalData int `json:"internal_data" orm:"column(internal_data)"`
Description string `json:"description" orm:"column(description)"`
Created time.Time `json:"created" orm:"column(created)"`
}
func GetAlarmTypeById ¶
type AlertsResp ¶
type AlertsResp struct {
// //make compatible for overall , if need it, please uncomment below
// AlarmResp
PlatformExtend
Hash string `json:"hash"`
CTmpName string `json:"c_tmp_name"`
HostName string `json:"hostname"`
Metric string `json:"metric"`
Author string `json:"author"`
TemplateID int `json:"templateID"`
Priority string `json:"priority"`
Severity string `json:"severity"`
Status string `json:"status"`
StatusRaw string `json:"statusRaw"`
//metricTyoe
Type string `json:"type"`
Content string `json:"content"`
TimeStart int64 `json:"timeStart"`
TimeUpdate int64 `json:"timeUpdate"`
Notes []map[string]string `json:"notes"`
Events []*Events `json:"events"`
Process string `json:"process"`
Function string `json:"function"`
Condition string `json:"condition"`
StepLimit int `json:"stepLimit"`
Step int `json:"step"`
// add by 201707
Activate int `json:"active"`
AlarmType string `json:"alarm_type"`
AlarmColor string `json:"alarm_color"`
ExtendedBlob string `json:"extended_blob"`
InternalData int `json:"internal_data"`
}
func AlertsConvert ¶
func AlertsConvert(result []EventCases) (resp []AlertsResp, endpointSet *hashset.Set, err error)
func GetAlertInfo ¶
func GetAlertInfo(resp []AlertsResp, endpointList *hashset.Set, showAll bool) (respComplete []AlertsResp)
func GetAlertInfoFromDB ¶
func GetAlertInfoFromDB(resp []AlertsResp, endpointList *hashset.Set, showAll bool) (respComplete []AlertsResp)
func GetAlertsNotes ¶
func GetAlertsNotes(alerts []AlertsResp) (alertsResp []AlertsResp)
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)"`
AlarmTypeId int `json:"alarm_type_id"`
Ip string `json:"ip" orm:"column(ip)`
Platform string `json:"platform" orm:"column(platform)`
Idc string `json:"idc" orm:"column(idc)"`
Contact string `json:"contact" orm:"column(contact)"`
ExtendedBlob string `json:"extended_blob" orm:"column(extended_blob)"`
}
func GetEventCases ¶
func (EventCases) AlarmType ¶
func (mine EventCases) AlarmType() AlarmType
type EventNote ¶
type EventNote struct {
Id int `json:"id" orm:"pk"`
EventCaseId string `json:"event_caseId" orm:"column(event_caseId)"`
Note string `json:"note"`
CaseId string `json:"case_id"`
Status string `json:"status"`
Timestamp time.Time `json:"timestamp"`
UserId int64 `json:"-"`
UserName string `json:"user_name" orm:"column(user_name)"`
}
type EventsRsp ¶
type EventsRsp struct {
Id int `json:"id"`
Step int `json:"step"`
Cond string `json:"cond"`
Status int `json:"status"`
Timestamp time.Time `json:"timestamp"`
Eid string `json:"event_caseId" orm:"column(eid)"`
TplCreator string `json:"tpl_creator"`
Metric string `json:"metric"`
Endpoint string `json:"endpoint"`
}
type PlatformExtend ¶
Click to show internal directories.
Click to hide internal directories.