Skip to content

Commit cbc8239

Browse files
authored
fix(alerts): use correct type un api for downtime alerts (#509)
fix(alerts): use correct type un api for downtime alerts
1 parent a76a098 commit cbc8239

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

sysdig/internal/client/v2/alerts_v2.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const (
3030
AlertV2TypeChange AlertV2Type = "PERCENTAGE_OF_CHANGE"
3131
AlertV2TypeFormBasedPrometheus AlertV2Type = "FORM_BASED_PROMETHEUS"
3232
AlertV2TypeGroupOutlier AlertV2Type = "GROUP_OUTLIERS"
33+
AlertV2TypeDowntime AlertV2Type = "DOWNTIME"
3334

3435
AlertV2SeverityHigh AlertV2Severity = "high"
3536
AlertV2SeverityMedium AlertV2Severity = "medium"

sysdig/internal/client/v2/model.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,6 @@ type AlertV2ConfigDowntime struct {
813813
GroupAggregation string `json:"groupAggregation"`
814814
TimeAggregation string `json:"timeAggregation"`
815815
Metric AlertMetricDescriptorV2 `json:"metric"`
816-
NoDataBehaviour string `json:"noDataBehaviour"`
817816
}
818817

819818
type AlertV2Downtime struct {

sysdig/resource_sysdig_monitor_alert_v2_downtime.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func resourceSysdigMonitorAlertV2DowntimeDelete(ctx context.Context, d *schema.R
154154

155155
func buildAlertV2DowntimeStruct(d *schema.ResourceData) *v2.AlertV2Downtime {
156156
alertV2Common := buildAlertV2CommonStruct(d)
157-
alertV2Common.Type = string(v2.AlertV2TypeManual)
157+
alertV2Common.Type = string(v2.AlertV2TypeDowntime)
158158
config := v2.AlertV2ConfigDowntime{}
159159

160160
buildScopedSegmentedConfigStruct(d, &config.ScopedSegmentedConfig)
@@ -175,8 +175,6 @@ func buildAlertV2DowntimeStruct(d *schema.ResourceData) *v2.AlertV2Downtime {
175175
metric := d.Get("metric").(string)
176176
config.Metric.ID = metric
177177

178-
config.NoDataBehaviour = "DO_NOTHING"
179-
180178
var unreportedAlertNotificationsRetentionSec *int
181179
if unreportedAlertNotificationsRetentionSecInterface, ok := d.GetOk("unreported_alert_notifications_retention_seconds"); ok {
182180
u := unreportedAlertNotificationsRetentionSecInterface.(int)

0 commit comments

Comments
 (0)