diff --git a/examples/v1/monitors/CreateMonitor_1539578087.java b/examples/v1/monitors/CreateMonitor_1539578087.java index 611acd53d05..322033c6143 100644 --- a/examples/v1/monitors/CreateMonitor_1539578087.java +++ b/examples/v1/monitors/CreateMonitor_1539578087.java @@ -12,6 +12,7 @@ import com.datadog.api.client.v1.model.MonitorOptionsSchedulingOptionsEvaluationWindow; import com.datadog.api.client.v1.model.MonitorThresholds; import com.datadog.api.client.v1.model.MonitorType; +import com.datadog.api.client.v1.model.OnMissingDataOption; import java.util.Collections; public class Example { @@ -29,6 +30,7 @@ public static void main(String[] args) { .thresholds(new MonitorThresholds().critical(0.5)) .notifyAudit(false) .includeTags(false) + .onMissingData(OnMissingDataOption.DEFAULT) .schedulingOptions( new MonitorOptionsSchedulingOptions() .evaluationWindow( diff --git a/src/test/resources/cassettes/features/v1/Create_a_metric_monitor_with_a_custom_schedule_returns_OK_response.json b/src/test/resources/cassettes/features/v1/Create_a_metric_monitor_with_a_custom_schedule_returns_OK_response.json index 68f8fb86d8c..24aa5c81891 100644 --- a/src/test/resources/cassettes/features/v1/Create_a_metric_monitor_with_a_custom_schedule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v1/Create_a_metric_monitor_with_a_custom_schedule_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"draft_status\": \"published\", \"message\": \"some message Notify: @hipchat-channel\", \"name\": \"Test-Create_a_metric_monitor_with_a_custom_schedule_returns_OK_response-1747261709\", \"options\": {\"include_tags\": false, \"notify_audit\": false, \"scheduling_options\": {\"custom_schedule\": {\"recurrences\": [{\"rrule\": \"FREQ=DAILY;INTERVAL=1\", \"start\": \"2024-10-26T09:13:00\", \"timezone\": \"America/Los_Angeles\"}]}, \"evaluation_window\": {\"day_starts\": \"04:00\", \"month_starts\": 1}}, \"thresholds\": {\"critical\": 0.5}}, \"query\": \"avg(current_1mo):avg:system.load.5{*} > 0.5\", \"tags\": [], \"type\": \"query alert\"}" + "json": "{\"draft_status\": \"published\", \"message\": \"some message Notify: @hipchat-channel\", \"name\": \"Test-Create_a_metric_monitor_with_a_custom_schedule_returns_OK_response-1747261709\", \"options\": {\"include_tags\": false, \"notify_audit\": false, \"on_missing_data\": \"default\", \"scheduling_options\": {\"custom_schedule\": {\"recurrences\": [{\"rrule\": \"FREQ=DAILY;INTERVAL=1\", \"start\": \"2024-10-26T09:13:00\", \"timezone\": \"America/Los_Angeles\"}]}, \"evaluation_window\": {\"day_starts\": \"04:00\", \"month_starts\": 1}}, \"thresholds\": {\"critical\": 0.5}}, \"query\": \"avg(current_1mo):avg:system.load.5{*} > 0.5\", \"tags\": [], \"type\": \"query alert\"}" }, "headers": {}, "method": "POST", @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "74a4aebf-899a-e69e-554a-79667da36952" + "id": "adae6914-57e7-fd43-a18c-9a696be62335" }, { "httpRequest": { diff --git a/src/test/resources/com/datadog/api/client/v1/api/monitors.feature b/src/test/resources/com/datadog/api/client/v1/api/monitors.feature index e3e5ca6c410..eabe7b2afe7 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/monitors.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/monitors.feature @@ -122,7 +122,7 @@ Feature: Monitors @team:DataDog/monitor-app Scenario: Create a metric monitor with a custom schedule returns "OK" response Given new "CreateMonitor" request - And body with value {"message":"some message Notify: @hipchat-channel","name":"{{ unique }}","query":"avg(current_1mo):avg:system.load.5{*} > 0.5","tags":[],"options":{"thresholds":{"critical":0.5},"notify_audit":false,"include_tags":false,"scheduling_options":{"evaluation_window":{"day_starts":"04:00", "month_starts":1},"custom_schedule":{"recurrences":[{"rrule":"FREQ=DAILY;INTERVAL=1","timezone":"America/Los_Angeles","start":"2024-10-26T09:13:00"}]}}},"type":"query alert", "draft_status": "published"} + And body with value {"message":"some message Notify: @hipchat-channel","name":"{{ unique }}","query":"avg(current_1mo):avg:system.load.5{*} > 0.5","tags":[],"options":{"thresholds":{"critical":0.5},"notify_audit":false,"include_tags":false,"on_missing_data":"default","scheduling_options":{"evaluation_window":{"day_starts":"04:00", "month_starts":1},"custom_schedule":{"recurrences":[{"rrule":"FREQ=DAILY;INTERVAL=1","timezone":"America/Los_Angeles","start":"2024-10-26T09:13:00"}]}}},"type":"query alert", "draft_status": "published"} When the request is sent Then the response status is 200 OK And the response "name" is equal to "{{ unique }}"