diff --git a/examples/v1/monitors/CreateMonitor_1539578087.py b/examples/v1/monitors/CreateMonitor_1539578087.py index fabf1fe1f9..f9dc0b99b3 100644 --- a/examples/v1/monitors/CreateMonitor_1539578087.py +++ b/examples/v1/monitors/CreateMonitor_1539578087.py @@ -17,6 +17,7 @@ ) from datadog_api_client.v1.model.monitor_thresholds import MonitorThresholds from datadog_api_client.v1.model.monitor_type import MonitorType +from datadog_api_client.v1.model.on_missing_data_option import OnMissingDataOption body = Monitor( message="some message Notify: @hipchat-channel", @@ -29,6 +30,7 @@ ), notify_audit=False, include_tags=False, + on_missing_data=OnMissingDataOption.DEFAULT, scheduling_options=MonitorOptionsSchedulingOptions( evaluation_window=MonitorOptionsSchedulingOptionsEvaluationWindow( day_starts="04:00", diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_metric_monitor_with_a_custom_schedule_returns_ok_response.yaml b/tests/v1/cassettes/test_scenarios/test_create_a_metric_monitor_with_a_custom_schedule_returns_ok_response.yaml index e4058bfe49..148d4df247 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_a_metric_monitor_with_a_custom_schedule_returns_ok_response.yaml +++ b/tests/v1/cassettes/test_scenarios/test_create_a_metric_monitor_with_a_custom_schedule_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"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{*} + body: '{"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: accept: diff --git a/tests/v1/features/monitors.feature b/tests/v1/features/monitors.feature index e3e5ca6c41..eabe7b2afe 100644 --- a/tests/v1/features/monitors.feature +++ b/tests/v1/features/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 }}"