@@ -189,7 +189,8 @@ type Alert struct {
189189 NotificationChannelIds []int `json:"notificationChannelIds"`
190190 Filter string `json:"filter"`
191191 Severity int `json:"severity"`
192- Timespan int `json:"timespan"`
192+ Timespan * int `json:"timespan,omitempty"`
193+ Duration * int `json:"duration,omitempty"`
193194 CustomNotification * CustomNotification `json:"customNotification"`
194195 TeamID int `json:"teamId,omitempty"`
195196 AutoCreated bool `json:"autoCreated"`
@@ -712,12 +713,13 @@ type AlertV2Common struct {
712713type AlertV2ConfigPrometheus struct {
713714 Query string `json:"query"`
714715 KeepFiringForSec * int `json:"keepFiringForSec,omitempty"`
716+
717+ Duration int `json:"duration"`
715718}
716719
717720type AlertV2Prometheus struct {
718721 AlertV2Common
719- DurationSec int `json:"durationSec"`
720- Config AlertV2ConfigPrometheus `json:"config"`
722+ Config AlertV2ConfigPrometheus `json:"config"`
721723}
722724
723725type alertV2PrometheusWrapper struct {
@@ -755,12 +757,13 @@ type AlertV2ConfigEvent struct {
755757
756758 Filter string `json:"filter"`
757759 Tags []string `json:"tags"`
760+
761+ Range int `json:"range"`
758762}
759763
760764type AlertV2Event struct {
761765 AlertV2Common
762- DurationSec int `json:"durationSec"`
763- Config AlertV2ConfigEvent `json:"config"`
766+ Config AlertV2ConfigEvent `json:"config"`
764767}
765768
766769type alertV2EventWrapper struct {
@@ -796,11 +799,13 @@ type AlertV2ConfigMetric struct {
796799 TimeAggregation string `json:"timeAggregation"`
797800 Metric AlertMetricDescriptorV2 `json:"metric"`
798801 NoDataBehaviour string `json:"noDataBehaviour"`
802+
803+ Range int `json:"range"`
804+ Duration int `json:"duration"`
799805}
800806
801807type AlertV2Metric struct {
802808 AlertV2Common
803- DurationSec int `json:"durationSec"`
804809 Config AlertV2ConfigMetric `json:"config"`
805810 UnreportedAlertNotificationsRetentionSec * int `json:"unreportedAlertNotificationsRetentionSec"`
806811}
@@ -818,11 +823,12 @@ type AlertV2ConfigDowntime struct {
818823 GroupAggregation string `json:"groupAggregation"`
819824 TimeAggregation string `json:"timeAggregation"`
820825 Metric AlertMetricDescriptorV2 `json:"metric"`
826+
827+ Range int `json:"range"`
821828}
822829
823830type AlertV2Downtime struct {
824831 AlertV2Common
825- DurationSec int `json:"durationSec"`
826832 Config AlertV2ConfigDowntime `json:"config"`
827833 UnreportedAlertNotificationsRetentionSec * int `json:"unreportedAlertNotificationsRetentionSec"`
828834}
@@ -856,11 +862,12 @@ type AlertV2ConfigFormBasedPrometheus struct {
856862 WarningConditionOperator string `json:"warningConditionOperator,omitempty"`
857863 WarningThreshold * float64 `json:"warningThreshold,omitempty"`
858864 NoDataBehaviour string `json:"noDataBehaviour"`
865+
866+ Duration int `json:"duration"`
859867}
860868
861869type AlertV2FormBasedPrometheus struct {
862870 AlertV2Common
863- DurationSec int `json:"durationSec"` // not really used but the api wants it set to 0 in POST/PUT
864871 Config AlertV2ConfigFormBasedPrometheus `json:"config"`
865872 UnreportedAlertNotificationsRetentionSec * int `json:"unreportedAlertNotificationsRetentionSec"`
866873}
@@ -881,11 +888,12 @@ type AlertV2ConfigGroupOutlier struct {
881888 TimeAggregation string `json:"timeAggregation"`
882889 Metric AlertMetricDescriptorV2 `json:"metric"`
883890 NoDataBehaviour string `json:"noDataBehaviour"`
891+
892+ ObservationWindow int `json:"observationWindow"`
884893}
885894
886895type AlertV2GroupOutlier struct {
887896 AlertV2Common
888- DurationSec int `json:"durationSec"` // Observation window should be greater than or equal to 10 minutes
889897 Config AlertV2ConfigGroupOutlier `json:"config"`
890898 UnreportedAlertNotificationsRetentionSec * int `json:"unreportedAlertNotificationsRetentionSec"`
891899}
@@ -896,7 +904,6 @@ type alertV2GroupOutlierWrapper struct {
896904
897905type AlertV2Change struct {
898906 AlertV2Common
899- DurationSec int `json:"durationSec"` // not really used but the api wants it set to 0 in POST/PUT
900907 Config AlertV2ConfigChange `json:"config"`
901908 UnreportedAlertNotificationsRetentionSec * int `json:"unreportedAlertNotificationsRetentionSec"`
902909}
0 commit comments