Merge pull request #12366 from zhaoxiangchun/feature/zxc-monitor_sheild_master

fix(monitor): alert record details add trigger_time field
This commit is contained in:
Zexi Li
2021-10-09 09:15:47 +08:00
committed by GitHub
2 changed files with 9 additions and 3 deletions
+8 -3
View File
@@ -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 {
+1
View File
@@ -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
}