mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #10179 from zhaoxiangchun/bugfix/zxc-monitor-resouceName
fix(monitor): fix update alert duration fail
This commit is contained in:
@@ -136,6 +136,8 @@ type AlertUpdateInput struct {
|
||||
|
||||
// 报警执行频率
|
||||
Frequency *int64 `json:"frequency"`
|
||||
// 报警持续时间
|
||||
For int64 `json:"for"`
|
||||
// 报警设置
|
||||
Settings *AlertSetting `json:"settings"`
|
||||
// 启用报警
|
||||
|
||||
@@ -827,6 +827,7 @@ func (alert *SCommonAlert) ValidateUpdateData(
|
||||
if err != nil {
|
||||
return data, errors.Wrap(err, "SAlert.ValidateUpdateData")
|
||||
}
|
||||
updataInput.For = alertCreateInput.For
|
||||
data.Update(jsonutils.Marshal(updataInput))
|
||||
}
|
||||
return data, nil
|
||||
@@ -878,6 +879,7 @@ func (alert *SCommonAlert) getUpdateAlertInput(updateInput monitor.CommonAlertUp
|
||||
input := monitor.CommonAlertCreateInput{
|
||||
CommonMetricInputQuery: updateInput.CommonMetricInputQuery,
|
||||
Period: updateInput.Period,
|
||||
AlertDuration: updateInput.AlertDuration,
|
||||
}
|
||||
alertCreateInput := CommonAlertManager.toAlertCreatInput(input)
|
||||
return alertCreateInput
|
||||
|
||||
Reference in New Issue
Block a user