From ccc38f7644aa854c47d23080ee5c1b577588dec6 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 17 Aug 2022 17:26:44 +0000 Subject: [PATCH] Regenerate client from commit 57b75ade of spec repo --- .apigentools-info | 8 ++-- .generator/schemas/v1/openapi.yaml | 39 +++++++++++++++++++ ...w-dashboard-with-alert-graph-widget.frozen | 2 +- ...-new-dashboard-with-alert-graph-widget.yml | 38 ++++++++++-------- ...w-dashboard-with-alert-value-widget.frozen | 2 +- ...-new-dashboard-with-alert-value-widget.yml | 38 ++++++++++-------- ...onitor-downtime-returns-OK-response.frozen | 2 +- ...a-monitor-downtime-returns-OK-response.yml | 30 +++++++------- ...-can-be-deleted-returns-OK-response.frozen | 2 +- ...tor-can-be-deleted-returns-OK-response.yml | 28 ++++++------- ...elete-a-monitor-returns-OK-response.frozen | 2 +- .../Delete-a-monitor-returns-OK-response.yml | 28 ++++++------- .../Edit-a-monitor-returns-OK-response.frozen | 2 +- .../Edit-a-monitor-returns-OK-response.yml | 34 ++++++++-------- ...nitor-s-details-returns-OK-response.frozen | 2 +- ...-monitor-s-details-returns-OK-response.yml | 34 ++++++++-------- ...idate-a-monitor-returns-OK-response.frozen | 2 +- ...Validate-a-monitor-returns-OK-response.yml | 8 ++-- ...i-alert-monitor-returns-OK-response.frozen | 1 + ...ulti-alert-monitor-returns-OK-response.yml | 28 +++++++++++++ ...nitor-returns-Invalid-JSON-response.frozen | 2 +- ...-monitor-returns-Invalid-JSON-response.yml | 24 ++++++------ ...xisting-monitor-returns-OK-response.frozen | 2 +- ...n-existing-monitor-returns-OK-response.yml | 30 +++++++------- ...gate-RUM-events-returns-OK-response.frozen | 2 +- ...gregate-RUM-events-returns-OK-response.yml | 4 +- .../v1/monitors/ValidateExistingMonitor.rb | 1 + examples/v1/monitors/ValidateMonitor.rb | 1 + .../v1/monitors/ValidateMonitor_4247196452.rb | 38 ++++++++++++++++++ features/v1/given.json | 2 +- features/v1/monitor_payload.json | 1 + features/v1/monitors.feature | 9 ++++- features/v1/multi_alert_monitor_payload.json | 26 +++++++++++++ lib/datadog_api_client/inflector.rb | 1 + .../v1/models/monitor_options.rb | 29 +++++++++++++- .../v1/models/on_missing_data_option.rb | 33 ++++++++++++++++ 36 files changed, 373 insertions(+), 162 deletions(-) create mode 100644 cassettes/features/v1/monitors/Validate-a-multi-alert-monitor-returns-OK-response.frozen create mode 100644 cassettes/features/v1/monitors/Validate-a-multi-alert-monitor-returns-OK-response.yml create mode 100644 examples/v1/monitors/ValidateMonitor_4247196452.rb create mode 100644 features/v1/multi_alert_monitor_payload.json create mode 100644 lib/datadog_api_client/v1/models/on_missing_data_option.rb diff --git a/.apigentools-info b/.apigentools-info index 21a2e8796a4a..6a59a620d2e4 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.2", - "regenerated": "2022-08-17 14:32:13.711845", - "spec_repo_commit": "a957cd49" + "regenerated": "2022-08-17 17:26:21.803730", + "spec_repo_commit": "57b75ade" }, "v2": { "apigentools_version": "1.6.2", - "regenerated": "2022-08-17 14:32:13.727125", - "spec_repo_commit": "a957cd49" + "regenerated": "2022-08-17 17:26:21.815574", + "spec_repo_commit": "57b75ade" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 4b7b6e4cc8b7..80bb9c42d849 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -6133,6 +6133,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. @@ -6223,6 +6234,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 @@ -7928,6 +7941,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/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.frozen b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.frozen index 3687f840e80f..c0ddecaf79ba 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.frozen +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.frozen @@ -1 +1 @@ -2022-01-06T00:50:25.975Z \ No newline at end of file +2022-08-15T18:04:35.875Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.yml b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.yml index 773be5495b11..a866a3a615c5 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.yml +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Thu, 06 Jan 2022 00:50:25 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:35 GMT request: body: encoding: UTF-8 - string: '{"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 + string: '{"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:testcreateanewdashboardwithalertgraphwidget1641430225","env:ci"],"type":"log + > 2","tags":["test:testcreateanewdashboardwithalertgraphwidget1660586675","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,22 +18,22 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"restricted_roles":null,"tags":["test:testcreateanewdashboardwithalertgraphwidget1641430225","env:ci"],"deleted":null,"query":"logs(\"service:foo + string: '{"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":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}}}' + > 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}}}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 06 Jan 2022 00:50:25 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:35 GMT request: body: encoding: UTF-8 - string: '{"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}}]}' + string: '{"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}}]}' headers: Accept: - application/json @@ -44,43 +44,47 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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"}' + string: '{"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"} + + ' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 06 Jan 2022 00:50:25 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:35 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/dashboard/m8v-aud-r6a + uri: https://api.datadoghq.com/api/v1/dashboard/shb-j47-ek7 response: body: encoding: UTF-8 - string: '{"deleted_dashboard_id":"m8v-aud-r6a"}' + string: '{"deleted_dashboard_id":"shb-j47-ek7"} + + ' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 06 Jan 2022 00:50:25 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:35 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/59800315 + uri: https://api.datadoghq.com/api/v1/monitor/80119038 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":59800315}' + string: '{"deleted_monitor_id":80119038}' headers: Content-Type: - application/json diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.frozen b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.frozen index e47ddcc9d37f..267dbec4b1f7 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.frozen +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.frozen @@ -1 +1 @@ -2022-01-06T00:50:27.007Z \ No newline at end of file +2022-08-15T18:04:38.079Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.yml b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.yml index 63e9b1dfcc63..dad44ea20f99 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.yml +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Thu, 06 Jan 2022 00:50:27 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:38 GMT request: body: encoding: UTF-8 - string: '{"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 + string: '{"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:testcreateanewdashboardwithalertvaluewidget1641430227","env:ci"],"type":"log + > 2","tags":["test:testcreateanewdashboardwithalertvaluewidget1660586678","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,22 +18,22 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"restricted_roles":null,"tags":["test:testcreateanewdashboardwithalertvaluewidget1641430227","env:ci"],"deleted":null,"query":"logs(\"service:foo + string: '{"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":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}}}' + > 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}}}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 06 Jan 2022 00:50:27 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:38 GMT request: body: encoding: UTF-8 - string: '{"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}}]}' + string: '{"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}}]}' headers: Accept: - application/json @@ -44,43 +44,47 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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"}' + string: '{"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"} + + ' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 06 Jan 2022 00:50:27 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:38 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/dashboard/mku-sdw-4ht + uri: https://api.datadoghq.com/api/v1/dashboard/p6f-bg6-nct response: body: encoding: UTF-8 - string: '{"deleted_dashboard_id":"mku-sdw-4ht"}' + string: '{"deleted_dashboard_id":"p6f-bg6-nct"} + + ' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 06 Jan 2022 00:50:27 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:38 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/59800326 + uri: https://api.datadoghq.com/api/v1/monitor/80119041 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":59800326}' + string: '{"deleted_monitor_id":80119041}' headers: Content-Type: - application/json diff --git a/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.frozen b/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.frozen index 59653149d3e2..41c63c0f85c3 100644 --- a/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.frozen +++ b/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.frozen @@ -1 +1 @@ -2022-05-12T09:50:01.751Z \ No newline at end of file +2022-08-15T18:04:39.736Z \ No newline at end of file diff --git a/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.yml b/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.yml index 68c17d3c13a0..a70a3fa570fb 100644 --- a/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.yml +++ b/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Thu, 12 May 2022 09:50:01 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:39 GMT request: body: encoding: UTF-8 - string: '{"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 + string: '{"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:testscheduleamonitordowntimereturnsokresponse1652349001","env:ci"],"type":"log + > 2","tags":["test:testscheduleamonitordowntimereturnsokresponse1660586679","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,10 +18,10 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"restricted_roles":null,"tags":["test:testscheduleamonitordowntimereturnsokresponse1652349001","env:ci"],"deleted":null,"query":"logs(\"service:foo + string: '{"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":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 + > 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}}}' headers: Content-Type: @@ -29,11 +29,11 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 12 May 2022 09:50:01 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:39 GMT request: body: encoding: UTF-8 - string: '{"message":"Test-Schedule_a_monitor_downtime_returns_OK_response-1652349001","monitor_id":71310133,"scope":["test:testscheduleamonitordowntimereturnsokresponse1652349001"],"start":1652349001,"timezone":"Etc/UTC"}' + string: '{"message":"Test-Schedule_a_monitor_downtime_returns_OK_response-1660586679","monitor_id":80119043,"scope":["test:testscheduleamonitordowntimereturnsokresponse1660586679"],"start":1660586679,"timezone":"Etc/UTC"}' headers: Accept: - application/json @@ -44,21 +44,21 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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}' + string: '{"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}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 12 May 2022 09:50:01 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:39 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v1/downtime/1944162322 + uri: https://api.datadoghq.com/api/v1/downtime/2164108453 response: body: encoding: UTF-8 @@ -67,18 +67,18 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 12 May 2022 09:50:01 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:39 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/71310133 + uri: https://api.datadoghq.com/api/v1/monitor/80119043 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":71310133}' + string: '{"deleted_monitor_id":80119043}' headers: Content-Type: - application/json diff --git a/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.frozen b/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.frozen index 9b01e21217be..b165b3a5b4ad 100644 --- a/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.frozen +++ b/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.frozen @@ -1 +1 @@ -2022-01-06T00:50:53.019Z \ No newline at end of file +2022-08-15T18:04:41.604Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.yml b/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.yml index 7169b6d1a099..836d3c73ddf2 100644 --- a/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.yml +++ b/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Thu, 06 Jan 2022 00:50:53 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:41 GMT request: body: encoding: UTF-8 - string: '{"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 + string: '{"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:testcheckifamonitorcanbedeletedreturnsokresponse1641430253","env:ci"],"type":"log + > 2","tags":["test:testcheckifamonitorcanbedeletedreturnsokresponse1660586681","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,47 +18,47 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"restricted_roles":null,"tags":["test:testcheckifamonitorcanbedeletedreturnsokresponse1641430253","env:ci"],"deleted":null,"query":"logs(\"service:foo + string: '{"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":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}}}' + > 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}}}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 06 Jan 2022 00:50:53 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:41 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v1/monitor/can_delete?monitor_ids=59800600 + uri: https://api.datadoghq.com/api/v1/monitor/can_delete?monitor_ids=80119046 response: body: encoding: UTF-8 - string: '{"errors":null,"data":{"ok":[59800600]}}' + string: '{"errors":null,"data":{"ok":[80119046]}}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 06 Jan 2022 00:50:53 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:41 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/59800600 + uri: https://api.datadoghq.com/api/v1/monitor/80119046 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":59800600}' + string: '{"deleted_monitor_id":80119046}' headers: Content-Type: - application/json diff --git a/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.frozen b/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.frozen index ec882ea9bf27..d3b39509bd5e 100644 --- a/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.frozen +++ b/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.frozen @@ -1 +1 @@ -2022-01-06T00:50:56.007Z \ No newline at end of file +2022-08-15T18:04:42.888Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.yml b/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.yml index 46388ee5b000..584856e40373 100644 --- a/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.yml +++ b/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Thu, 06 Jan 2022 00:50:56 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:42 GMT request: body: encoding: UTF-8 - string: '{"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 + string: '{"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:testdeleteamonitorreturnsokresponse1641430256","env:ci"],"type":"log + > 2","tags":["test:testdeleteamonitorreturnsokresponse1660586682","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,47 +18,47 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"restricted_roles":null,"tags":["test:testdeleteamonitorreturnsokresponse1641430256","env:ci"],"deleted":null,"query":"logs(\"service:foo + string: '{"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":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}}}' + > 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}}}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 06 Jan 2022 00:50:56 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:42 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/59800638 + uri: https://api.datadoghq.com/api/v1/monitor/80119048 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":59800638}' + string: '{"deleted_monitor_id":80119048}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 06 Jan 2022 00:50:56 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:42 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/59800638 + uri: https://api.datadoghq.com/api/v1/monitor/80119048 response: body: encoding: UTF-8 - string: '{"errors":["Monitor not found"]}' + string: '{"errors": ["Monitor not found"]}' headers: Content-Type: - application/json diff --git a/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.frozen b/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.frozen index fb6416ff42f9..83745073ab6d 100644 --- a/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.frozen +++ b/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.frozen @@ -1 +1 @@ -2022-01-06T00:50:56.906Z \ No newline at end of file +2022-08-15T18:04:43.969Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.yml b/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.yml index 09ab7c84d071..44cfc0368538 100644 --- a/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.yml +++ b/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Thu, 06 Jan 2022 00:50:56 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:43 GMT request: body: encoding: UTF-8 - string: '{"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 + string: '{"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:testeditamonitorreturnsokresponse1641430256","env:ci"],"type":"log + > 2","tags":["test:testeditamonitorreturnsokresponse1660586683","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,54 +18,54 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"restricted_roles":null,"tags":["test:testeditamonitorreturnsokresponse1641430256","env:ci"],"deleted":null,"query":"logs(\"service:foo + string: '{"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":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}}}' + > 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}}}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 06 Jan 2022 00:50:56 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:43 GMT request: body: encoding: UTF-8 - string: '{"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}}' + string: '{"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}}' headers: Accept: - application/json Content-Type: - application/json method: PUT - uri: https://api.datadoghq.com/api/v1/monitor/59800649 + uri: https://api.datadoghq.com/api/v1/monitor/80119050 response: body: encoding: UTF-8 - string: '{"restricted_roles":null,"tags":["test:testeditamonitorreturnsokresponse1641430256","env:ci"],"deleted":null,"query":"logs(\"service:foo + string: '{"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":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}}' + > 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}}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 06 Jan 2022 00:50:56 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:43 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/59800649 + uri: https://api.datadoghq.com/api/v1/monitor/80119050 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":59800649}' + string: '{"deleted_monitor_id":80119050}' headers: Content-Type: - application/json diff --git a/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.frozen b/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.frozen index c5b3785f381e..b6732ba5e66b 100644 --- a/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.frozen +++ b/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.frozen @@ -1 +1 @@ -2022-01-06T00:50:57.942Z \ No newline at end of file +2022-08-15T18:04:45.174Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.yml b/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.yml index 45f05d767859..b96f78d6717b 100644 --- a/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.yml +++ b/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Thu, 06 Jan 2022 00:50:57 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:45 GMT request: body: encoding: UTF-8 - string: '{"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 + string: '{"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:testgetamonitorsdetailsreturnsokresponse1641430257","env:ci"],"type":"log + > 2","tags":["test:testgetamonitorsdetailsreturnsokresponse1660586685","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,51 +18,51 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"restricted_roles":null,"tags":["test:testgetamonitorsdetailsreturnsokresponse1641430257","env:ci"],"deleted":null,"query":"logs(\"service:foo + string: '{"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":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}}}' + > 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}}}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 06 Jan 2022 00:50:57 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:45 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v1/monitor/59800662 + uri: https://api.datadoghq.com/api/v1/monitor/80119052 response: body: encoding: UTF-8 - string: '{"restricted_roles":null,"tags":["test:testgetamonitorsdetailsreturnsokresponse1641430257","env:ci"],"deleted":null,"query":"logs(\"service:foo + string: '{"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":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}}}' + > 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}}}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 06 Jan 2022 00:50:57 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:45 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/59800662 + uri: https://api.datadoghq.com/api/v1/monitor/80119052 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":59800662}' + string: '{"deleted_monitor_id":80119052}' headers: Content-Type: - application/json diff --git a/cassettes/features/v1/monitors/Validate-a-monitor-returns-OK-response.frozen b/cassettes/features/v1/monitors/Validate-a-monitor-returns-OK-response.frozen index 70edc113c5fa..7fe3052c09e4 100644 --- a/cassettes/features/v1/monitors/Validate-a-monitor-returns-OK-response.frozen +++ b/cassettes/features/v1/monitors/Validate-a-monitor-returns-OK-response.frozen @@ -1 +1 @@ -2022-01-06T00:51:01.203Z \ No newline at end of file +2022-08-15T18:04:46.384Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Validate-a-monitor-returns-OK-response.yml b/cassettes/features/v1/monitors/Validate-a-monitor-returns-OK-response.yml index fe0f3be052a6..65d6c9dcfcad 100644 --- a/cassettes/features/v1/monitors/Validate-a-monitor-returns-OK-response.yml +++ b/cassettes/features/v1/monitors/Validate-a-monitor-returns-OK-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Thu, 06 Jan 2022 00:51:01 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:46 GMT request: body: encoding: UTF-8 - string: '{"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 + string: '{"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:testvalidateamonitorreturnsokresponse1641430261","env:ci"],"type":"log + > 2","tags":["test:testvalidateamonitorreturnsokresponse1660586686","env:ci"],"type":"log alert"}' headers: Accept: diff --git a/cassettes/features/v1/monitors/Validate-a-multi-alert-monitor-returns-OK-response.frozen b/cassettes/features/v1/monitors/Validate-a-multi-alert-monitor-returns-OK-response.frozen new file mode 100644 index 000000000000..11fb4a7dead7 --- /dev/null +++ b/cassettes/features/v1/monitors/Validate-a-multi-alert-monitor-returns-OK-response.frozen @@ -0,0 +1 @@ +2022-08-15T18:04:46.756Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Validate-a-multi-alert-monitor-returns-OK-response.yml b/cassettes/features/v1/monitors/Validate-a-multi-alert-monitor-returns-OK-response.yml new file mode 100644 index 000000000000..af47960aa960 --- /dev/null +++ b/cassettes/features/v1/monitors/Validate-a-multi-alert-monitor-returns-OK-response.yml @@ -0,0 +1,28 @@ +http_interactions: +- recorded_at: Mon, 15 Aug 2022 18:04:46 GMT + request: + body: + encoding: UTF-8 + string: '{"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"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/monitor/validate + response: + body: + encoding: UTF-8 + string: '{}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.frozen b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.frozen index f7fccb4c3853..195601087b6e 100644 --- a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.frozen +++ b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.frozen @@ -1 +1 @@ -2022-04-04T09:34:37.709Z \ No newline at end of file +2022-08-15T18:04:47.121Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.yml b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.yml index 814d12ec047d..31d3ebf37ba8 100644 --- a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.yml +++ b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Mon, 04 Apr 2022 09:34:37 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:47 GMT request: body: encoding: UTF-8 - string: '{"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 + string: '{"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:testvalidateanexistingmonitorreturnsinvalidjsonresponse1649064877","env:ci"],"type":"log + > 2","tags":["test:testvalidateanexistingmonitorreturnsinvalidjsonresponse1660586687","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,10 +18,10 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"restricted_roles":null,"tags":["test:testvalidateanexistingmonitorreturnsinvalidjsonresponse1649064877","env:ci"],"deleted":null,"query":"logs(\"service:foo + string: '{"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":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 + > 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}}}' headers: Content-Type: @@ -29,7 +29,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Mon, 04 Apr 2022 09:34:37 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:47 GMT request: body: encoding: UTF-8 @@ -40,7 +40,7 @@ http_interactions: Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v1/monitor/67817255/validate + uri: https://api.datadoghq.com/api/v1/monitor/80119053/validate response: body: encoding: UTF-8 @@ -52,18 +52,18 @@ http_interactions: status: code: 400 message: Bad Request -- recorded_at: Mon, 04 Apr 2022 09:34:37 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:47 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/67817255 + uri: https://api.datadoghq.com/api/v1/monitor/80119053 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":67817255}' + string: '{"deleted_monitor_id":80119053}' headers: Content-Type: - application/json diff --git a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.frozen b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.frozen index 400e96f5cbb4..ba7a206c2369 100644 --- a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.frozen +++ b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.frozen @@ -1 +1 @@ -2022-04-04T09:34:38.711Z \ No newline at end of file +2022-08-15T18:04:48.343Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.yml b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.yml index 7492bd57afa8..16dc6db2add0 100644 --- a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.yml +++ b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Mon, 04 Apr 2022 09:34:38 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:48 GMT request: body: encoding: UTF-8 - string: '{"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 + string: '{"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:testvalidateanexistingmonitorreturnsokresponse1649064878","env:ci"],"type":"log + > 2","tags":["test:testvalidateanexistingmonitorreturnsokresponse1660586688","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,10 +18,10 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"restricted_roles":null,"tags":["test:testvalidateanexistingmonitorreturnsokresponse1649064878","env:ci"],"deleted":null,"query":"logs(\"service:foo + string: '{"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":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 + > 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}}}' headers: Content-Type: @@ -29,14 +29,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Mon, 04 Apr 2022 09:34:38 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:48 GMT request: body: encoding: UTF-8 - string: '{"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 + string: '{"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:testvalidateanexistingmonitorreturnsokresponse1649064878","env:ci"],"type":"log + > 2","tags":["test:testvalidateanexistingmonitorreturnsokresponse1660586688","env:ci"],"type":"log alert"}' headers: Accept: @@ -44,7 +44,7 @@ http_interactions: Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v1/monitor/67817256/validate + uri: https://api.datadoghq.com/api/v1/monitor/80119054/validate response: body: encoding: UTF-8 @@ -55,18 +55,18 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Mon, 04 Apr 2022 09:34:38 GMT +- recorded_at: Mon, 15 Aug 2022 18:04:48 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/67817256 + uri: https://api.datadoghq.com/api/v1/monitor/80119054 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":67817256}' + string: '{"deleted_monitor_id":80119054}' headers: Content-Type: - application/json diff --git a/cassettes/features/v2/rum/Aggregate-RUM-events-returns-OK-response.frozen b/cassettes/features/v2/rum/Aggregate-RUM-events-returns-OK-response.frozen index 3032665b442a..b02bf6fda918 100644 --- a/cassettes/features/v2/rum/Aggregate-RUM-events-returns-OK-response.frozen +++ b/cassettes/features/v2/rum/Aggregate-RUM-events-returns-OK-response.frozen @@ -1 +1 @@ -2022-03-28T15:06:36.041Z \ No newline at end of file +2022-03-29T08:59:44.790Z \ No newline at end of file diff --git a/cassettes/features/v2/rum/Aggregate-RUM-events-returns-OK-response.yml b/cassettes/features/v2/rum/Aggregate-RUM-events-returns-OK-response.yml index b8ba5abd838c..41ec1f231f7e 100644 --- a/cassettes/features/v2/rum/Aggregate-RUM-events-returns-OK-response.yml +++ b/cassettes/features/v2/rum/Aggregate-RUM-events-returns-OK-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Mon, 28 Mar 2022 15:06:36 GMT +- recorded_at: Tue, 29 Mar 2022 08:59:44 GMT request: body: encoding: UTF-8 @@ -15,7 +15,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"meta":{"status":"done","request_id":"pddv1ChZyS2R0R2cwbFNTR3dXWHE0T1V4SkV3IiwKHO-LyxpZr85euhVxgr_zcJZpbjq-uQVUzkFlD0ISDPnlZXRCg4-gaoMc2w","elapsed":0},"data":{"buckets":[]}} + string: '{"meta":{"status":"done","request_id":"pddv1ChZiX1d1RWNfM1JuaURhSkJ6elFsRHpnIi0KHQJFlSKZaC6T1BR15cquEEJdzvJ8iKfJO5Kr37vkEgyJYfau6iiq_M5ftbo","elapsed":0},"data":{"buckets":[]}} ' headers: diff --git a/examples/v1/monitors/ValidateExistingMonitor.rb b/examples/v1/monitors/ValidateExistingMonitor.rb index b37bc94fa129..09f943e13ee2 100644 --- a/examples/v1/monitors/ValidateExistingMonitor.rb +++ b/examples/v1/monitors/ValidateExistingMonitor.rb @@ -27,6 +27,7 @@ no_data_timeframe: nil, notify_audit: false, notify_no_data: false, + on_missing_data: DatadogAPIClient::V1::OnMissingDataOption::SHOW_AND_NOTIFY_NO_DATA, renotify_interval: 60, require_full_window: true, timeout_h: 24, diff --git a/examples/v1/monitors/ValidateMonitor.rb b/examples/v1/monitors/ValidateMonitor.rb index cb52c78e2065..ceb5146e3616 100644 --- a/examples/v1/monitors/ValidateMonitor.rb +++ b/examples/v1/monitors/ValidateMonitor.rb @@ -24,6 +24,7 @@ no_data_timeframe: nil, notify_audit: false, notify_no_data: false, + on_missing_data: DatadogAPIClient::V1::OnMissingDataOption::SHOW_AND_NOTIFY_NO_DATA, renotify_interval: 60, require_full_window: true, timeout_h: 24, diff --git a/examples/v1/monitors/ValidateMonitor_4247196452.rb b/examples/v1/monitors/ValidateMonitor_4247196452.rb new file mode 100644 index 000000000000..e636815fc451 --- /dev/null +++ b/examples/v1/monitors/ValidateMonitor_4247196452.rb @@ -0,0 +1,38 @@ +# Validate a multi-alert monitor returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::MonitorsAPI.new + +body = DatadogAPIClient::V1::Monitor.new({ + name: "Example-Validate_a_multi_alert_monitor_returns_OK_response", + type: DatadogAPIClient::V1::MonitorType::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: DatadogAPIClient::V1::MonitorOptions.new({ + 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: nil, + notify_audit: false, + notify_no_data: false, + on_missing_data: DatadogAPIClient::V1::OnMissingDataOption::SHOW_AND_NOTIFY_NO_DATA, + renotify_interval: 60, + require_full_window: true, + timeout_h: 24, + thresholds: DatadogAPIClient::V1::MonitorThresholds.new({ + critical: 2, + warning: 1, + }), + }), +}) +p api_instance.validate_monitor(body) 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/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index ad1ebc773bbe..0987a68ec723 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -340,6 +340,7 @@ def overrides "v1.notebook_update_request" => "NotebookUpdateRequest", "v1.note_widget_definition" => "NoteWidgetDefinition", "v1.note_widget_definition_type" => "NoteWidgetDefinitionType", + "v1.on_missing_data_option" => "OnMissingDataOption", "v1.organization" => "Organization", "v1.organization_billing" => "OrganizationBilling", "v1.organization_create_body" => "OrganizationCreateBody", diff --git a/lib/datadog_api_client/v1/models/monitor_options.rb b/lib/datadog_api_client/v1/models/monitor_options.rb index 4f12ba13fd73..d2726cc2a5ec 100644 --- a/lib/datadog_api_client/v1/models/monitor_options.rb +++ b/lib/datadog_api_client/v1/models/monitor_options.rb @@ -45,6 +45,12 @@ class MonitorOptions # This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor always has data during evaluation. attr_accessor :evaluation_delay + # 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. + attr_accessor :group_retention_duration + # Whether the log alert monitor triggers a single alert or multiple alerts when any group breaches a threshold. attr_accessor :groupby_simple_monitor @@ -91,6 +97,13 @@ class MonitorOptions # A Boolean indicating whether this monitor notifies when data stops reporting. attr_accessor :notify_no_data + # 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. + attr_accessor :on_missing_data + # 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. attr_accessor :renotify_interval @@ -133,6 +146,7 @@ def self.attribute_map :'enable_logs_sample' => :'enable_logs_sample', :'escalation_message' => :'escalation_message', :'evaluation_delay' => :'evaluation_delay', + :'group_retention_duration' => :'group_retention_duration', :'groupby_simple_monitor' => :'groupby_simple_monitor', :'include_tags' => :'include_tags', :'locked' => :'locked', @@ -143,6 +157,7 @@ def self.attribute_map :'no_data_timeframe' => :'no_data_timeframe', :'notify_audit' => :'notify_audit', :'notify_no_data' => :'notify_no_data', + :'on_missing_data' => :'on_missing_data', :'renotify_interval' => :'renotify_interval', :'renotify_occurrences' => :'renotify_occurrences', :'renotify_statuses' => :'renotify_statuses', @@ -171,6 +186,7 @@ def self.openapi_types :'enable_logs_sample' => :'Boolean', :'escalation_message' => :'String', :'evaluation_delay' => :'Integer', + :'group_retention_duration' => :'String', :'groupby_simple_monitor' => :'Boolean', :'include_tags' => :'Boolean', :'locked' => :'Boolean', @@ -181,6 +197,7 @@ def self.openapi_types :'no_data_timeframe' => :'Integer', :'notify_audit' => :'Boolean', :'notify_no_data' => :'Boolean', + :'on_missing_data' => :'OnMissingDataOption', :'renotify_interval' => :'Integer', :'renotify_occurrences' => :'Integer', :'renotify_statuses' => :'Array', @@ -252,6 +269,10 @@ def initialize(attributes = {}) self.evaluation_delay = attributes[:'evaluation_delay'] end + if attributes.key?(:'group_retention_duration') + self.group_retention_duration = attributes[:'group_retention_duration'] + end + if attributes.key?(:'groupby_simple_monitor') self.groupby_simple_monitor = attributes[:'groupby_simple_monitor'] end @@ -304,6 +325,10 @@ def initialize(attributes = {}) self.notify_no_data = false end + if attributes.key?(:'on_missing_data') + self.on_missing_data = attributes[:'on_missing_data'] + end + if attributes.key?(:'renotify_interval') self.renotify_interval = attributes[:'renotify_interval'] end @@ -382,6 +407,7 @@ def ==(o) enable_logs_sample == o.enable_logs_sample && escalation_message == o.escalation_message && evaluation_delay == o.evaluation_delay && + group_retention_duration == o.group_retention_duration && groupby_simple_monitor == o.groupby_simple_monitor && include_tags == o.include_tags && locked == o.locked && @@ -392,6 +418,7 @@ def ==(o) no_data_timeframe == o.no_data_timeframe && notify_audit == o.notify_audit && notify_no_data == o.notify_no_data && + on_missing_data == o.on_missing_data && renotify_interval == o.renotify_interval && renotify_occurrences == o.renotify_occurrences && renotify_statuses == o.renotify_statuses && @@ -415,7 +442,7 @@ def eql?(o) # @return [Integer] Hash code # @!visibility private def hash - [aggregation, device_ids, enable_logs_sample, escalation_message, evaluation_delay, groupby_simple_monitor, include_tags, locked, min_failure_duration, min_location_failed, new_group_delay, new_host_delay, no_data_timeframe, notify_audit, notify_no_data, renotify_interval, renotify_occurrences, renotify_statuses, require_full_window, silenced, synthetics_check_id, threshold_windows, thresholds, timeout_h, variables].hash + [aggregation, device_ids, enable_logs_sample, escalation_message, evaluation_delay, group_retention_duration, groupby_simple_monitor, include_tags, locked, min_failure_duration, min_location_failed, new_group_delay, new_host_delay, no_data_timeframe, notify_audit, notify_no_data, on_missing_data, renotify_interval, renotify_occurrences, renotify_statuses, require_full_window, silenced, synthetics_check_id, threshold_windows, thresholds, timeout_h, variables].hash end end end diff --git a/lib/datadog_api_client/v1/models/on_missing_data_option.rb b/lib/datadog_api_client/v1/models/on_missing_data_option.rb new file mode 100644 index 000000000000..fe57edddec3a --- /dev/null +++ b/lib/datadog_api_client/v1/models/on_missing_data_option.rb @@ -0,0 +1,33 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # 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. + class OnMissingDataOption + include BaseEnumModel + + DEFAULT = "default".freeze + SHOW_NO_DATA = "show_no_data".freeze + SHOW_AND_NOTIFY_NO_DATA = "show_and_notify_no_data".freeze + RESOLVE = "resolve".freeze + end +end