fix(monitor): alert record details add trigger_time field

This commit is contained in:
zhaoxiangchun
2021-10-08 17:11:28 +08:00
parent 83e80c8733
commit 0dd1071fb9
2 changed files with 9 additions and 3 deletions

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 {

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
}