diff --git a/.apigentools-info b/.apigentools-info index 4cec3f15e2a..675f4f2e822 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.203861", - "spec_repo_commit": "a957cd49" + "regenerated": "2022-08-17 17:26:24.674756", + "spec_repo_commit": "57b75ade" }, "v2": { "apigentools_version": "1.6.2", - "regenerated": "2022-08-17 14:32:13.215885", - "spec_repo_commit": "a957cd49" + "regenerated": "2022-08-17 17:26:24.687659", + "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 4b7b6e4cc8b..80bb9c42d84 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/examples/v1/monitors/ValidateExistingMonitor.java b/examples/v1/monitors/ValidateExistingMonitor.java index 33682bee84f..73e513c4752 100644 --- a/examples/v1/monitors/ValidateExistingMonitor.java +++ b/examples/v1/monitors/ValidateExistingMonitor.java @@ -7,6 +7,7 @@ import com.datadog.api.client.v1.model.MonitorOptions; import com.datadog.api.client.v1.model.MonitorThresholds; import com.datadog.api.client.v1.model.MonitorType; +import com.datadog.api.client.v1.model.OnMissingDataOption; import java.util.Arrays; public class Example { @@ -40,6 +41,7 @@ public static void main(String[] args) { .noDataTimeframe(null) .notifyAudit(false) .notifyNoData(false) + .onMissingData(OnMissingDataOption.SHOW_AND_NOTIFY_NO_DATA) .renotifyInterval(60L) .requireFullWindow(true) .timeoutH(24L) diff --git a/examples/v1/monitors/ValidateMonitor.java b/examples/v1/monitors/ValidateMonitor.java index 58cd46e05dd..1452df359c0 100644 --- a/examples/v1/monitors/ValidateMonitor.java +++ b/examples/v1/monitors/ValidateMonitor.java @@ -7,6 +7,7 @@ import com.datadog.api.client.v1.model.MonitorOptions; import com.datadog.api.client.v1.model.MonitorThresholds; import com.datadog.api.client.v1.model.MonitorType; +import com.datadog.api.client.v1.model.OnMissingDataOption; import java.util.Arrays; public class Example { @@ -37,6 +38,7 @@ public static void main(String[] args) { .noDataTimeframe(null) .notifyAudit(false) .notifyNoData(false) + .onMissingData(OnMissingDataOption.SHOW_AND_NOTIFY_NO_DATA) .renotifyInterval(60L) .requireFullWindow(true) .timeoutH(24L) diff --git a/examples/v1/monitors/ValidateMonitor_4247196452.java b/examples/v1/monitors/ValidateMonitor_4247196452.java new file mode 100644 index 00000000000..f4b445a154c --- /dev/null +++ b/examples/v1/monitors/ValidateMonitor_4247196452.java @@ -0,0 +1,59 @@ +// Validate a multi-alert monitor returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v1.api.MonitorsApi; +import com.datadog.api.client.v1.model.Monitor; +import com.datadog.api.client.v1.model.MonitorOptions; +import com.datadog.api.client.v1.model.MonitorThresholds; +import com.datadog.api.client.v1.model.MonitorType; +import com.datadog.api.client.v1.model.OnMissingDataOption; +import java.util.Arrays; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + MonitorsApi apiInstance = new MonitorsApi(defaultClient); + + Monitor body = + new Monitor() + .name("Example-Validate_a_multi_alert_monitor_returns_OK_response") + .type(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( + Arrays.asList("test:examplevalidateamultialertmonitorreturnsokresponse", "env:ci")) + .priority(3L) + .options( + new MonitorOptions() + .enableLogsSample(true) + .escalationMessage("the situation has escalated") + .evaluationDelay(700L) + .groupRetentionDuration("2d") + .groupbySimpleMonitor(false) + .includeTags(true) + .locked(false) + .newHostDelay(600L) + .noDataTimeframe(null) + .notifyAudit(false) + .notifyNoData(false) + .onMissingData(OnMissingDataOption.SHOW_AND_NOTIFY_NO_DATA) + .renotifyInterval(60L) + .requireFullWindow(true) + .timeoutH(24L) + .thresholds(new MonitorThresholds().critical(2.0).warning(1.0))); + + try { + apiInstance.validateMonitor(body); + } catch (ApiException e) { + System.err.println("Exception when calling MonitorsApi#validateMonitor"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/MonitorOptions.java b/src/main/java/com/datadog/api/client/v1/model/MonitorOptions.java index e8fac476ff7..e68e63e4bb2 100644 --- a/src/main/java/com/datadog/api/client/v1/model/MonitorOptions.java +++ b/src/main/java/com/datadog/api/client/v1/model/MonitorOptions.java @@ -24,6 +24,7 @@ MonitorOptions.JSON_PROPERTY_ENABLE_LOGS_SAMPLE, MonitorOptions.JSON_PROPERTY_ESCALATION_MESSAGE, MonitorOptions.JSON_PROPERTY_EVALUATION_DELAY, + MonitorOptions.JSON_PROPERTY_GROUP_RETENTION_DURATION, MonitorOptions.JSON_PROPERTY_GROUPBY_SIMPLE_MONITOR, MonitorOptions.JSON_PROPERTY_INCLUDE_TAGS, MonitorOptions.JSON_PROPERTY_LOCKED, @@ -34,6 +35,7 @@ MonitorOptions.JSON_PROPERTY_NO_DATA_TIMEFRAME, MonitorOptions.JSON_PROPERTY_NOTIFY_AUDIT, MonitorOptions.JSON_PROPERTY_NOTIFY_NO_DATA, + MonitorOptions.JSON_PROPERTY_ON_MISSING_DATA, MonitorOptions.JSON_PROPERTY_RENOTIFY_INTERVAL, MonitorOptions.JSON_PROPERTY_RENOTIFY_OCCURRENCES, MonitorOptions.JSON_PROPERTY_RENOTIFY_STATUSES, @@ -64,6 +66,9 @@ public class MonitorOptions { public static final String JSON_PROPERTY_EVALUATION_DELAY = "evaluation_delay"; private JsonNullable evaluationDelay = JsonNullable.undefined(); + public static final String JSON_PROPERTY_GROUP_RETENTION_DURATION = "group_retention_duration"; + private String groupRetentionDuration; + public static final String JSON_PROPERTY_GROUPBY_SIMPLE_MONITOR = "groupby_simple_monitor"; private Boolean groupbySimpleMonitor; @@ -94,6 +99,9 @@ public class MonitorOptions { public static final String JSON_PROPERTY_NOTIFY_NO_DATA = "notify_no_data"; private Boolean notifyNoData = false; + public static final String JSON_PROPERTY_ON_MISSING_DATA = "on_missing_data"; + private OnMissingDataOption onMissingData; + public static final String JSON_PROPERTY_RENOTIFY_INTERVAL = "renotify_interval"; private JsonNullable renotifyInterval = JsonNullable.undefined(); @@ -231,6 +239,30 @@ public void setEvaluationDelay(Long evaluationDelay) { this.evaluationDelay = JsonNullable.of(evaluationDelay); } + public MonitorOptions groupRetentionDuration(String groupRetentionDuration) { + this.groupRetentionDuration = groupRetentionDuration; + return this; + } + + /** + * 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. + * + * @return groupRetentionDuration + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GROUP_RETENTION_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getGroupRetentionDuration() { + return groupRetentionDuration; + } + + public void setGroupRetentionDuration(String groupRetentionDuration) { + this.groupRetentionDuration = groupRetentionDuration; + } + public MonitorOptions groupbySimpleMonitor(Boolean groupbySimpleMonitor) { this.groupbySimpleMonitor = groupbySimpleMonitor; return this; @@ -515,6 +547,36 @@ public void setNotifyNoData(Boolean notifyNoData) { this.notifyNoData = notifyNoData; } + public MonitorOptions onMissingData(OnMissingDataOption onMissingData) { + this.onMissingData = onMissingData; + this.unparsed |= !onMissingData.isValid(); + return this; + } + + /** + * 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. + * + * @return onMissingData + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ON_MISSING_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnMissingDataOption getOnMissingData() { + return onMissingData; + } + + public void setOnMissingData(OnMissingDataOption onMissingData) { + if (!onMissingData.isValid()) { + this.unparsed = true; + } + this.onMissingData = onMissingData; + } + public MonitorOptions renotifyInterval(Long renotifyInterval) { this.renotifyInterval = JsonNullable.of(renotifyInterval); return this; @@ -835,6 +897,7 @@ public boolean equals(Object o) { && Objects.equals(this.enableLogsSample, monitorOptions.enableLogsSample) && Objects.equals(this.escalationMessage, monitorOptions.escalationMessage) && Objects.equals(this.evaluationDelay, monitorOptions.evaluationDelay) + && Objects.equals(this.groupRetentionDuration, monitorOptions.groupRetentionDuration) && Objects.equals(this.groupbySimpleMonitor, monitorOptions.groupbySimpleMonitor) && Objects.equals(this.includeTags, monitorOptions.includeTags) && Objects.equals(this.locked, monitorOptions.locked) @@ -845,6 +908,7 @@ public boolean equals(Object o) { && Objects.equals(this.noDataTimeframe, monitorOptions.noDataTimeframe) && Objects.equals(this.notifyAudit, monitorOptions.notifyAudit) && Objects.equals(this.notifyNoData, monitorOptions.notifyNoData) + && Objects.equals(this.onMissingData, monitorOptions.onMissingData) && Objects.equals(this.renotifyInterval, monitorOptions.renotifyInterval) && Objects.equals(this.renotifyOccurrences, monitorOptions.renotifyOccurrences) && Objects.equals(this.renotifyStatuses, monitorOptions.renotifyStatuses) @@ -865,6 +929,7 @@ public int hashCode() { enableLogsSample, escalationMessage, evaluationDelay, + groupRetentionDuration, groupbySimpleMonitor, includeTags, locked, @@ -875,6 +940,7 @@ public int hashCode() { noDataTimeframe, notifyAudit, notifyNoData, + onMissingData, renotifyInterval, renotifyOccurrences, renotifyStatuses, @@ -896,6 +962,9 @@ public String toString() { sb.append(" enableLogsSample: ").append(toIndentedString(enableLogsSample)).append("\n"); sb.append(" escalationMessage: ").append(toIndentedString(escalationMessage)).append("\n"); sb.append(" evaluationDelay: ").append(toIndentedString(evaluationDelay)).append("\n"); + sb.append(" groupRetentionDuration: ") + .append(toIndentedString(groupRetentionDuration)) + .append("\n"); sb.append(" groupbySimpleMonitor: ") .append(toIndentedString(groupbySimpleMonitor)) .append("\n"); @@ -908,6 +977,7 @@ public String toString() { sb.append(" noDataTimeframe: ").append(toIndentedString(noDataTimeframe)).append("\n"); sb.append(" notifyAudit: ").append(toIndentedString(notifyAudit)).append("\n"); sb.append(" notifyNoData: ").append(toIndentedString(notifyNoData)).append("\n"); + sb.append(" onMissingData: ").append(toIndentedString(onMissingData)).append("\n"); sb.append(" renotifyInterval: ").append(toIndentedString(renotifyInterval)).append("\n"); sb.append(" renotifyOccurrences: ") .append(toIndentedString(renotifyOccurrences)) diff --git a/src/main/java/com/datadog/api/client/v1/model/OnMissingDataOption.java b/src/main/java/com/datadog/api/client/v1/model/OnMissingDataOption.java new file mode 100644 index 00000000000..a9f8bfe67a0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/OnMissingDataOption.java @@ -0,0 +1,105 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +/** + * 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. + */ +@JsonSerialize(using = OnMissingDataOption.OnMissingDataOptionSerializer.class) +public class OnMissingDataOption { + + public static final OnMissingDataOption DEFAULT = new OnMissingDataOption("default"); + public static final OnMissingDataOption SHOW_NO_DATA = new OnMissingDataOption("show_no_data"); + public static final OnMissingDataOption SHOW_AND_NOTIFY_NO_DATA = + new OnMissingDataOption("show_and_notify_no_data"); + public static final OnMissingDataOption RESOLVE = new OnMissingDataOption("resolve"); + + private static final Set allowedValues = + new HashSet( + Arrays.asList("default", "show_no_data", "show_and_notify_no_data", "resolve")); + + private String value; + + public boolean isValid() { + return allowedValues.contains(this.value); + } + + OnMissingDataOption(String value) { + this.value = value; + } + + public static class OnMissingDataOptionSerializer extends StdSerializer { + public OnMissingDataOptionSerializer(Class t) { + super(t); + } + + public OnMissingDataOptionSerializer() { + this(null); + } + + @Override + public void serialize( + OnMissingDataOption value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonValue + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + /** Return true if this OnMissingDataOption object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return this.value.equals(((OnMissingDataOption) o).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OnMissingDataOption fromValue(String value) { + return new OnMissingDataOption(value); + } +} diff --git a/src/test/resources/cassettes/features/v1/Check_if_a_monitor_can_be_deleted_returns_OK_response.freeze b/src/test/resources/cassettes/features/v1/Check_if_a_monitor_can_be_deleted_returns_OK_response.freeze index 9b01e21217b..b165b3a5b4a 100644 --- a/src/test/resources/cassettes/features/v1/Check_if_a_monitor_can_be_deleted_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v1/Check_if_a_monitor_can_be_deleted_returns_OK_response.freeze @@ -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/src/test/resources/cassettes/features/v1/Check_if_a_monitor_can_be_deleted_returns_OK_response.json b/src/test/resources/cassettes/features/v1/Check_if_a_monitor_can_be_deleted_returns_OK_response.json index 9fc79c51168..3b63e70f1ff 100644 --- a/src/test/resources/cassettes/features/v1/Check_if_a_monitor_can_be_deleted_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v1/Check_if_a_monitor_can_be_deleted_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}" + "json": "{\"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\"}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"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}}}", + "body": "{\"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}}}", "headers": { "Content-Type": [ "application/json" @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "c62afe43-e0c0-efc0-9315-7de7c6464021" + "id": "d89dee70-e7d3-e0a6-021a-12b53742741e" }, { "httpRequest": { @@ -36,14 +36,14 @@ "path": "/api/v1/monitor/can_delete", "queryStringParameters": { "monitor_ids": [ - "59800600" + "80119046" ] }, "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"errors\":null,\"data\":{\"ok\":[59800600]}}", + "body": "{\"errors\":null,\"data\":{\"ok\":[80119046]}}", "headers": { "Content-Type": [ "application/json" @@ -58,18 +58,18 @@ "timeToLive": { "unlimited": true }, - "id": "fe344255-bf6b-8def-0a23-b6ae74c24586" + "id": "7e410f7c-a320-8819-f64d-c5a45299f06f" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v1/monitor/59800600", + "path": "/api/v1/monitor/80119046", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"deleted_monitor_id\":59800600}", + "body": "{\"deleted_monitor_id\":80119046}", "headers": { "Content-Type": [ "application/json" @@ -84,6 +84,6 @@ "timeToLive": { "unlimited": true }, - "id": "3a6a1335-8700-460e-93d9-c7aee92aa65c" + "id": "87e1c1ce-8143-abbc-36f2-352e3eef152c" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_graph_widget.freeze b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_graph_widget.freeze index 3687f840e80..c0ddecaf79b 100644 --- a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_graph_widget.freeze +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_graph_widget.freeze @@ -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/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_graph_widget.json b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_graph_widget.json index 1d043e0ba12..7ef9bba0e03 100644 --- a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_graph_widget.json +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_graph_widget.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}" + "json": "{\"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\"}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"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}}}", + "body": "{\"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}}}", "headers": { "Content-Type": [ "application/json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "9daa1fe9-bbb9-2cc6-c9ae-1a9b8e555681" + "id": "b0a9c66c-afab-f0db-4cfc-10c90e5ac287" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"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}}]}" + "json": "{\"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": {}, "method": "POST", @@ -42,7 +42,7 @@ "secure": true }, "httpResponse": { - "body": "{\"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\"}", + "body": "{\"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", "headers": { "Content-Type": [ "application/json" @@ -57,18 +57,18 @@ "timeToLive": { "unlimited": true }, - "id": "8c06b025-a7c8-4aa7-0a88-624ea6a1e24f" + "id": "4a191566-f87a-e16b-08bd-48fb4aca41be" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v1/dashboard/m8v-aud-r6a", + "path": "/api/v1/dashboard/shb-j47-ek7", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"deleted_dashboard_id\":\"m8v-aud-r6a\"}", + "body": "{\"deleted_dashboard_id\":\"shb-j47-ek7\"}\n", "headers": { "Content-Type": [ "application/json" @@ -83,18 +83,18 @@ "timeToLive": { "unlimited": true }, - "id": "137dc0c2-2b92-7d20-fa4b-2c3fc5485cfe" + "id": "81408bf1-6466-61a7-c071-8571684a1c33" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v1/monitor/59800315", + "path": "/api/v1/monitor/80119038", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"deleted_monitor_id\":59800315}", + "body": "{\"deleted_monitor_id\":80119038}", "headers": { "Content-Type": [ "application/json" @@ -109,6 +109,6 @@ "timeToLive": { "unlimited": true }, - "id": "2e8022d5-92ce-6876-a92c-758a74636eb5" + "id": "9c155f49-b83e-d265-40e7-c3f232710712" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_value_widget.freeze b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_value_widget.freeze index e47ddcc9d37..267dbec4b1f 100644 --- a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_value_widget.freeze +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_value_widget.freeze @@ -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/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_value_widget.json b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_value_widget.json index 27808560cce..c7bd0e0a96a 100644 --- a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_value_widget.json +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_alert_value_widget.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}" + "json": "{\"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\"}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"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}}}", + "body": "{\"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}}}", "headers": { "Content-Type": [ "application/json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "2bcf3238-7b13-71c1-a1a5-a74b12fa6776" + "id": "53f6590d-ca9f-af17-7292-2e226a6f424b" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"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}}]}" + "json": "{\"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": {}, "method": "POST", @@ -42,7 +42,7 @@ "secure": true }, "httpResponse": { - "body": "{\"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\"}", + "body": "{\"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", "headers": { "Content-Type": [ "application/json" @@ -57,18 +57,18 @@ "timeToLive": { "unlimited": true }, - "id": "aa521148-bd6a-403d-6946-4774eb47dcfd" + "id": "2bd13571-b27d-506a-570b-a8077a8ae673" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v1/dashboard/mku-sdw-4ht", + "path": "/api/v1/dashboard/p6f-bg6-nct", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"deleted_dashboard_id\":\"mku-sdw-4ht\"}", + "body": "{\"deleted_dashboard_id\":\"p6f-bg6-nct\"}\n", "headers": { "Content-Type": [ "application/json" @@ -83,18 +83,18 @@ "timeToLive": { "unlimited": true }, - "id": "b3b0f519-d777-bd57-b430-2eebcbb57d92" + "id": "9528cd8f-3336-9c7c-ef26-2e6fd4655e79" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v1/monitor/59800326", + "path": "/api/v1/monitor/80119041", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"deleted_monitor_id\":59800326}", + "body": "{\"deleted_monitor_id\":80119041}", "headers": { "Content-Type": [ "application/json" @@ -109,6 +109,6 @@ "timeToLive": { "unlimited": true }, - "id": "06088a94-914f-d95c-719a-13af52b13813" + "id": "5200c626-3ba4-32c6-b1d9-10ff80257bef" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Delete_a_monitor_returns_OK_response.freeze b/src/test/resources/cassettes/features/v1/Delete_a_monitor_returns_OK_response.freeze index ec882ea9bf2..d3b39509bd5 100644 --- a/src/test/resources/cassettes/features/v1/Delete_a_monitor_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v1/Delete_a_monitor_returns_OK_response.freeze @@ -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/src/test/resources/cassettes/features/v1/Delete_a_monitor_returns_OK_response.json b/src/test/resources/cassettes/features/v1/Delete_a_monitor_returns_OK_response.json index cbc0bfe1907..341dd86fb2e 100644 --- a/src/test/resources/cassettes/features/v1/Delete_a_monitor_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v1/Delete_a_monitor_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}" + "json": "{\"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\"}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"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}}}", + "body": "{\"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}}}", "headers": { "Content-Type": [ "application/json" @@ -27,18 +27,18 @@ "timeToLive": { "unlimited": true }, - "id": "2e9454b1-7359-d825-e98d-252cf0903230" + "id": "4638c4cc-0bab-4ba2-1e9a-2a424793bf48" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v1/monitor/59800638", + "path": "/api/v1/monitor/80119048", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"deleted_monitor_id\":59800638}", + "body": "{\"deleted_monitor_id\":80119048}", "headers": { "Content-Type": [ "application/json" @@ -53,18 +53,18 @@ "timeToLive": { "unlimited": true }, - "id": "12eeb040-c4a7-5e07-84b6-fdf2622e3c69" + "id": "8470ec01-da8f-2a2b-4ab4-6ee87a177b43" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v1/monitor/59800638", + "path": "/api/v1/monitor/80119048", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"errors\":[\"Monitor not found\"]}", + "body": "{\"errors\": [\"Monitor not found\"]}", "headers": { "Content-Type": [ "application/json" @@ -79,6 +79,6 @@ "timeToLive": { "unlimited": true }, - "id": "12eeb040-c4a7-5e07-84b6-fdf2622e3c6a" + "id": "8470ec01-da8f-2a2b-4ab4-6ee87a177b44" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Edit_a_monitor_returns_OK_response.freeze b/src/test/resources/cassettes/features/v1/Edit_a_monitor_returns_OK_response.freeze index fb6416ff42f..83745073ab6 100644 --- a/src/test/resources/cassettes/features/v1/Edit_a_monitor_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v1/Edit_a_monitor_returns_OK_response.freeze @@ -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/src/test/resources/cassettes/features/v1/Edit_a_monitor_returns_OK_response.json b/src/test/resources/cassettes/features/v1/Edit_a_monitor_returns_OK_response.json index e3d4e0c8d49..0a59c154edb 100644 --- a/src/test/resources/cassettes/features/v1/Edit_a_monitor_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v1/Edit_a_monitor_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}" + "json": "{\"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\"}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"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}}}", + "body": "{\"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}}}", "headers": { "Content-Type": [ "application/json" @@ -27,22 +27,22 @@ "timeToLive": { "unlimited": true }, - "id": "8811833a-79d6-1349-7d5d-21ad4b01114d" + "id": "c34b8e9b-53d1-f148-5862-dc98a16e980b" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"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}}" + "json": "{\"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": {}, "method": "PUT", - "path": "/api/v1/monitor/59800649", + "path": "/api/v1/monitor/80119050", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"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}}", + "body": "{\"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}}", "headers": { "Content-Type": [ "application/json" @@ -57,18 +57,18 @@ "timeToLive": { "unlimited": true }, - "id": "aa46a6b5-d3a7-0437-d33b-9281973f43dd" + "id": "fdee9303-8f8f-1c4c-d7bd-cb68b846deb2" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v1/monitor/59800649", + "path": "/api/v1/monitor/80119050", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"deleted_monitor_id\":59800649}", + "body": "{\"deleted_monitor_id\":80119050}", "headers": { "Content-Type": [ "application/json" @@ -83,6 +83,6 @@ "timeToLive": { "unlimited": true }, - "id": "1711b14a-ec98-f10e-c6ff-68893aa47923" + "id": "0f239d3b-cef6-e294-8596-4f185f20b570" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Get_a_monitor_s_details_returns_OK_response.freeze b/src/test/resources/cassettes/features/v1/Get_a_monitor_s_details_returns_OK_response.freeze index c5b3785f381..b6732ba5e66 100644 --- a/src/test/resources/cassettes/features/v1/Get_a_monitor_s_details_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v1/Get_a_monitor_s_details_returns_OK_response.freeze @@ -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/src/test/resources/cassettes/features/v1/Get_a_monitor_s_details_returns_OK_response.json b/src/test/resources/cassettes/features/v1/Get_a_monitor_s_details_returns_OK_response.json index 7267dfab779..7e81d0b1289 100644 --- a/src/test/resources/cassettes/features/v1/Get_a_monitor_s_details_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v1/Get_a_monitor_s_details_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}" + "json": "{\"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\"}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"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}}}", + "body": "{\"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}}}", "headers": { "Content-Type": [ "application/json" @@ -27,18 +27,18 @@ "timeToLive": { "unlimited": true }, - "id": "9824f9d2-7532-edf5-2d53-f7392ae7e781" + "id": "a73b8364-6789-4c5e-1cc6-31b56d24eafc" }, { "httpRequest": { "headers": {}, "method": "GET", - "path": "/api/v1/monitor/59800662", + "path": "/api/v1/monitor/80119052", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"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}}}", + "body": "{\"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}}}", "headers": { "Content-Type": [ "application/json" @@ -53,18 +53,18 @@ "timeToLive": { "unlimited": true }, - "id": "ed586f02-72de-866a-f798-4318ac9ec07b" + "id": "566782f8-7e4f-cd39-019b-59725e605edd" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v1/monitor/59800662", + "path": "/api/v1/monitor/80119052", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"deleted_monitor_id\":59800662}", + "body": "{\"deleted_monitor_id\":80119052}", "headers": { "Content-Type": [ "application/json" @@ -79,6 +79,6 @@ "timeToLive": { "unlimited": true }, - "id": "b0b53ae5-ab45-981f-90a5-c50eced970c4" + "id": "7da5febb-fb7a-392a-bab1-daa1f274ec3b" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_deserializes_successfully.json b/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_deserializes_successfully.json index 948b957a7c4..140a99e4753 100644 --- a/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_deserializes_successfully.json +++ b/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_deserializes_successfully.json @@ -28,6 +28,6 @@ "timeToLive": { "unlimited": true }, - "id": "d5bade64-6ebb-4f4d-903d-8069b52bb31d" + "id": "d5bade64-6ebb-4f4d-903d-8069b52bb31e" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_for_your_organization_returns_OK_response.json b/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_for_your_organization_returns_OK_response.json index e94edfb7099..91c8275f382 100644 --- a/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_for_your_organization_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_for_your_organization_returns_OK_response.json @@ -28,6 +28,6 @@ "timeToLive": { "unlimited": true }, - "id": "d5bade64-6ebb-4f4d-903d-8069b52bb31e" + "id": "d5bade64-6ebb-4f4d-903d-8069b52bb31d" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Schedule_a_monitor_downtime_returns_OK_response.freeze b/src/test/resources/cassettes/features/v1/Schedule_a_monitor_downtime_returns_OK_response.freeze index 59653149d3e..41c63c0f85c 100644 --- a/src/test/resources/cassettes/features/v1/Schedule_a_monitor_downtime_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v1/Schedule_a_monitor_downtime_returns_OK_response.freeze @@ -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/src/test/resources/cassettes/features/v1/Schedule_a_monitor_downtime_returns_OK_response.json b/src/test/resources/cassettes/features/v1/Schedule_a_monitor_downtime_returns_OK_response.json index 254974c7a8d..08c9560e49f 100644 --- a/src/test/resources/cassettes/features/v1/Schedule_a_monitor_downtime_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v1/Schedule_a_monitor_downtime_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}" + "json": "{\"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\"}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"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}}}", + "body": "{\"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}}}", "headers": { "Content-Type": [ "application/json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "ea2932cf-fb18-4019-0e4f-5e8851566922" + "id": "71c52e89-126a-931c-6e80-3e616930512c" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"message\":\"Test-Schedule_a_monitor_downtime_returns_OK_response-1652349001\",\"monitor_id\":71310133,\"scope\":[\"test:testscheduleamonitordowntimereturnsokresponse1652349001\"],\"start\":1652349001,\"timezone\":\"Etc/UTC\"}" + "json": "{\"message\":\"Test-Schedule_a_monitor_downtime_returns_OK_response-1660586679\",\"monitor_id\":80119043,\"scope\":[\"test:testscheduleamonitordowntimereturnsokresponse1660586679\"],\"start\":1660586679,\"timezone\":\"Etc/UTC\"}" }, "headers": {}, "method": "POST", @@ -42,7 +42,7 @@ "secure": true }, "httpResponse": { - "body": "{\"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}", + "body": "{\"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" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "b0f76ed1-0793-c97f-d0f6-639d6ea9cb2e" + "id": "1b859970-ed83-ecd4-b17a-2b6c5d61f213" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v1/downtime/1944162322", + "path": "/api/v1/downtime/2164108453", "keepAlive": false, "secure": true }, @@ -78,18 +78,18 @@ "timeToLive": { "unlimited": true }, - "id": "495dce5b-d753-3c29-ec60-f74b3710aff8" + "id": "052aced9-dc2f-233f-053a-e1cdcac623e4" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v1/monitor/71310133", + "path": "/api/v1/monitor/80119043", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"deleted_monitor_id\":71310133}", + "body": "{\"deleted_monitor_id\":80119043}", "headers": { "Content-Type": [ "application/json" @@ -104,6 +104,6 @@ "timeToLive": { "unlimited": true }, - "id": "e3f3d003-158f-73ad-d591-c27a17af3fb8" + "id": "56680ef6-df30-cdc7-b409-2fece1eb6b1c" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Validate_a_monitor_returns_OK_response.freeze b/src/test/resources/cassettes/features/v1/Validate_a_monitor_returns_OK_response.freeze index 70edc113c5f..7fe3052c09e 100644 --- a/src/test/resources/cassettes/features/v1/Validate_a_monitor_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v1/Validate_a_monitor_returns_OK_response.freeze @@ -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/src/test/resources/cassettes/features/v1/Validate_a_monitor_returns_OK_response.json b/src/test/resources/cassettes/features/v1/Validate_a_monitor_returns_OK_response.json index 8157b00b89a..7874d74744f 100644 --- a/src/test/resources/cassettes/features/v1/Validate_a_monitor_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v1/Validate_a_monitor_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}" + "json": "{\"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\"}" }, "headers": {}, "method": "POST", @@ -27,6 +27,6 @@ "timeToLive": { "unlimited": true }, - "id": "821e10d3-ade3-e095-401a-908837ef5b9f" + "id": "68177ea6-5335-71c8-1e8e-501e8006c671" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Validate_a_multi_alert_monitor_returns_OK_response.freeze b/src/test/resources/cassettes/features/v1/Validate_a_multi_alert_monitor_returns_OK_response.freeze new file mode 100644 index 00000000000..11fb4a7dead --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Validate_a_multi_alert_monitor_returns_OK_response.freeze @@ -0,0 +1 @@ +2022-08-15T18:04:46.756Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Validate_a_multi_alert_monitor_returns_OK_response.json b/src/test/resources/cassettes/features/v1/Validate_a_multi_alert_monitor_returns_OK_response.json new file mode 100644 index 00000000000..0a83c55e431 --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Validate_a_multi_alert_monitor_returns_OK_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "POST", + "path": "/api/v1/monitor/validate", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e34971e4-a97d-76f7-2fa0-a6f1ecf342e2" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_Invalid_JSON_response.freeze b/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_Invalid_JSON_response.freeze index f7fccb4c385..195601087b6 100644 --- a/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_Invalid_JSON_response.freeze +++ b/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_Invalid_JSON_response.freeze @@ -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/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_Invalid_JSON_response.json b/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_Invalid_JSON_response.json index 18b67254673..830d56e19bb 100644 --- a/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_Invalid_JSON_response.json +++ b/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_Invalid_JSON_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}" + "json": "{\"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\"}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"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}}}", + "body": "{\"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}}}", "headers": { "Content-Type": [ "application/json" @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "722cecdd-779e-5997-d507-cee4e27cf6fc" + "id": "6a53061a-13ff-a0d5-411c-e96a5b12425d" }, { "httpRequest": { @@ -37,7 +37,7 @@ }, "headers": {}, "method": "POST", - "path": "/api/v1/monitor/67817255/validate", + "path": "/api/v1/monitor/80119053/validate", "keepAlive": false, "secure": true }, @@ -57,18 +57,18 @@ "timeToLive": { "unlimited": true }, - "id": "80eaa4bb-3952-a66e-d91a-d562d5bb781c" + "id": "77a3458a-4913-4b35-0973-473899a1d95b" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v1/monitor/67817255", + "path": "/api/v1/monitor/80119053", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"deleted_monitor_id\":67817255}", + "body": "{\"deleted_monitor_id\":80119053}", "headers": { "Content-Type": [ "application/json" @@ -83,6 +83,6 @@ "timeToLive": { "unlimited": true }, - "id": "01ed89ff-2c04-3ab4-d023-2b19c15711d7" + "id": "ef721ef8-dee1-335e-b25a-e940bfdce685" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_OK_response.freeze b/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_OK_response.freeze index 400e96f5cbb..ba7a206c236 100644 --- a/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_OK_response.freeze @@ -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/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_OK_response.json b/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_OK_response.json index b29dc8f0eb0..7e07926a1c1 100644 --- a/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v1/Validate_an_existing_monitor_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}" + "json": "{\"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\"}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"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}}}", + "body": "{\"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}}}", "headers": { "Content-Type": [ "application/json" @@ -27,17 +27,17 @@ "timeToLive": { "unlimited": true }, - "id": "47b16548-1f65-a9e7-a864-8cbed3ad83a8" + "id": "12fdc38e-ad1f-57bb-1ed8-98abf52128d0" }, { "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}" + "json": "{\"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\"}" }, "headers": {}, "method": "POST", - "path": "/api/v1/monitor/67817256/validate", + "path": "/api/v1/monitor/80119054/validate", "keepAlive": false, "secure": true }, @@ -57,18 +57,18 @@ "timeToLive": { "unlimited": true }, - "id": "6f9f2953-1853-6555-b75d-2bb2980fde8b" + "id": "1768cb44-cf49-6d89-e634-eea6e7507218" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v1/monitor/67817256", + "path": "/api/v1/monitor/80119054", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"deleted_monitor_id\":67817256}", + "body": "{\"deleted_monitor_id\":80119054}", "headers": { "Content-Type": [ "application/json" @@ -83,6 +83,6 @@ "timeToLive": { "unlimited": true }, - "id": "a8cc9792-809c-4542-eaf8-487dd78d2b48" + "id": "c2dd9e0c-5bcc-1f4d-1055-09417ff5d79e" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Aggregate_RUM_events_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Aggregate_RUM_events_returns_OK_response.freeze index 3032665b442..b02bf6fda91 100644 --- a/src/test/resources/cassettes/features/v2/Aggregate_RUM_events_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Aggregate_RUM_events_returns_OK_response.freeze @@ -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/src/test/resources/cassettes/features/v2/Aggregate_RUM_events_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Aggregate_RUM_events_returns_OK_response.json index 07a96a77fdc..aa5e0254ea1 100644 --- a/src/test/resources/cassettes/features/v2/Aggregate_RUM_events_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Aggregate_RUM_events_returns_OK_response.json @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"meta\":{\"status\":\"done\",\"request_id\":\"pddv1ChZyS2R0R2cwbFNTR3dXWHE0T1V4SkV3IiwKHO-LyxpZr85euhVxgr_zcJZpbjq-uQVUzkFlD0ISDPnlZXRCg4-gaoMc2w\",\"elapsed\":0},\"data\":{\"buckets\":[]}}\n", + "body": "{\"meta\":{\"status\":\"done\",\"request_id\":\"pddv1ChZiX1d1RWNfM1JuaURhSkJ6elFsRHpnIi0KHQJFlSKZaC6T1BR15cquEEJdzvJ8iKfJO5Kr37vkEgyJYfau6iiq_M5ftbo\",\"elapsed\":0},\"data\":{\"buckets\":[]}}\n", "headers": { "Content-Type": [ "application/json" diff --git a/src/test/resources/cassettes/features/v2/Delete_a_RUM_application_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Delete_a_RUM_application_returns_No_Content_response.json index 45f3380f256..cc732c18daf 100644 --- a/src/test/resources/cassettes/features/v2/Delete_a_RUM_application_returns_No_Content_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_a_RUM_application_returns_No_Content_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "74945625-c01a-a598-e538-65a53ceb0686" + "id": "74945625-c01a-a598-e538-65a53ceb0685" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Get_a_RUM_application_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_RUM_application_returns_OK_response.json index 5bb99439840..4d3edec41a1 100644 --- a/src/test/resources/cassettes/features/v2/Get_a_RUM_application_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_a_RUM_application_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "74945625-c01a-a598-e538-65a53ceb0685" + "id": "74945625-c01a-a598-e538-65a53ceb0686" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json index 6ecce907c9f..7c020bbd2c5 100644 --- a/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb892171" + "id": "ab2c08c1-60c7-9278-3246-d650bb89216e" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Not_found_response.json index 246f6016cf0..b0a12e69b73 100644 --- a/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Not_found_response.json +++ b/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Not_found_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb89216e" + "id": "ab2c08c1-60c7-9278-3246-d650bb892171" }, { "httpRequest": { diff --git a/src/test/resources/com/datadog/api/client/v1/api/given.json b/src/test/resources/com/datadog/api/client/v1/api/given.json index aa1c8561426..cf241da8970 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/given.json +++ b/src/test/resources/com/datadog/api/client/v1/api/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/src/test/resources/com/datadog/api/client/v1/api/monitor_payload.json b/src/test/resources/com/datadog/api/client/v1/api/monitor_payload.json index 4b9f959589f..655c3884c77 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/monitor_payload.json +++ b/src/test/resources/com/datadog/api/client/v1/api/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/src/test/resources/com/datadog/api/client/v1/api/monitors.feature b/src/test/resources/com/datadog/api/client/v1/api/monitors.feature index cd90675f692..fc0a197ef30 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/monitors.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/monitors.feature @@ -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/src/test/resources/com/datadog/api/client/v1/api/multi_alert_monitor_payload.json b/src/test/resources/com/datadog/api/client/v1/api/multi_alert_monitor_payload.json new file mode 100644 index 00000000000..7ba5fe74d48 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v1/api/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 } + } +}