Skip to content

Commit fc1e5bf

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Fix test by adding on_missing_data options to the req payload (#1788)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent d03ee32 commit fc1e5bf

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

examples/v1_monitors_CreateMonitor_1539578087.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use datadog_api_client::datadogV1::model::MonitorOptionsSchedulingOptions;
1010
use datadog_api_client::datadogV1::model::MonitorOptionsSchedulingOptionsEvaluationWindow;
1111
use datadog_api_client::datadogV1::model::MonitorThresholds;
1212
use datadog_api_client::datadogV1::model::MonitorType;
13+
use datadog_api_client::datadogV1::model::OnMissingDataOption;
1314

1415
#[tokio::main]
1516
async fn main() {
@@ -24,6 +25,7 @@ async fn main() {
2425
MonitorOptions::new()
2526
.include_tags(false)
2627
.notify_audit(false)
28+
.on_missing_data(OnMissingDataOption::DEFAULT)
2729
.scheduling_options(
2830
MonitorOptionsSchedulingOptions::new()
2931
.custom_schedule(MonitorOptionsCustomSchedule::new().recurrences(vec![

tests/scenarios/cassettes/v1/monitors/Create-a-metric-monitor-with-a-custom-schedule-returns-OK-response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"request": {
55
"body": {
6-
"string": "{\"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\"}",
6+
"string": "{\"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\"}",
77
"encoding": null
88
},
99
"headers": {

tests/scenarios/features/v1/monitors.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Feature: Monitors
122122
@team:DataDog/monitor-app
123123
Scenario: Create a metric monitor with a custom schedule returns "OK" response
124124
Given new "CreateMonitor" request
125-
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"}
125+
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"}
126126
When the request is sent
127127
Then the response status is 200 OK
128128
And the response "name" is equal to "{{ unique }}"

0 commit comments

Comments
 (0)