mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-06-07 23:09:17 +08:00
fix(monitor): alert record details add trigger_time field
This commit is contained in:
@@ -14,7 +14,11 @@
|
||||
|
||||
package monitor
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
import (
|
||||
"time"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
const (
|
||||
SEND_STATE_OK = "ok"
|
||||
@@ -41,8 +45,9 @@ type AlertRecordDetails struct {
|
||||
apis.StatusStandaloneResourceDetails
|
||||
apis.ScopedResourceBaseInfo
|
||||
|
||||
ResNum int64 `json:"res_num"`
|
||||
AlertName string `json:"alert_name"`
|
||||
ResNum int64 `json:"res_num"`
|
||||
AlertName string `json:"alert_name"`
|
||||
TriggerTime time.Time
|
||||
}
|
||||
|
||||
type AlertRecordCreateInput struct {
|
||||
|
||||
@@ -247,6 +247,7 @@ func (record *SAlertRecord) GetMoreDetails(out monitor.AlertRecordDetails) (moni
|
||||
if commonAlert != nil {
|
||||
out.AlertName = commonAlert.GetName()
|
||||
}
|
||||
out.TriggerTime = record.CreatedAt
|
||||
return out, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user