From 54e66e64e01cd044f16b584724d74e30a391f46b Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 16 Aug 2022 17:33:44 +0000 Subject: [PATCH] Regenerate client from commit 5277ca03 of spec repo --- .apigentools-info | 8 +-- .generator/schemas/v1/openapi.yaml | 39 +++++++++++ .../frozen.json | 2 +- .../recording.har | 70 +++++++++---------- .../frozen.json | 2 +- .../recording.har | 70 +++++++++---------- .../frozen.json | 2 +- .../recording.har | 46 ++++++------ .../frozen.json | 2 +- .../recording.har | 50 ++++++------- .../frozen.json | 2 +- .../recording.har | 48 ++++++------- .../frozen.json | 2 +- .../recording.har | 54 +++++++------- .../frozen.json | 2 +- .../recording.har | 52 +++++++------- .../frozen.json | 2 +- .../recording.har | 14 ++-- .../frozen.json | 1 + .../recording.har | 67 ++++++++++++++++++ .../frozen.json | 2 +- .../recording.har | 34 ++++----- .../frozen.json | 2 +- .../recording.har | 38 +++++----- .../v1/monitors/ValidateExistingMonitor.ts | 1 + examples/v1/monitors/ValidateMonitor.ts | 1 + .../v1/monitors/ValidateMonitor_4247196452.ts | 49 +++++++++++++ features/v1/given.json | 2 +- features/v1/monitor_payload.json | 1 + features/v1/monitors.feature | 9 ++- features/v1/multi_alert_monitor_payload.json | 26 +++++++ packages/datadog-api-client-v1/index.ts | 1 + .../models/MonitorOptions.ts | 24 +++++++ .../models/ObjectSerializer.ts | 6 ++ .../models/OnMissingDataOption.ts | 15 ++++ 35 files changed, 492 insertions(+), 254 deletions(-) create mode 100644 cassettes/v1/Monitors_4022238206/Validate-a-multi-alert-monitor-returns-OK-response_3334762130/frozen.json create mode 100644 cassettes/v1/Monitors_4022238206/Validate-a-multi-alert-monitor-returns-OK-response_3334762130/recording.har create mode 100644 examples/v1/monitors/ValidateMonitor_4247196452.ts create mode 100644 features/v1/multi_alert_monitor_payload.json create mode 100644 packages/datadog-api-client-v1/models/OnMissingDataOption.ts diff --git a/.apigentools-info b/.apigentools-info index 7263d3f14214..ea2715b5ed20 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.2", - "regenerated": "2022-08-15 14:37:09.699404", - "spec_repo_commit": "51cbf00f" + "regenerated": "2022-08-16 17:32:05.780949", + "spec_repo_commit": "5277ca03" }, "v2": { "apigentools_version": "1.6.2", - "regenerated": "2022-08-15 14:37:09.711637", - "spec_repo_commit": "51cbf00f" + "regenerated": "2022-08-16 17:32:05.794831", + "spec_repo_commit": "5277ca03" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 2497eb5193e1..4c0e49614297 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -6131,6 +6131,17 @@ components: format: int64 nullable: true type: integer + group_retention_duration: + description: 'The time span after which groups with missing data are dropped + from the monitor state. + + The minimum value is one hour, and the maximum value is 72 hours. + + Example values are: "60m", "1h", and "2d". + + This option is only available for APM Trace Analytics, Audit Trail, CI, + Error Tracking, Event, Logs, and RUM monitors.' + type: string groupby_simple_monitor: description: Whether the log alert monitor triggers a single alert or multiple alerts when any group breaches a threshold. @@ -6221,6 +6232,8 @@ components: description: A Boolean indicating whether this monitor notifies when data stops reporting. type: boolean + on_missing_data: + $ref: '#/components/schemas/OnMissingDataOption' renotify_interval: default: null description: "The number of minutes after the last notification before a @@ -7926,6 +7939,32 @@ components: format: int64 type: integer type: object + OnMissingDataOption: + description: 'Controls how groups or monitors are treated if an evaluation does + not return any data points. + + The default option results in different behavior depending on the monitor + query type. + + For monitors using Count queries, an empty monitor evaluation is treated as + 0 and is compared to the threshold conditions. + + For monitor using any query type other than Count, for example Gauge or Rate, + the monitor shows the last known status. + + This option is only available for APM Trace Analytics, Audit Trail, CI, Error + Tracking, Event, Logs, and RUM monitors.' + enum: + - default + - show_no_data + - show_and_notify_no_data + - resolve + type: string + x-enum-varnames: + - DEFAULT + - SHOW_NO_DATA + - SHOW_AND_NOTIFY_NO_DATA + - RESOLVE OrgDowngradedResponse: description: Status of downgrade properties: diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_graph-widget_583482879/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_graph-widget_583482879/frozen.json index 05d7b12a460b..0614ecdb41c8 100644 --- a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_graph-widget_583482879/frozen.json +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_graph-widget_583482879/frozen.json @@ -1 +1 @@ -"2022-01-06T00:50:25.975Z" +"2022-08-15T18:04:35.875Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_graph-widget_583482879/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_graph-widget_583482879/recording.har index 956fb4ebd03d..2790fee07bd9 100644 --- a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_graph-widget_583482879/recording.har +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_graph-widget_583482879/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "9daa1fe9bbb92cc6c9ae1a9b8e555681", + "_id": "b0a9c66cafabf0db4cfc10c90e5ac287", "_order": 0, "cache": {}, "request": { - "bodySize": 719, + "bodySize": 763, "cookies": [], "headers": [ { @@ -26,23 +26,23 @@ "value": "application/json" } ], - "headersSize": 471, + "headersSize": 555, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Create_a_new_dashboard_with_alert_graph_widget-1641430225\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testcreateanewdashboardwithalertgraphwidget1641430225\",\"env:ci\"],\"type\":\"log alert\"}" + "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Create_a_new_dashboard_with_alert_graph_widget-1660586675\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testcreateanewdashboardwithalertgraphwidget1660586675\",\"env:ci\"],\"type\":\"log alert\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/monitor" }, "response": { - "bodySize": 1089, + "bodySize": 1133, "content": { "mimeType": "application/json", - "size": 1089, - "text": "{\"restricted_roles\":null,\"tags\":[\"test:testcreateanewdashboardwithalertgraphwidget1641430225\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":59800315,\"multi\":true,\"name\":\"Test-Create_a_new_dashboard_with_alert_graph_widget-1641430225\",\"created\":\"2022-01-06T00:50:26.247872+00:00\",\"created_at\":1641430226000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-01-06T00:50:26.247872+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2,\"warning\":1}}}" + "size": 1133, + "text": "{\"restricted_roles\":null,\"tags\":[\"test:testcreateanewdashboardwithalertgraphwidget1660586675\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":80119038,\"multi\":true,\"name\":\"Test-Create_a_new_dashboard_with_alert_graph_widget-1660586675\",\"created\":\"2022-08-15T18:04:36.610523+00:00\",\"created_at\":1660586676000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-08-15T18:04:36.610523+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"on_missing_data\":\"show_and_notify_no_data\",\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2.0,\"warning\":1.0}}}" }, "cookies": [], "headers": [ @@ -51,17 +51,17 @@ "value": "application/json" } ], - "headersSize": 515, + "headersSize": 665, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:25.979Z", - "time": 327 + "startedDateTime": "2022-08-15T18:04:35.898Z", + "time": 792 }, { - "_id": "8c06b025a7c84aa70a88624ea6a1e24f", + "_id": "4a191566f87ae16b08bd48fb4aca41be", "_order": 0, "cache": {}, "request": { @@ -79,23 +79,23 @@ "value": "application/json" } ], - "headersSize": 475, + "headersSize": 559, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"description\":\"\",\"is_read_only\":false,\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_alert_graph_widget-1641430225\",\"widgets\":[{\"definition\":{\"alert_id\":\"59800315\",\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"alert_graph\",\"viz_type\":\"timeseries\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0}}]}" + "text": "{\"description\":\"\",\"is_read_only\":false,\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_alert_graph_widget-1660586675\",\"widgets\":[{\"definition\":{\"alert_id\":\"80119038\",\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"alert_graph\",\"viz_type\":\"timeseries\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0}}]}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/dashboard" }, "response": { - "bodySize": 679, + "bodySize": 678, "content": { "mimeType": "application/json", - "size": 679, - "text": "{\"notify_list\":[],\"description\":\"\",\"restricted_roles\":[],\"author_name\":null,\"template_variables\":[],\"is_read_only\":false,\"id\":\"m8v-aud-r6a\",\"title\":\"Test-Create_a_new_dashboard_with_alert_graph_widget-1641430225\",\"url\":\"/dashboard/m8v-aud-r6a/test-createanewdashboardwithalertgraphwidget-1641430225\",\"created_at\":\"2022-01-06T00:50:26.498395+00:00\",\"modified_at\":\"2022-01-06T00:50:26.498395+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"title_size\":\"16\",\"viz_type\":\"timeseries\",\"title\":\"\",\"title_align\":\"left\",\"alert_id\":\"59800315\",\"time\":{},\"type\":\"alert_graph\"},\"layout\":{\"y\":0,\"width\":47,\"x\":0,\"height\":15},\"id\":5197028522086004}],\"layout_type\":\"free\"}" + "size": 678, + "text": "{\"notify_list\":[],\"description\":\"\",\"restricted_roles\":[],\"author_name\":null,\"template_variables\":[],\"is_read_only\":false,\"id\":\"shb-j47-ek7\",\"title\":\"Test-Create_a_new_dashboard_with_alert_graph_widget-1660586675\",\"url\":\"/dashboard/shb-j47-ek7/test-createanewdashboardwithalertgraphwidget-1660586675\",\"created_at\":\"2022-08-15T18:04:37.095538+00:00\",\"modified_at\":\"2022-08-15T18:04:37.095538+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"title_size\":\"16\",\"viz_type\":\"timeseries\",\"title\":\"\",\"title_align\":\"left\",\"alert_id\":\"80119038\",\"time\":{},\"type\":\"alert_graph\"},\"layout\":{\"y\":0,\"width\":47,\"x\":0,\"height\":15},\"id\":27855510418916}],\"layout_type\":\"free\"}\n" }, "cookies": [], "headers": [ @@ -104,17 +104,17 @@ "value": "application/json" } ], - "headersSize": 383, + "headersSize": 593, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:26.313Z", - "time": 226 + "startedDateTime": "2022-08-15T18:04:36.727Z", + "time": 462 }, { - "_id": "137dc0c22b927d20fa4b2c3fc5485cfe", + "_id": "81408bf1646661a7c0718571684a1c33", "_order": 0, "cache": {}, "request": { @@ -127,18 +127,18 @@ "value": "application/json" } ], - "headersSize": 436, + "headersSize": 520, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/dashboard/m8v-aud-r6a" + "url": "https://api.datadoghq.com/api/v1/dashboard/shb-j47-ek7" }, "response": { - "bodySize": 38, + "bodySize": 39, "content": { "mimeType": "application/json", - "size": 38, - "text": "{\"deleted_dashboard_id\":\"m8v-aud-r6a\"}" + "size": 39, + "text": "{\"deleted_dashboard_id\":\"shb-j47-ek7\"}\n" }, "cookies": [], "headers": [ @@ -147,17 +147,17 @@ "value": "application/json" } ], - "headersSize": 382, + "headersSize": 592, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:26.543Z", - "time": 220 + "startedDateTime": "2022-08-15T18:04:37.202Z", + "time": 484 }, { - "_id": "2e8022d592ce6876a92c758a74636eb5", + "_id": "9c155f49b83ed26540e7c3f232710712", "_order": 0, "cache": {}, "request": { @@ -170,18 +170,18 @@ "value": "application/json" } ], - "headersSize": 429, + "headersSize": 513, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/monitor/59800315" + "url": "https://api.datadoghq.com/api/v1/monitor/80119038" }, "response": { "bodySize": 31, "content": { "mimeType": "application/json", "size": 31, - "text": "{\"deleted_monitor_id\":59800315}" + "text": "{\"deleted_monitor_id\":80119038}" }, "cookies": [], "headers": [ @@ -190,14 +190,14 @@ "value": "application/json" } ], - "headersSize": 382, + "headersSize": 635, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:26.766Z", - "time": 234 + "startedDateTime": "2022-08-15T18:04:37.692Z", + "time": 376 } ], "pages": [], diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_value-widget_1414423104/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_value-widget_1414423104/frozen.json index 11b217957030..f2b3835f645b 100644 --- a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_value-widget_1414423104/frozen.json +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_value-widget_1414423104/frozen.json @@ -1 +1 @@ -"2022-01-06T00:50:27.007Z" +"2022-08-15T18:04:38.079Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_value-widget_1414423104/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_value-widget_1414423104/recording.har index 4d68c72280c0..2164586e50c3 100644 --- a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_value-widget_1414423104/recording.har +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-alert_value-widget_1414423104/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "2bcf32387b1371c1a1a5a74b12fa6776", + "_id": "53f6590dca9faf1772922e226a6f424b", "_order": 0, "cache": {}, "request": { - "bodySize": 719, + "bodySize": 763, "cookies": [], "headers": [ { @@ -26,23 +26,23 @@ "value": "application/json" } ], - "headersSize": 471, + "headersSize": 554, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Create_a_new_dashboard_with_alert_value_widget-1641430227\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testcreateanewdashboardwithalertvaluewidget1641430227\",\"env:ci\"],\"type\":\"log alert\"}" + "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Create_a_new_dashboard_with_alert_value_widget-1660586678\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testcreateanewdashboardwithalertvaluewidget1660586678\",\"env:ci\"],\"type\":\"log alert\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/monitor" }, "response": { - "bodySize": 1089, + "bodySize": 1133, "content": { "mimeType": "application/json", - "size": 1089, - "text": "{\"restricted_roles\":null,\"tags\":[\"test:testcreateanewdashboardwithalertvaluewidget1641430227\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":59800326,\"multi\":true,\"name\":\"Test-Create_a_new_dashboard_with_alert_value_widget-1641430227\",\"created\":\"2022-01-06T00:50:27.295599+00:00\",\"created_at\":1641430227000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-01-06T00:50:27.295599+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2,\"warning\":1}}}" + "size": 1133, + "text": "{\"restricted_roles\":null,\"tags\":[\"test:testcreateanewdashboardwithalertvaluewidget1660586678\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":80119041,\"multi\":true,\"name\":\"Test-Create_a_new_dashboard_with_alert_value_widget-1660586678\",\"created\":\"2022-08-15T18:04:38.421687+00:00\",\"created_at\":1660586678000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-08-15T18:04:38.421687+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"on_missing_data\":\"show_and_notify_no_data\",\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2.0,\"warning\":1.0}}}" }, "cookies": [], "headers": [ @@ -51,17 +51,17 @@ "value": "application/json" } ], - "headersSize": 515, + "headersSize": 665, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:27.011Z", - "time": 346 + "startedDateTime": "2022-08-15T18:04:38.088Z", + "time": 474 }, { - "_id": "aa521148bd6a403d69464774eb47dcfd", + "_id": "2bd13571b27d506a570ba8077a8ae673", "_order": 0, "cache": {}, "request": { @@ -79,23 +79,23 @@ "value": "application/json" } ], - "headersSize": 474, + "headersSize": 559, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"description\":\"\",\"is_read_only\":false,\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_alert_value_widget-1641430227\",\"widgets\":[{\"definition\":{\"alert_id\":\"59800326\",\"precision\":2,\"text_align\":\"left\",\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"alert_value\",\"unit\":\"auto\"},\"layout\":{\"height\":8,\"width\":15,\"x\":0,\"y\":0}}]}" + "text": "{\"description\":\"\",\"is_read_only\":false,\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_alert_value_widget-1660586678\",\"widgets\":[{\"definition\":{\"alert_id\":\"80119041\",\"precision\":2,\"text_align\":\"left\",\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"alert_value\",\"unit\":\"auto\"},\"layout\":{\"height\":8,\"width\":15,\"x\":0,\"y\":0}}]}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/dashboard" }, "response": { - "bodySize": 692, + "bodySize": 693, "content": { "mimeType": "application/json", - "size": 692, - "text": "{\"notify_list\":[],\"description\":\"\",\"restricted_roles\":[],\"author_name\":null,\"template_variables\":[],\"is_read_only\":false,\"id\":\"mku-sdw-4ht\",\"title\":\"Test-Create_a_new_dashboard_with_alert_value_widget-1641430227\",\"url\":\"/dashboard/mku-sdw-4ht/test-createanewdashboardwithalertvaluewidget-1641430227\",\"created_at\":\"2022-01-06T00:50:27.525448+00:00\",\"modified_at\":\"2022-01-06T00:50:27.525448+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"title_size\":\"16\",\"title\":\"\",\"title_align\":\"left\",\"text_align\":\"left\",\"precision\":2,\"alert_id\":\"59800326\",\"type\":\"alert_value\",\"unit\":\"auto\"},\"layout\":{\"y\":0,\"width\":15,\"x\":0,\"height\":8},\"id\":8104886022276071}],\"layout_type\":\"free\"}" + "size": 693, + "text": "{\"notify_list\":[],\"description\":\"\",\"restricted_roles\":[],\"author_name\":null,\"template_variables\":[],\"is_read_only\":false,\"id\":\"p6f-bg6-nct\",\"title\":\"Test-Create_a_new_dashboard_with_alert_value_widget-1660586678\",\"url\":\"/dashboard/p6f-bg6-nct/test-createanewdashboardwithalertvaluewidget-1660586678\",\"created_at\":\"2022-08-15T18:04:38.876542+00:00\",\"modified_at\":\"2022-08-15T18:04:38.876542+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"title_size\":\"16\",\"title\":\"\",\"title_align\":\"left\",\"text_align\":\"left\",\"precision\":2,\"alert_id\":\"80119041\",\"type\":\"alert_value\",\"unit\":\"auto\"},\"layout\":{\"y\":0,\"width\":15,\"x\":0,\"height\":8},\"id\":6590887257395158}],\"layout_type\":\"free\"}\n" }, "cookies": [], "headers": [ @@ -104,17 +104,17 @@ "value": "application/json" } ], - "headersSize": 383, + "headersSize": 593, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:27.362Z", - "time": 216 + "startedDateTime": "2022-08-15T18:04:38.574Z", + "time": 386 }, { - "_id": "b3b0f519d777bd57b4302eebcbb57d92", + "_id": "9528cd8f33369c7cef262e6fd4655e79", "_order": 0, "cache": {}, "request": { @@ -127,18 +127,18 @@ "value": "application/json" } ], - "headersSize": 436, + "headersSize": 519, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/dashboard/mku-sdw-4ht" + "url": "https://api.datadoghq.com/api/v1/dashboard/p6f-bg6-nct" }, "response": { - "bodySize": 38, + "bodySize": 39, "content": { "mimeType": "application/json", - "size": 38, - "text": "{\"deleted_dashboard_id\":\"mku-sdw-4ht\"}" + "size": 39, + "text": "{\"deleted_dashboard_id\":\"p6f-bg6-nct\"}\n" }, "cookies": [], "headers": [ @@ -147,17 +147,17 @@ "value": "application/json" } ], - "headersSize": 382, + "headersSize": 592, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:27.582Z", - "time": 277 + "startedDateTime": "2022-08-15T18:04:38.967Z", + "time": 371 }, { - "_id": "06088a94914fd95c719a13af52b13813", + "_id": "5200c6263ba432c6b1d910ff80257bef", "_order": 0, "cache": {}, "request": { @@ -170,18 +170,18 @@ "value": "application/json" } ], - "headersSize": 429, + "headersSize": 513, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/monitor/59800326" + "url": "https://api.datadoghq.com/api/v1/monitor/80119041" }, "response": { "bodySize": 31, "content": { "mimeType": "application/json", "size": 31, - "text": "{\"deleted_monitor_id\":59800326}" + "text": "{\"deleted_monitor_id\":80119041}" }, "cookies": [], "headers": [ @@ -190,14 +190,14 @@ "value": "application/json" } ], - "headersSize": 382, + "headersSize": 635, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:27.861Z", - "time": 259 + "startedDateTime": "2022-08-15T18:04:39.343Z", + "time": 358 } ], "pages": [], diff --git a/cassettes/v1/Downtimes_1733580485/Schedule-a-monitor-downtime-returns-OK-response_2204609008/frozen.json b/cassettes/v1/Downtimes_1733580485/Schedule-a-monitor-downtime-returns-OK-response_2204609008/frozen.json index 8efcdf6ebb89..a19bd6a9fbe2 100644 --- a/cassettes/v1/Downtimes_1733580485/Schedule-a-monitor-downtime-returns-OK-response_2204609008/frozen.json +++ b/cassettes/v1/Downtimes_1733580485/Schedule-a-monitor-downtime-returns-OK-response_2204609008/frozen.json @@ -1 +1 @@ -"2022-05-12T09:50:01.751Z" +"2022-08-15T18:04:39.736Z" diff --git a/cassettes/v1/Downtimes_1733580485/Schedule-a-monitor-downtime-returns-OK-response_2204609008/recording.har b/cassettes/v1/Downtimes_1733580485/Schedule-a-monitor-downtime-returns-OK-response_2204609008/recording.har index c6cca16f9bc7..142f41d9c812 100644 --- a/cassettes/v1/Downtimes_1733580485/Schedule-a-monitor-downtime-returns-OK-response_2204609008/recording.har +++ b/cassettes/v1/Downtimes_1733580485/Schedule-a-monitor-downtime-returns-OK-response_2204609008/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "ea2932cffb1840190e4f5e8851566922", + "_id": "71c52e89126a931c6e803e616930512c", "_order": 0, "cache": {}, "request": { - "bodySize": 722, + "bodySize": 766, "cookies": [], "headers": [ { @@ -32,17 +32,17 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Schedule_a_monitor_downtime_returns_OK_response-1652349001\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testscheduleamonitordowntimereturnsokresponse1652349001\",\"env:ci\"],\"type\":\"log alert\"}" + "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Schedule_a_monitor_downtime_returns_OK_response-1660586679\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testscheduleamonitordowntimereturnsokresponse1660586679\",\"env:ci\"],\"type\":\"log alert\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/monitor" }, "response": { - "bodySize": 1092, + "bodySize": 1136, "content": { "mimeType": "application/json", - "size": 1092, - "text": "{\"restricted_roles\":null,\"tags\":[\"test:testscheduleamonitordowntimereturnsokresponse1652349001\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":71310133,\"multi\":true,\"name\":\"Test-Schedule_a_monitor_downtime_returns_OK_response-1652349001\",\"created\":\"2022-05-12T09:50:02.253161+00:00\",\"created_at\":1652349002000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-05-12T09:50:02.253161+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2.0,\"warning\":1.0}}}" + "size": 1136, + "text": "{\"restricted_roles\":null,\"tags\":[\"test:testscheduleamonitordowntimereturnsokresponse1660586679\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":80119043,\"multi\":true,\"name\":\"Test-Schedule_a_monitor_downtime_returns_OK_response-1660586679\",\"created\":\"2022-08-15T18:04:40.058772+00:00\",\"created_at\":1660586680000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-08-15T18:04:40.058772+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"on_missing_data\":\"show_and_notify_no_data\",\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2.0,\"warning\":1.0}}}" }, "cookies": [], "headers": [ @@ -51,17 +51,17 @@ "value": "application/json" } ], - "headersSize": 665, + "headersSize": 666, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-12T09:50:01.754Z", - "time": 604 + "startedDateTime": "2022-08-15T18:04:39.741Z", + "time": 403 }, { - "_id": "b0f76ed10793c97fd0f6639d6ea9cb2e", + "_id": "1b859970ed83ecd4b17a2b6c5d61f213", "_order": 0, "cache": {}, "request": { @@ -85,7 +85,7 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"message\":\"Test-Schedule_a_monitor_downtime_returns_OK_response-1652349001\",\"monitor_id\":71310133,\"scope\":[\"test:testscheduleamonitordowntimereturnsokresponse1652349001\"],\"start\":1652349001,\"timezone\":\"Etc/UTC\"}" + "text": "{\"message\":\"Test-Schedule_a_monitor_downtime_returns_OK_response-1660586679\",\"monitor_id\":80119043,\"scope\":[\"test:testscheduleamonitordowntimereturnsokresponse1660586679\"],\"start\":1660586679,\"timezone\":\"Etc/UTC\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/downtime" @@ -95,7 +95,7 @@ "content": { "mimeType": "application/json", "size": 515, - "text": "{\"recurrence\":null,\"end\":null,\"monitor_tags\":[\"*\"],\"child_id\":null,\"canceled\":null,\"monitor_id\":71310133,\"mute_first_recovery_notification\":false,\"created\":1652349002,\"org_id\":321813,\"modified\":1652349002,\"disabled\":false,\"start\":1652349001,\"creator_id\":1445416,\"parent_id\":null,\"timezone\":\"Etc/UTC\",\"active\":true,\"scope\":[\"test:testscheduleamonitordowntimereturnsokresponse1652349001\"],\"message\":\"Test-Schedule_a_monitor_downtime_returns_OK_response-1652349001\",\"downtime_type\":2,\"id\":1944162322,\"updater_id\":null}" + "text": "{\"recurrence\":null,\"end\":null,\"monitor_tags\":[\"*\"],\"child_id\":null,\"canceled\":null,\"monitor_id\":80119043,\"mute_first_recovery_notification\":false,\"created\":1660586680,\"org_id\":321813,\"modified\":1660586680,\"disabled\":false,\"start\":1660586679,\"creator_id\":1445416,\"parent_id\":null,\"timezone\":\"Etc/UTC\",\"active\":true,\"scope\":[\"test:testscheduleamonitordowntimereturnsokresponse1660586679\"],\"message\":\"Test-Schedule_a_monitor_downtime_returns_OK_response-1660586679\",\"downtime_type\":2,\"id\":2164108453,\"updater_id\":null}" }, "cookies": [], "headers": [ @@ -110,11 +110,11 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-12T09:50:02.364Z", - "time": 523 + "startedDateTime": "2022-08-15T18:04:40.151Z", + "time": 376 }, { - "_id": "495dce5bd7533c29ec60f74b3710aff8", + "_id": "052aced9dc2f233f053ae1cdcac623e4", "_order": 0, "cache": {}, "request": { @@ -131,7 +131,7 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/downtime/1944162322" + "url": "https://api.datadoghq.com/api/v1/downtime/2164108453" }, "response": { "bodySize": 0, @@ -147,11 +147,11 @@ "status": 204, "statusText": "No Content" }, - "startedDateTime": "2022-05-12T09:50:02.892Z", - "time": 479 + "startedDateTime": "2022-08-15T18:04:40.539Z", + "time": 428 }, { - "_id": "e3f3d003158f73add591c27a17af3fb8", + "_id": "56680ef6df30cdc7b4092fece1eb6b1c", "_order": 0, "cache": {}, "request": { @@ -168,14 +168,14 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/monitor/71310133" + "url": "https://api.datadoghq.com/api/v1/monitor/80119043" }, "response": { "bodySize": 31, "content": { "mimeType": "application/json", "size": 31, - "text": "{\"deleted_monitor_id\":71310133}" + "text": "{\"deleted_monitor_id\":80119043}" }, "cookies": [], "headers": [ @@ -190,8 +190,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-12T09:50:03.375Z", - "time": 541 + "startedDateTime": "2022-08-15T18:04:40.970Z", + "time": 453 } ], "pages": [], diff --git a/cassettes/v1/Monitors_4022238206/Check-if-a-monitor-can-be-deleted-returns-OK-response_1378900457/frozen.json b/cassettes/v1/Monitors_4022238206/Check-if-a-monitor-can-be-deleted-returns-OK-response_1378900457/frozen.json index a2461a6deb0b..e15bd7ff00e5 100644 --- a/cassettes/v1/Monitors_4022238206/Check-if-a-monitor-can-be-deleted-returns-OK-response_1378900457/frozen.json +++ b/cassettes/v1/Monitors_4022238206/Check-if-a-monitor-can-be-deleted-returns-OK-response_1378900457/frozen.json @@ -1 +1 @@ -"2022-01-06T00:50:53.019Z" +"2022-08-15T18:04:41.604Z" diff --git a/cassettes/v1/Monitors_4022238206/Check-if-a-monitor-can-be-deleted-returns-OK-response_1378900457/recording.har b/cassettes/v1/Monitors_4022238206/Check-if-a-monitor-can-be-deleted-returns-OK-response_1378900457/recording.har index e9a438cb7575..3e5936b3e445 100644 --- a/cassettes/v1/Monitors_4022238206/Check-if-a-monitor-can-be-deleted-returns-OK-response_1378900457/recording.har +++ b/cassettes/v1/Monitors_4022238206/Check-if-a-monitor-can-be-deleted-returns-OK-response_1378900457/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "c62afe43e0c0efc093157de7c6464021", + "_id": "d89dee70e7d3e0a6021a12b53742741e", "_order": 0, "cache": {}, "request": { - "bodySize": 731, + "bodySize": 775, "cookies": [], "headers": [ { @@ -26,23 +26,23 @@ "value": "application/json" } ], - "headersSize": 471, + "headersSize": 555, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Check_if_a_monitor_can_be_deleted_returns_OK_response-1641430253\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testcheckifamonitorcanbedeletedreturnsokresponse1641430253\",\"env:ci\"],\"type\":\"log alert\"}" + "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Check_if_a_monitor_can_be_deleted_returns_OK_response-1660586681\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testcheckifamonitorcanbedeletedreturnsokresponse1660586681\",\"env:ci\"],\"type\":\"log alert\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/monitor" }, "response": { - "bodySize": 1101, + "bodySize": 1145, "content": { "mimeType": "application/json", - "size": 1101, - "text": "{\"restricted_roles\":null,\"tags\":[\"test:testcheckifamonitorcanbedeletedreturnsokresponse1641430253\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":59800600,\"multi\":true,\"name\":\"Test-Check_if_a_monitor_can_be_deleted_returns_OK_response-1641430253\",\"created\":\"2022-01-06T00:50:53.280971+00:00\",\"created_at\":1641430253000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-01-06T00:50:53.280971+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2,\"warning\":1}}}" + "size": 1145, + "text": "{\"restricted_roles\":null,\"tags\":[\"test:testcheckifamonitorcanbedeletedreturnsokresponse1660586681\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":80119046,\"multi\":true,\"name\":\"Test-Check_if_a_monitor_can_be_deleted_returns_OK_response-1660586681\",\"created\":\"2022-08-15T18:04:41.951170+00:00\",\"created_at\":1660586681000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-08-15T18:04:41.951170+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"on_missing_data\":\"show_and_notify_no_data\",\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2.0,\"warning\":1.0}}}" }, "cookies": [], "headers": [ @@ -51,17 +51,17 @@ "value": "application/json" } ], - "headersSize": 515, + "headersSize": 665, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:53.023Z", - "time": 301 + "startedDateTime": "2022-08-15T18:04:41.608Z", + "time": 431 }, { - "_id": "fe344255bf6b8def0a23b6ae74c24586", + "_id": "7e410f7ca3208819f64dc5a45299f06f", "_order": 0, "cache": {}, "request": { @@ -74,23 +74,23 @@ "value": "application/json" } ], - "headersSize": 456, + "headersSize": 541, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ { "name": "monitor_ids", - "value": "59800600" + "value": "80119046" } ], - "url": "https://api.datadoghq.com/api/v1/monitor/can_delete?monitor_ids=59800600" + "url": "https://api.datadoghq.com/api/v1/monitor/can_delete?monitor_ids=80119046" }, "response": { "bodySize": 40, "content": { "mimeType": "application/json", "size": 40, - "text": "{\"errors\":null,\"data\":{\"ok\":[59800600]}}" + "text": "{\"errors\":null,\"data\":{\"ok\":[80119046]}}" }, "cookies": [], "headers": [ @@ -99,17 +99,17 @@ "value": "application/json" } ], - "headersSize": 514, + "headersSize": 665, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:53.327Z", - "time": 227 + "startedDateTime": "2022-08-15T18:04:42.048Z", + "time": 453 }, { - "_id": "3a6a13358700460e93d9c7aee92aa65c", + "_id": "87e1c1ce8143abbc36f2352e3eef152c", "_order": 0, "cache": {}, "request": { @@ -122,18 +122,18 @@ "value": "application/json" } ], - "headersSize": 429, + "headersSize": 513, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/monitor/59800600" + "url": "https://api.datadoghq.com/api/v1/monitor/80119046" }, "response": { "bodySize": 31, "content": { "mimeType": "application/json", "size": 31, - "text": "{\"deleted_monitor_id\":59800600}" + "text": "{\"deleted_monitor_id\":80119046}" }, "cookies": [], "headers": [ @@ -142,14 +142,14 @@ "value": "application/json" } ], - "headersSize": 382, + "headersSize": 635, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:53.557Z", - "time": 286 + "startedDateTime": "2022-08-15T18:04:42.526Z", + "time": 354 } ], "pages": [], diff --git a/cassettes/v1/Monitors_4022238206/Delete-a-monitor-returns-OK-response_4170020273/frozen.json b/cassettes/v1/Monitors_4022238206/Delete-a-monitor-returns-OK-response_4170020273/frozen.json index 17d19ff362ce..03669b84649b 100644 --- a/cassettes/v1/Monitors_4022238206/Delete-a-monitor-returns-OK-response_4170020273/frozen.json +++ b/cassettes/v1/Monitors_4022238206/Delete-a-monitor-returns-OK-response_4170020273/frozen.json @@ -1 +1 @@ -"2022-01-06T00:50:56.007Z" +"2022-08-15T18:04:42.888Z" diff --git a/cassettes/v1/Monitors_4022238206/Delete-a-monitor-returns-OK-response_4170020273/recording.har b/cassettes/v1/Monitors_4022238206/Delete-a-monitor-returns-OK-response_4170020273/recording.har index b605d663264c..e6842a69ab63 100644 --- a/cassettes/v1/Monitors_4022238206/Delete-a-monitor-returns-OK-response_4170020273/recording.har +++ b/cassettes/v1/Monitors_4022238206/Delete-a-monitor-returns-OK-response_4170020273/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "2e9454b17359d825e98d252cf0903230", + "_id": "4638c4cc0bab4ba21e9a2a424793bf48", "_order": 0, "cache": {}, "request": { - "bodySize": 701, + "bodySize": 745, "cookies": [], "headers": [ { @@ -26,23 +26,23 @@ "value": "application/json" } ], - "headersSize": 470, + "headersSize": 555, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Delete_a_monitor_returns_OK_response-1641430256\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testdeleteamonitorreturnsokresponse1641430256\",\"env:ci\"],\"type\":\"log alert\"}" + "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Delete_a_monitor_returns_OK_response-1660586682\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testdeleteamonitorreturnsokresponse1660586682\",\"env:ci\"],\"type\":\"log alert\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/monitor" }, "response": { - "bodySize": 1071, + "bodySize": 1115, "content": { "mimeType": "application/json", - "size": 1071, - "text": "{\"restricted_roles\":null,\"tags\":[\"test:testdeleteamonitorreturnsokresponse1641430256\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":59800638,\"multi\":true,\"name\":\"Test-Delete_a_monitor_returns_OK_response-1641430256\",\"created\":\"2022-01-06T00:50:56.247027+00:00\",\"created_at\":1641430256000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-01-06T00:50:56.247027+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2,\"warning\":1}}}" + "size": 1115, + "text": "{\"restricted_roles\":null,\"tags\":[\"test:testdeleteamonitorreturnsokresponse1660586682\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":80119048,\"multi\":true,\"name\":\"Test-Delete_a_monitor_returns_OK_response-1660586682\",\"created\":\"2022-08-15T18:04:43.197889+00:00\",\"created_at\":1660586683000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-08-15T18:04:43.197889+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"on_missing_data\":\"show_and_notify_no_data\",\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2.0,\"warning\":1.0}}}" }, "cookies": [], "headers": [ @@ -51,17 +51,17 @@ "value": "application/json" } ], - "headersSize": 515, + "headersSize": 665, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:56.010Z", - "time": 282 + "startedDateTime": "2022-08-15T18:04:42.891Z", + "time": 377 }, { - "_id": "12eeb040c4a75e0784b6fdf2622e3c69", + "_id": "8470ec01da8f2a2b4ab46ee87a177b43", "_order": 0, "cache": {}, "request": { @@ -74,18 +74,18 @@ "value": "application/json" } ], - "headersSize": 427, + "headersSize": 513, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/monitor/59800638" + "url": "https://api.datadoghq.com/api/v1/monitor/80119048" }, "response": { "bodySize": 31, "content": { "mimeType": "application/json", "size": 31, - "text": "{\"deleted_monitor_id\":59800638}" + "text": "{\"deleted_monitor_id\":80119048}" }, "cookies": [], "headers": [ @@ -94,17 +94,17 @@ "value": "application/json" } ], - "headersSize": 382, + "headersSize": 635, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:56.295Z", - "time": 239 + "startedDateTime": "2022-08-15T18:04:43.275Z", + "time": 363 }, { - "_id": "12eeb040c4a75e0784b6fdf2622e3c69", + "_id": "8470ec01da8f2a2b4ab46ee87a177b43", "_order": 1, "cache": {}, "request": { @@ -117,18 +117,18 @@ "value": "application/json" } ], - "headersSize": 426, + "headersSize": 513, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/monitor/59800638" + "url": "https://api.datadoghq.com/api/v1/monitor/80119048" }, "response": { "bodySize": 33, "content": { "mimeType": "application/json", "size": 33, - "text": "{\"errors\":[\"Monitor not found\"]}" + "text": "{\"errors\": [\"Monitor not found\"]}" }, "cookies": [], "headers": [ @@ -137,14 +137,14 @@ "value": "application/json" } ], - "headersSize": 382, + "headersSize": 635, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 404, "statusText": "Not Found" }, - "startedDateTime": "2022-01-06T00:50:56.536Z", - "time": 168 + "startedDateTime": "2022-08-15T18:04:43.643Z", + "time": 317 } ], "pages": [], diff --git a/cassettes/v1/Monitors_4022238206/Edit-a-monitor-returns-OK-response_829971522/frozen.json b/cassettes/v1/Monitors_4022238206/Edit-a-monitor-returns-OK-response_829971522/frozen.json index 8d61ad43b008..c38c78e1dda9 100644 --- a/cassettes/v1/Monitors_4022238206/Edit-a-monitor-returns-OK-response_829971522/frozen.json +++ b/cassettes/v1/Monitors_4022238206/Edit-a-monitor-returns-OK-response_829971522/frozen.json @@ -1 +1 @@ -"2022-01-06T00:50:56.906Z" +"2022-08-15T18:04:43.969Z" diff --git a/cassettes/v1/Monitors_4022238206/Edit-a-monitor-returns-OK-response_829971522/recording.har b/cassettes/v1/Monitors_4022238206/Edit-a-monitor-returns-OK-response_829971522/recording.har index b9948ab458b5..fbe8bf24a316 100644 --- a/cassettes/v1/Monitors_4022238206/Edit-a-monitor-returns-OK-response_829971522/recording.har +++ b/cassettes/v1/Monitors_4022238206/Edit-a-monitor-returns-OK-response_829971522/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "8811833a79d613497d5d21ad4b01114d", + "_id": "c34b8e9b53d1f1485862dc98a16e980b", "_order": 0, "cache": {}, "request": { - "bodySize": 697, + "bodySize": 741, "cookies": [], "headers": [ { @@ -26,23 +26,23 @@ "value": "application/json" } ], - "headersSize": 471, + "headersSize": 555, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Edit_a_monitor_returns_OK_response-1641430256\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testeditamonitorreturnsokresponse1641430256\",\"env:ci\"],\"type\":\"log alert\"}" + "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Edit_a_monitor_returns_OK_response-1660586683\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testeditamonitorreturnsokresponse1660586683\",\"env:ci\"],\"type\":\"log alert\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/monitor" }, "response": { - "bodySize": 1067, + "bodySize": 1111, "content": { "mimeType": "application/json", - "size": 1067, - "text": "{\"restricted_roles\":null,\"tags\":[\"test:testeditamonitorreturnsokresponse1641430256\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":59800649,\"multi\":true,\"name\":\"Test-Edit_a_monitor_returns_OK_response-1641430256\",\"created\":\"2022-01-06T00:50:57.134096+00:00\",\"created_at\":1641430257000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-01-06T00:50:57.134096+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2,\"warning\":1}}}" + "size": 1111, + "text": "{\"restricted_roles\":null,\"tags\":[\"test:testeditamonitorreturnsokresponse1660586683\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":80119050,\"multi\":true,\"name\":\"Test-Edit_a_monitor_returns_OK_response-1660586683\",\"created\":\"2022-08-15T18:04:44.283818+00:00\",\"created_at\":1660586684000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-08-15T18:04:44.283818+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"on_missing_data\":\"show_and_notify_no_data\",\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2.0,\"warning\":1.0}}}" }, "cookies": [], "headers": [ @@ -51,17 +51,17 @@ "value": "application/json" } ], - "headersSize": 515, + "headersSize": 665, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:56.909Z", - "time": 273 + "startedDateTime": "2022-08-15T18:04:43.972Z", + "time": 385 }, { - "_id": "aa46a6b5d3a70437d33b9281973f43dd", + "_id": "fdee93038f8f1c4cd7bdcb68b846deb2", "_order": 0, "cache": {}, "request": { @@ -79,23 +79,23 @@ "value": "application/json" } ], - "headersSize": 479, + "headersSize": 562, "httpVersion": "HTTP/1.1", "method": "PUT", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"name\":\"Test-Edit_a_monitor_returns_OK_response-1641430256-updated\",\"options\":{\"evaluation_delay\":null,\"new_group_delay\":600,\"new_host_delay\":null,\"renotify_interval\":null,\"thresholds\":{\"critical\":2,\"warning\":null},\"timeout_h\":null}}" + "text": "{\"name\":\"Test-Edit_a_monitor_returns_OK_response-1660586683-updated\",\"options\":{\"evaluation_delay\":null,\"new_group_delay\":600,\"new_host_delay\":null,\"renotify_interval\":null,\"thresholds\":{\"critical\":2,\"warning\":null},\"timeout_h\":null}}" }, "queryString": [], - "url": "https://api.datadoghq.com/api/v1/monitor/59800649" + "url": "https://api.datadoghq.com/api/v1/monitor/80119050" }, "response": { - "bodySize": 865, + "bodySize": 850, "content": { "mimeType": "application/json", - "size": 865, - "text": "{\"restricted_roles\":null,\"tags\":[\"test:testeditamonitorreturnsokresponse1641430256\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":59800649,\"multi\":true,\"name\":\"Test-Edit_a_monitor_returns_OK_response-1641430256-updated\",\"created\":\"2022-01-06T00:50:57.134096+00:00\",\"created_at\":1641430257000,\"org_id\":321813,\"modified\":\"2022-01-06T00:50:57.428390+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":null,\"silenced\":{},\"include_tags\":true,\"thresholds\":{\"critical\":2},\"new_host_delay\":null,\"notify_no_data\":false,\"renotify_interval\":null,\"groupby_simple_monitor\":false,\"new_group_delay\":600,\"evaluation_delay\":null}}" + "size": 850, + "text": "{\"restricted_roles\":null,\"tags\":[\"test:testeditamonitorreturnsokresponse1660586683\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":80119050,\"multi\":true,\"name\":\"Test-Edit_a_monitor_returns_OK_response-1660586683-updated\",\"created\":\"2022-08-15T18:04:44.283818+00:00\",\"created_at\":1660586684000,\"org_id\":321813,\"modified\":\"2022-08-15T18:04:44.692685+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"timeout_h\":null,\"silenced\":{},\"include_tags\":true,\"thresholds\":{\"critical\":2.0},\"new_host_delay\":null,\"notify_no_data\":false,\"renotify_interval\":null,\"groupby_simple_monitor\":false,\"new_group_delay\":600,\"evaluation_delay\":null}}" }, "cookies": [], "headers": [ @@ -104,17 +104,17 @@ "value": "application/json" } ], - "headersSize": 513, + "headersSize": 663, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:57.185Z", - "time": 294 + "startedDateTime": "2022-08-15T18:04:44.364Z", + "time": 425 }, { - "_id": "1711b14aec98f10ec6ff68893aa47923", + "_id": "0f239d3bcef6e29485964f185f20b570", "_order": 0, "cache": {}, "request": { @@ -127,18 +127,18 @@ "value": "application/json" } ], - "headersSize": 429, + "headersSize": 513, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/monitor/59800649" + "url": "https://api.datadoghq.com/api/v1/monitor/80119050" }, "response": { "bodySize": 31, "content": { "mimeType": "application/json", "size": 31, - "text": "{\"deleted_monitor_id\":59800649}" + "text": "{\"deleted_monitor_id\":80119050}" }, "cookies": [], "headers": [ @@ -147,14 +147,14 @@ "value": "application/json" } ], - "headersSize": 382, + "headersSize": 635, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:57.483Z", - "time": 252 + "startedDateTime": "2022-08-15T18:04:44.795Z", + "time": 368 } ], "pages": [], diff --git a/cassettes/v1/Monitors_4022238206/Get-a-monitor-s-details-returns-OK-response_3416600972/frozen.json b/cassettes/v1/Monitors_4022238206/Get-a-monitor-s-details-returns-OK-response_3416600972/frozen.json index be1d0a0be055..09186bf106d9 100644 --- a/cassettes/v1/Monitors_4022238206/Get-a-monitor-s-details-returns-OK-response_3416600972/frozen.json +++ b/cassettes/v1/Monitors_4022238206/Get-a-monitor-s-details-returns-OK-response_3416600972/frozen.json @@ -1 +1 @@ -"2022-01-06T00:50:57.942Z" +"2022-08-15T18:04:45.174Z" diff --git a/cassettes/v1/Monitors_4022238206/Get-a-monitor-s-details-returns-OK-response_3416600972/recording.har b/cassettes/v1/Monitors_4022238206/Get-a-monitor-s-details-returns-OK-response_3416600972/recording.har index c5c58b75fc47..bb4109923fa8 100644 --- a/cassettes/v1/Monitors_4022238206/Get-a-monitor-s-details-returns-OK-response_3416600972/recording.har +++ b/cassettes/v1/Monitors_4022238206/Get-a-monitor-s-details-returns-OK-response_3416600972/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "9824f9d27532edf52d53f7392ae7e781", + "_id": "a73b836467894c5e1cc631b56d24eafc", "_order": 0, "cache": {}, "request": { - "bodySize": 713, + "bodySize": 757, "cookies": [], "headers": [ { @@ -26,23 +26,23 @@ "value": "application/json" } ], - "headersSize": 471, + "headersSize": 555, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Get_a_monitor_s_details_returns_OK_response-1641430257\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testgetamonitorsdetailsreturnsokresponse1641430257\",\"env:ci\"],\"type\":\"log alert\"}" + "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Get_a_monitor_s_details_returns_OK_response-1660586685\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testgetamonitorsdetailsreturnsokresponse1660586685\",\"env:ci\"],\"type\":\"log alert\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/monitor" }, "response": { - "bodySize": 1083, + "bodySize": 1127, "content": { "mimeType": "application/json", - "size": 1083, - "text": "{\"restricted_roles\":null,\"tags\":[\"test:testgetamonitorsdetailsreturnsokresponse1641430257\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":59800662,\"multi\":true,\"name\":\"Test-Get_a_monitor_s_details_returns_OK_response-1641430257\",\"created\":\"2022-01-06T00:50:58.216052+00:00\",\"created_at\":1641430258000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-01-06T00:50:58.216052+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2,\"warning\":1}}}" + "size": 1127, + "text": "{\"restricted_roles\":null,\"tags\":[\"test:testgetamonitorsdetailsreturnsokresponse1660586685\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":80119052,\"multi\":true,\"name\":\"Test-Get_a_monitor_s_details_returns_OK_response-1660586685\",\"created\":\"2022-08-15T18:04:45.520307+00:00\",\"created_at\":1660586685000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-08-15T18:04:45.520307+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"on_missing_data\":\"show_and_notify_no_data\",\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2.0,\"warning\":1.0}}}" }, "cookies": [], "headers": [ @@ -51,17 +51,17 @@ "value": "application/json" } ], - "headersSize": 515, + "headersSize": 665, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:57.945Z", - "time": 329 + "startedDateTime": "2022-08-15T18:04:45.177Z", + "time": 416 }, { - "_id": "ed586f0272de866af7984318ac9ec07b", + "_id": "566782f87e4fcd39019b59725e605edd", "_order": 0, "cache": {}, "request": { @@ -74,18 +74,18 @@ "value": "application/json" } ], - "headersSize": 422, + "headersSize": 507, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/monitor/59800662" + "url": "https://api.datadoghq.com/api/v1/monitor/80119052" }, "response": { - "bodySize": 1083, + "bodySize": 1127, "content": { "mimeType": "application/json", - "size": 1083, - "text": "{\"restricted_roles\":null,\"tags\":[\"test:testgetamonitorsdetailsreturnsokresponse1641430257\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":59800662,\"multi\":true,\"name\":\"Test-Get_a_monitor_s_details_returns_OK_response-1641430257\",\"created\":\"2022-01-06T00:50:58.216052+00:00\",\"created_at\":1641430258000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-01-06T00:50:58.216052+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2,\"warning\":1}}}" + "size": 1127, + "text": "{\"restricted_roles\":null,\"tags\":[\"test:testgetamonitorsdetailsreturnsokresponse1660586685\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":80119052,\"multi\":true,\"name\":\"Test-Get_a_monitor_s_details_returns_OK_response-1660586685\",\"created\":\"2022-08-15T18:04:45.520307+00:00\",\"created_at\":1660586685000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-08-15T18:04:45.520307+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"on_missing_data\":\"show_and_notify_no_data\",\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2.0,\"warning\":1.0}}}" }, "cookies": [], "headers": [ @@ -94,17 +94,17 @@ "value": "application/json" } ], - "headersSize": 516, + "headersSize": 666, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:58.278Z", - "time": 184 + "startedDateTime": "2022-08-15T18:04:45.598Z", + "time": 337 }, { - "_id": "b0b53ae5ab45981f90a5c50eced970c4", + "_id": "7da5febbfb7a392abab1daa1f274ec3b", "_order": 0, "cache": {}, "request": { @@ -117,18 +117,18 @@ "value": "application/json" } ], - "headersSize": 429, + "headersSize": 513, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/monitor/59800662" + "url": "https://api.datadoghq.com/api/v1/monitor/80119052" }, "response": { "bodySize": 31, "content": { "mimeType": "application/json", "size": 31, - "text": "{\"deleted_monitor_id\":59800662}" + "text": "{\"deleted_monitor_id\":80119052}" }, "cookies": [], "headers": [ @@ -137,14 +137,14 @@ "value": "application/json" } ], - "headersSize": 382, + "headersSize": 635, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:50:58.465Z", - "time": 230 + "startedDateTime": "2022-08-15T18:04:45.941Z", + "time": 431 } ], "pages": [], diff --git a/cassettes/v1/Monitors_4022238206/Validate-a-monitor-returns-OK-response_1413713288/frozen.json b/cassettes/v1/Monitors_4022238206/Validate-a-monitor-returns-OK-response_1413713288/frozen.json index 2b1e56e22f2c..b2b12e44c398 100644 --- a/cassettes/v1/Monitors_4022238206/Validate-a-monitor-returns-OK-response_1413713288/frozen.json +++ b/cassettes/v1/Monitors_4022238206/Validate-a-monitor-returns-OK-response_1413713288/frozen.json @@ -1 +1 @@ -"2022-01-06T00:51:01.203Z" +"2022-08-15T18:04:46.384Z" diff --git a/cassettes/v1/Monitors_4022238206/Validate-a-monitor-returns-OK-response_1413713288/recording.har b/cassettes/v1/Monitors_4022238206/Validate-a-monitor-returns-OK-response_1413713288/recording.har index f2c235bc06ad..0ae27b5b9e0d 100644 --- a/cassettes/v1/Monitors_4022238206/Validate-a-monitor-returns-OK-response_1413713288/recording.har +++ b/cassettes/v1/Monitors_4022238206/Validate-a-monitor-returns-OK-response_1413713288/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "821e10d3ade3e095401a908837ef5b9f", + "_id": "68177ea6533571c81e8e501e8006c671", "_order": 0, "cache": {}, "request": { - "bodySize": 705, + "bodySize": 749, "cookies": [], "headers": [ { @@ -26,13 +26,13 @@ "value": "application/json" } ], - "headersSize": 481, + "headersSize": 566, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Validate_a_monitor_returns_OK_response-1641430261\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testvalidateamonitorreturnsokresponse1641430261\",\"env:ci\"],\"type\":\"log alert\"}" + "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Validate_a_monitor_returns_OK_response-1660586686\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testvalidateamonitorreturnsokresponse1660586686\",\"env:ci\"],\"type\":\"log alert\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/monitor/validate" @@ -51,14 +51,14 @@ "value": "application/json" } ], - "headersSize": 358, + "headersSize": 611, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:51:01.206Z", - "time": 258 + "startedDateTime": "2022-08-15T18:04:46.390Z", + "time": 359 } ], "pages": [], diff --git a/cassettes/v1/Monitors_4022238206/Validate-a-multi-alert-monitor-returns-OK-response_3334762130/frozen.json b/cassettes/v1/Monitors_4022238206/Validate-a-multi-alert-monitor-returns-OK-response_3334762130/frozen.json new file mode 100644 index 000000000000..fe77a2f23987 --- /dev/null +++ b/cassettes/v1/Monitors_4022238206/Validate-a-multi-alert-monitor-returns-OK-response_3334762130/frozen.json @@ -0,0 +1 @@ +"2022-08-15T18:04:46.756Z" diff --git a/cassettes/v1/Monitors_4022238206/Validate-a-multi-alert-monitor-returns-OK-response_3334762130/recording.har b/cassettes/v1/Monitors_4022238206/Validate-a-multi-alert-monitor-returns-OK-response_3334762130/recording.har new file mode 100644 index 000000000000..39dc30b3d4e3 --- /dev/null +++ b/cassettes/v1/Monitors_4022238206/Validate-a-multi-alert-monitor-returns-OK-response_3334762130/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Monitors/Validate a multi-alert monitor returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "e34971e4a97d76f72fa0a6f1ecf342e2", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 804, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 566, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Validate_a_multi_alert_monitor_returns_OK_response-1660586686\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"group_retention_duration\":\"2d\",\"groupby_simple_monitor\":false,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testvalidateamultialertmonitorreturnsokresponse1660586686\",\"env:ci\"],\"type\":\"log alert\"}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/monitor/validate" + }, + "response": { + "bodySize": 2, + "content": { + "mimeType": "application/json", + "size": 2, + "text": "{}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 611, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-08-15T18:04:46.760Z", + "time": 355 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-Invalid-JSON-response_1947249438/frozen.json b/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-Invalid-JSON-response_1947249438/frozen.json index 5aebc3898d4a..599bec71c410 100644 --- a/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-Invalid-JSON-response_1947249438/frozen.json +++ b/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-Invalid-JSON-response_1947249438/frozen.json @@ -1 +1 @@ -"2022-04-04T09:34:37.709Z" +"2022-08-15T18:04:47.121Z" diff --git a/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-Invalid-JSON-response_1947249438/recording.har b/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-Invalid-JSON-response_1947249438/recording.har index 50ac53bd8994..119209be7dcc 100644 --- a/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-Invalid-JSON-response_1947249438/recording.har +++ b/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-Invalid-JSON-response_1947249438/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "722cecdd779e5997d507cee4e27cf6fc", + "_id": "6a53061a13ffa0d5411ce96a5b12425d", "_order": 0, "cache": {}, "request": { - "bodySize": 743, + "bodySize": 787, "cookies": [], "headers": [ { @@ -32,17 +32,17 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Validate_an_existing_monitor_returns_Invalid_JSON_response-1649064877\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testvalidateanexistingmonitorreturnsinvalidjsonresponse1649064877\",\"env:ci\"],\"type\":\"log alert\"}" + "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Validate_an_existing_monitor_returns_Invalid_JSON_response-1660586687\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testvalidateanexistingmonitorreturnsinvalidjsonresponse1660586687\",\"env:ci\"],\"type\":\"log alert\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/monitor" }, "response": { - "bodySize": 1113, + "bodySize": 1157, "content": { "mimeType": "application/json", - "size": 1113, - "text": "{\"restricted_roles\":null,\"tags\":[\"test:testvalidateanexistingmonitorreturnsinvalidjsonresponse1649064877\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":67817255,\"multi\":true,\"name\":\"Test-Validate_an_existing_monitor_returns_Invalid_JSON_response-1649064877\",\"created\":\"2022-04-04T09:34:38.039976+00:00\",\"created_at\":1649064878000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-04-04T09:34:38.039976+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2.0,\"warning\":1.0}}}" + "size": 1157, + "text": "{\"restricted_roles\":null,\"tags\":[\"test:testvalidateanexistingmonitorreturnsinvalidjsonresponse1660586687\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":80119053,\"multi\":true,\"name\":\"Test-Validate_an_existing_monitor_returns_Invalid_JSON_response-1660586687\",\"created\":\"2022-08-15T18:04:47.439397+00:00\",\"created_at\":1660586687000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-08-15T18:04:47.439397+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"on_missing_data\":\"show_and_notify_no_data\",\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2.0,\"warning\":1.0}}}" }, "cookies": [], "headers": [ @@ -57,11 +57,11 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-04-04T09:34:37.725Z", - "time": 375 + "startedDateTime": "2022-08-15T18:04:47.127Z", + "time": 397 }, { - "_id": "80eaa4bb3952a66ed91ad562d5bb781c", + "_id": "77a3458a49134b350973473899a1d95b", "_order": 0, "cache": {}, "request": { @@ -88,7 +88,7 @@ "text": "{\"query\":\"query\",\"type\":\"log alert\"}" }, "queryString": [], - "url": "https://api.datadoghq.com/api/v1/monitor/67817255/validate" + "url": "https://api.datadoghq.com/api/v1/monitor/80119053/validate" }, "response": { "bodySize": 97, @@ -110,11 +110,11 @@ "status": 400, "statusText": "Bad Request" }, - "startedDateTime": "2022-04-04T09:34:38.111Z", - "time": 240 + "startedDateTime": "2022-08-15T18:04:47.531Z", + "time": 316 }, { - "_id": "01ed89ff2c043ab4d0232b19c15711d7", + "_id": "ef721ef8dee1335eb25ae940bfdce685", "_order": 0, "cache": {}, "request": { @@ -131,14 +131,14 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/monitor/67817255" + "url": "https://api.datadoghq.com/api/v1/monitor/80119053" }, "response": { "bodySize": 31, "content": { "mimeType": "application/json", "size": 31, - "text": "{\"deleted_monitor_id\":67817255}" + "text": "{\"deleted_monitor_id\":80119053}" }, "cookies": [], "headers": [ @@ -153,8 +153,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-04-04T09:34:38.358Z", - "time": 343 + "startedDateTime": "2022-08-15T18:04:47.853Z", + "time": 482 } ], "pages": [], diff --git a/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-OK-response_898284207/frozen.json b/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-OK-response_898284207/frozen.json index e26f516ef709..67e27f885a47 100644 --- a/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-OK-response_898284207/frozen.json +++ b/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-OK-response_898284207/frozen.json @@ -1 +1 @@ -"2022-04-04T09:34:38.711Z" +"2022-08-15T18:04:48.343Z" diff --git a/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-OK-response_898284207/recording.har b/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-OK-response_898284207/recording.har index dfd6db4708f3..8a7cbb4f0cc5 100644 --- a/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-OK-response_898284207/recording.har +++ b/cassettes/v1/Monitors_4022238206/Validate-an-existing-monitor-returns-OK-response_898284207/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "47b165481f65a9e7a8648cbed3ad83a8", + "_id": "12fdc38ead1f57bb1ed898abf52128d0", "_order": 0, "cache": {}, "request": { - "bodySize": 724, + "bodySize": 768, "cookies": [], "headers": [ { @@ -32,17 +32,17 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Validate_an_existing_monitor_returns_OK_response-1649064878\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testvalidateanexistingmonitorreturnsokresponse1649064878\",\"env:ci\"],\"type\":\"log alert\"}" + "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Validate_an_existing_monitor_returns_OK_response-1660586688\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testvalidateanexistingmonitorreturnsokresponse1660586688\",\"env:ci\"],\"type\":\"log alert\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/monitor" }, "response": { - "bodySize": 1094, + "bodySize": 1138, "content": { "mimeType": "application/json", - "size": 1094, - "text": "{\"restricted_roles\":null,\"tags\":[\"test:testvalidateanexistingmonitorreturnsokresponse1649064878\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":67817256,\"multi\":true,\"name\":\"Test-Validate_an_existing_monitor_returns_OK_response-1649064878\",\"created\":\"2022-04-04T09:34:38.970851+00:00\",\"created_at\":1649064878000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-04-04T09:34:38.970851+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2.0,\"warning\":1.0}}}" + "size": 1138, + "text": "{\"restricted_roles\":null,\"tags\":[\"test:testvalidateanexistingmonitorreturnsokresponse1660586688\",\"env:ci\"],\"deleted\":null,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":80119054,\"multi\":true,\"name\":\"Test-Validate_an_existing_monitor_returns_OK_response-1660586688\",\"created\":\"2022-08-15T18:04:48.776591+00:00\",\"created_at\":1660586688000,\"creator\":{\"id\":1445416,\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"org_id\":321813,\"modified\":\"2022-08-15T18:04:48.776591+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"log alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"timeout_h\":24,\"renotify_interval\":60,\"include_tags\":true,\"no_data_timeframe\":null,\"silenced\":{},\"new_host_delay\":600,\"on_missing_data\":\"show_and_notify_no_data\",\"require_full_window\":true,\"notify_no_data\":false,\"enable_logs_sample\":true,\"groupby_simple_monitor\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"thresholds\":{\"critical\":2.0,\"warning\":1.0}}}" }, "cookies": [], "headers": [ @@ -57,15 +57,15 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-04-04T09:34:38.717Z", - "time": 298 + "startedDateTime": "2022-08-15T18:04:48.346Z", + "time": 506 }, { - "_id": "6f9f295318536555b75d2bb2980fde8b", + "_id": "1768cb44cf496d89e634eea6e7507218", "_order": 0, "cache": {}, "request": { - "bodySize": 724, + "bodySize": 768, "cookies": [], "headers": [ { @@ -85,10 +85,10 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Validate_an_existing_monitor_returns_OK_response-1649064878\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testvalidateanexistingmonitorreturnsokresponse1649064878\",\"env:ci\"],\"type\":\"log alert\"}" + "text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Validate_an_existing_monitor_returns_OK_response-1660586688\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testvalidateanexistingmonitorreturnsokresponse1660586688\",\"env:ci\"],\"type\":\"log alert\"}" }, "queryString": [], - "url": "https://api.datadoghq.com/api/v1/monitor/67817256/validate" + "url": "https://api.datadoghq.com/api/v1/monitor/80119054/validate" }, "response": { "bodySize": 2, @@ -110,11 +110,11 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-04-04T09:34:39.041Z", - "time": 819 + "startedDateTime": "2022-08-15T18:04:48.858Z", + "time": 354 }, { - "_id": "a8cc9792809c4542eaf8487dd78d2b48", + "_id": "c2dd9e0c5bcc1f4d105509417ff5d79e", "_order": 0, "cache": {}, "request": { @@ -131,14 +131,14 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/monitor/67817256" + "url": "https://api.datadoghq.com/api/v1/monitor/80119054" }, "response": { "bodySize": 31, "content": { "mimeType": "application/json", "size": 31, - "text": "{\"deleted_monitor_id\":67817256}" + "text": "{\"deleted_monitor_id\":80119054}" }, "cookies": [], "headers": [ @@ -153,8 +153,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-04-04T09:34:39.865Z", - "time": 405 + "startedDateTime": "2022-08-15T18:04:49.217Z", + "time": 352 } ], "pages": [], diff --git a/examples/v1/monitors/ValidateExistingMonitor.ts b/examples/v1/monitors/ValidateExistingMonitor.ts index a5ae5380358a..d21f87c87e0a 100644 --- a/examples/v1/monitors/ValidateExistingMonitor.ts +++ b/examples/v1/monitors/ValidateExistingMonitor.ts @@ -29,6 +29,7 @@ const params: v1.MonitorsApiValidateExistingMonitorRequest = { noDataTimeframe: undefined, notifyAudit: false, notifyNoData: false, + onMissingData: "show_and_notify_no_data", renotifyInterval: 60, requireFullWindow: true, timeoutH: 24, diff --git a/examples/v1/monitors/ValidateMonitor.ts b/examples/v1/monitors/ValidateMonitor.ts index 77340d443990..c3af4864ca57 100644 --- a/examples/v1/monitors/ValidateMonitor.ts +++ b/examples/v1/monitors/ValidateMonitor.ts @@ -26,6 +26,7 @@ const params: v1.MonitorsApiValidateMonitorRequest = { noDataTimeframe: undefined, notifyAudit: false, notifyNoData: false, + onMissingData: "show_and_notify_no_data", renotifyInterval: 60, requireFullWindow: true, timeoutH: 24, diff --git a/examples/v1/monitors/ValidateMonitor_4247196452.ts b/examples/v1/monitors/ValidateMonitor_4247196452.ts new file mode 100644 index 000000000000..6ac82053f6ed --- /dev/null +++ b/examples/v1/monitors/ValidateMonitor_4247196452.ts @@ -0,0 +1,49 @@ +/** + * Validate a multi-alert monitor returns "OK" response + */ + +import { client, v1 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v1.MonitorsApi(configuration); + +const params: v1.MonitorsApiValidateMonitorRequest = { + body: { + name: "Example-Validate_a_multi_alert_monitor_returns_OK_response", + type: "log alert", + query: `logs("service:foo AND type:error").index("main").rollup("count").by("source").last("5m") > 2`, + message: "some message Notify: @hipchat-channel", + tags: ["test:examplevalidateamultialertmonitorreturnsokresponse", "env:ci"], + priority: 3, + options: { + enableLogsSample: true, + escalationMessage: "the situation has escalated", + evaluationDelay: 700, + groupRetentionDuration: "2d", + groupbySimpleMonitor: false, + includeTags: true, + locked: false, + newHostDelay: 600, + noDataTimeframe: undefined, + notifyAudit: false, + notifyNoData: false, + onMissingData: "show_and_notify_no_data", + renotifyInterval: 60, + requireFullWindow: true, + timeoutH: 24, + thresholds: { + critical: 2, + warning: 1, + }, + }, + }, +}; + +apiInstance + .validateMonitor(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/v1/given.json b/features/v1/given.json index aa1c85614264..cf241da8970f 100644 --- a/features/v1/given.json +++ b/features/v1/given.json @@ -87,7 +87,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"name\": \"{{ unique }}\",\n \"type\": \"log alert\",\n \"query\": \"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\n \"message\": \"some message Notify: @hipchat-channel\",\n \"tags\": [\"test:{{ unique_lower_alnum }}\", \"env:ci\"],\n \"priority\": 3,\n \"options\": {\n \"enable_logs_sample\": true,\n \"escalation_message\": \"the situation has escalated\",\n \"evaluation_delay\": 700,\n \"groupby_simple_monitor\": true,\n \"include_tags\": true,\n \"locked\": false,\n \"new_host_delay\": 600,\n \"no_data_timeframe\": null,\n \"notify_audit\": false,\n \"notify_no_data\": false,\n \"renotify_interval\": 60,\n \"require_full_window\": true,\n \"timeout_h\": 24,\n \"thresholds\": { \"critical\": 2, \"warning\": 1 }\n }\n}\n" + "value": "{\n \"name\": \"{{ unique }}\",\n \"type\": \"log alert\",\n \"query\": \"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\n \"message\": \"some message Notify: @hipchat-channel\",\n \"tags\": [\"test:{{ unique_lower_alnum }}\", \"env:ci\"],\n \"priority\": 3,\n \"options\": {\n \"enable_logs_sample\": true,\n \"escalation_message\": \"the situation has escalated\",\n \"evaluation_delay\": 700,\n \"groupby_simple_monitor\": true,\n \"include_tags\": true,\n \"locked\": false,\n \"new_host_delay\": 600,\n \"no_data_timeframe\": null,\n \"notify_audit\": false,\n \"notify_no_data\": false,\n \"on_missing_data\": \"show_and_notify_no_data\",\n \"renotify_interval\": 60,\n \"require_full_window\": true,\n \"timeout_h\": 24,\n \"thresholds\": { \"critical\": 2, \"warning\": 1 }\n }\n}\n" } ], "step": "there is a valid \"monitor\" in the system", diff --git a/features/v1/monitor_payload.json b/features/v1/monitor_payload.json index 4b9f959589f0..655c3884c777 100644 --- a/features/v1/monitor_payload.json +++ b/features/v1/monitor_payload.json @@ -16,6 +16,7 @@ "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, + "on_missing_data": "show_and_notify_no_data", "renotify_interval": 60, "require_full_window": true, "timeout_h": 24, diff --git a/features/v1/monitors.feature b/features/v1/monitors.feature index cd90675f6920..fc0a197ef307 100644 --- a/features/v1/monitors.feature +++ b/features/v1/monitors.feature @@ -115,7 +115,7 @@ Feature: Monitors Scenario: Edit a monitor returns "Bad Request" response Given new "UpdateMonitor" request And request contains "monitor_id" parameter from "REPLACE.ME" - And body with value {"options": {"escalation_message": "none", "evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "restricted_roles": [], "tags": [], "type": "query alert"} + And body with value {"options": {"escalation_message": "none", "evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "restricted_roles": [], "tags": [], "type": "query alert"} When the request is sent Then the response status is 400 Bad Request @@ -232,6 +232,13 @@ Feature: Monitors When the request is sent Then the response status is 200 OK + @team:DataDog/monitor-app + Scenario: Validate a multi-alert monitor returns "OK" response + Given new "ValidateMonitor" request + And body from file "multi_alert_monitor_payload.json" + When the request is sent + Then the response status is 200 OK + @team:DataDog/monitor-app Scenario: Validate an existing monitor returns "Invalid JSON" response Given there is a valid "monitor" in the system diff --git a/features/v1/multi_alert_monitor_payload.json b/features/v1/multi_alert_monitor_payload.json new file mode 100644 index 000000000000..7ba5fe74d483 --- /dev/null +++ b/features/v1/multi_alert_monitor_payload.json @@ -0,0 +1,26 @@ +{ + "name": "{{ unique }}", + "type": "log alert", + "query": "logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") > 2", + "message": "some message Notify: @hipchat-channel", + "tags": ["test:{{ unique_lower_alnum }}", "env:ci"], + "priority": 3, + "options": { + "enable_logs_sample": true, + "escalation_message": "the situation has escalated", + "evaluation_delay": 700, + "group_retention_duration": "2d", + "groupby_simple_monitor": false, + "include_tags": true, + "locked": false, + "new_host_delay": 600, + "no_data_timeframe": null, + "notify_audit": false, + "notify_no_data": false, + "on_missing_data": "show_and_notify_no_data", + "renotify_interval": 60, + "require_full_window": true, + "timeout_h": 24, + "thresholds": { "critical": 2, "warning": 1 } + } +} diff --git a/packages/datadog-api-client-v1/index.ts b/packages/datadog-api-client-v1/index.ts index 0768a38cdb7e..1cb4220a092b 100644 --- a/packages/datadog-api-client-v1/index.ts +++ b/packages/datadog-api-client-v1/index.ts @@ -646,6 +646,7 @@ export { NotebookUpdateDataAttributes } from "./models/NotebookUpdateDataAttribu export { NotebookUpdateRequest } from "./models/NotebookUpdateRequest"; export { NoteWidgetDefinition } from "./models/NoteWidgetDefinition"; export { NoteWidgetDefinitionType } from "./models/NoteWidgetDefinitionType"; +export { OnMissingDataOption } from "./models/OnMissingDataOption"; export { Organization } from "./models/Organization"; export { OrganizationBilling } from "./models/OrganizationBilling"; export { OrganizationCreateBody } from "./models/OrganizationCreateBody"; diff --git a/packages/datadog-api-client-v1/models/MonitorOptions.ts b/packages/datadog-api-client-v1/models/MonitorOptions.ts index 7fce71640b03..3d2b3db2d0e5 100644 --- a/packages/datadog-api-client-v1/models/MonitorOptions.ts +++ b/packages/datadog-api-client-v1/models/MonitorOptions.ts @@ -9,6 +9,7 @@ import { MonitorOptionsAggregation } from "./MonitorOptionsAggregation"; import { MonitorRenotifyStatusType } from "./MonitorRenotifyStatusType"; import { MonitorThresholds } from "./MonitorThresholds"; import { MonitorThresholdWindowOptions } from "./MonitorThresholdWindowOptions"; +import { OnMissingDataOption } from "./OnMissingDataOption"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -41,6 +42,13 @@ export class MonitorOptions { * This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor always has data during evaluation. */ "evaluationDelay"?: number; + /** + * The time span after which groups with missing data are dropped from the monitor state. + * The minimum value is one hour, and the maximum value is 72 hours. + * Example values are: "60m", "1h", and "2d". + * This option is only available for APM Trace Analytics, Audit Trail, CI, Error Tracking, Event, Logs, and RUM monitors. + */ + "groupRetentionDuration"?: string; /** * Whether the log alert monitor triggers a single alert or multiple alerts when any group breaches a threshold. */ @@ -97,6 +105,14 @@ export class MonitorOptions { * A Boolean indicating whether this monitor notifies when data stops reporting. */ "notifyNoData"?: boolean; + /** + * Controls how groups or monitors are treated if an evaluation does not return any data points. + * The default option results in different behavior depending on the monitor query type. + * For monitors using Count queries, an empty monitor evaluation is treated as 0 and is compared to the threshold conditions. + * For monitor using any query type other than Count, for example Gauge or Rate, the monitor shows the last known status. + * This option is only available for APM Trace Analytics, Audit Trail, CI, Error Tracking, Event, Logs, and RUM monitors. + */ + "onMissingData"?: OnMissingDataOption; /** * The number of minutes after the last notification before a monitor re-notifies on the current status. * It only re-notifies if it’s not resolved. @@ -171,6 +187,10 @@ export class MonitorOptions { type: "number", format: "int64", }, + groupRetentionDuration: { + baseName: "group_retention_duration", + type: "string", + }, groupbySimpleMonitor: { baseName: "groupby_simple_monitor", type: "boolean", @@ -216,6 +236,10 @@ export class MonitorOptions { baseName: "notify_no_data", type: "boolean", }, + onMissingData: { + baseName: "on_missing_data", + type: "OnMissingDataOption", + }, renotifyInterval: { baseName: "renotify_interval", type: "number", diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index 6e161a835faa..8650f8590bcc 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -830,6 +830,12 @@ const enumsMap: { [key: string]: any[] } = { ], NotebookResourceType: ["notebooks"], NotebookStatus: ["published"], + OnMissingDataOption: [ + "default", + "show_no_data", + "show_and_notify_no_data", + "resolve", + ], QuerySortOrder: ["asc", "desc"], QueryValueWidgetDefinitionType: ["query_value"], SLOCorrectionCategory: [ diff --git a/packages/datadog-api-client-v1/models/OnMissingDataOption.ts b/packages/datadog-api-client-v1/models/OnMissingDataOption.ts new file mode 100644 index 000000000000..e1bb57b4f30d --- /dev/null +++ b/packages/datadog-api-client-v1/models/OnMissingDataOption.ts @@ -0,0 +1,15 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +export type OnMissingDataOption = + | typeof DEFAULT + | typeof SHOW_NO_DATA + | typeof SHOW_AND_NOTIFY_NO_DATA + | typeof RESOLVE; +export const DEFAULT = "default"; +export const SHOW_NO_DATA = "show_no_data"; +export const SHOW_AND_NOTIFY_NO_DATA = "show_and_notify_no_data"; +export const RESOLVE = "resolve";