From b5e928067c1ba59fef6b2a110145c1b2e123b69a Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 2 Jan 2025 14:41:25 +0000 Subject: [PATCH] Regenerate client from commit b4e964b3 of spec repo --- .apigentools-info | 8 ++-- .generator/schemas/v2/openapi.yaml | 21 ++++++++++ .../CreateSecurityMonitoringSuppression.java | 1 + ...urityMonitoringSuppression_3192265332.java | 1 + ...curityMonitoringSuppressionAttributes.java | 29 ++++++++++++++ ...MonitoringSuppressionCreateAttributes.java | 29 ++++++++++++++ ...MonitoringSuppressionUpdateAttributes.java | 40 +++++++++++++++++++ ...uppression_rule_returns_OK_response.freeze | 2 +- ..._suppression_rule_returns_OK_response.json | 18 ++++----- ...exclusion_query_returns_OK_response.freeze | 2 +- ...n_exclusion_query_returns_OK_response.json | 18 ++++----- .../client/v2/api/security_monitoring.feature | 14 +++---- 12 files changed, 148 insertions(+), 35 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index cdaf9f2d649..1b3e780c13e 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-26 16:01:50.411671", - "spec_repo_commit": "f2e98b01" + "regenerated": "2025-01-02 14:39:41.391682", + "spec_repo_commit": "b4e964b3" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-26 16:01:50.427605", - "spec_repo_commit": "f2e98b01" + "regenerated": "2025-01-02 14:39:41.406329", + "spec_repo_commit": "b4e964b3" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3e1d95e9a26..5c7885313ee 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -24825,6 +24825,12 @@ components: as the search bar for detection rules. example: type:log_detection source:cloudtrail type: string + start_date: + description: A Unix millisecond timestamp giving the start date for the + suppression rule. After this date, it starts suppressing signals. + example: 1703187336000 + format: int64 + type: integer suppression_query: description: The suppression query of the suppression rule. If a signal matches this query, it is suppressed and not triggered. Same syntax as @@ -24880,6 +24886,12 @@ components: as the search bar for detection rules. example: type:log_detection source:cloudtrail type: string + start_date: + description: A Unix millisecond timestamp giving the start date for the + suppression rule. After this date, it starts suppressing signals. + example: 1703187336000 + format: int64 + type: integer suppression_query: description: The suppression query of the suppression rule. If a signal matches this query, it is suppressed and is not triggered. It uses the @@ -24966,6 +24978,15 @@ components: as the search bar for detection rules. example: type:log_detection source:cloudtrail type: string + start_date: + description: A Unix millisecond timestamp giving the start date for the + suppression rule. After this date, it starts suppressing signals. If unset, + the start date of the suppression rule is left untouched. If set to `null`, + the start date is removed. + example: 1703187336000 + format: int64 + nullable: true + type: integer suppression_query: description: The suppression query of the suppression rule. If a signal matches this query, it is suppressed and not triggered. Same syntax as diff --git a/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.java b/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.java index c0d4f912ba2..685722c4cea 100644 --- a/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.java +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.java @@ -24,6 +24,7 @@ public static void main(String[] args) { "This rule suppresses low-severity signals in staging" + " environments.") .enabled(true) + .startDate(1637493071000L) .expirationDate(1638443471000L) .name("Example-Security-Monitoring") .ruleQuery("type:log_detection source:cloudtrail") diff --git a/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression_3192265332.java b/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression_3192265332.java index 197501c2322..ad445a20399 100644 --- a/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression_3192265332.java +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression_3192265332.java @@ -24,6 +24,7 @@ public static void main(String[] args) { "This rule suppresses low-severity signals in staging" + " environments.") .enabled(true) + .startDate(1637493071000L) .expirationDate(1638443471000L) .name("Example-Security-Monitoring") .ruleQuery("type:log_detection source:cloudtrail") diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionAttributes.java index 7ac147e1abd..c788420a226 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionAttributes.java @@ -27,6 +27,7 @@ SecurityMonitoringSuppressionAttributes.JSON_PROPERTY_EXPIRATION_DATE, SecurityMonitoringSuppressionAttributes.JSON_PROPERTY_NAME, SecurityMonitoringSuppressionAttributes.JSON_PROPERTY_RULE_QUERY, + SecurityMonitoringSuppressionAttributes.JSON_PROPERTY_START_DATE, SecurityMonitoringSuppressionAttributes.JSON_PROPERTY_SUPPRESSION_QUERY, SecurityMonitoringSuppressionAttributes.JSON_PROPERTY_UPDATE_DATE, SecurityMonitoringSuppressionAttributes.JSON_PROPERTY_UPDATER, @@ -63,6 +64,9 @@ public class SecurityMonitoringSuppressionAttributes { public static final String JSON_PROPERTY_RULE_QUERY = "rule_query"; private String ruleQuery; + public static final String JSON_PROPERTY_START_DATE = "start_date"; + private Long startDate; + public static final String JSON_PROPERTY_SUPPRESSION_QUERY = "suppression_query"; private String suppressionQuery; @@ -269,6 +273,28 @@ public void setRuleQuery(String ruleQuery) { this.ruleQuery = ruleQuery; } + public SecurityMonitoringSuppressionAttributes startDate(Long startDate) { + this.startDate = startDate; + return this; + } + + /** + * A Unix millisecond timestamp giving the start date for the suppression rule. After this date, + * it starts suppressing signals. + * + * @return startDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartDate() { + return startDate; + } + + public void setStartDate(Long startDate) { + this.startDate = startDate; + } + public SecurityMonitoringSuppressionAttributes suppressionQuery(String suppressionQuery) { this.suppressionQuery = suppressionQuery; return this; @@ -424,6 +450,7 @@ public boolean equals(Object o) { this.expirationDate, securityMonitoringSuppressionAttributes.expirationDate) && Objects.equals(this.name, securityMonitoringSuppressionAttributes.name) && Objects.equals(this.ruleQuery, securityMonitoringSuppressionAttributes.ruleQuery) + && Objects.equals(this.startDate, securityMonitoringSuppressionAttributes.startDate) && Objects.equals( this.suppressionQuery, securityMonitoringSuppressionAttributes.suppressionQuery) && Objects.equals(this.updateDate, securityMonitoringSuppressionAttributes.updateDate) @@ -446,6 +473,7 @@ public int hashCode() { expirationDate, name, ruleQuery, + startDate, suppressionQuery, updateDate, updater, @@ -466,6 +494,7 @@ public String toString() { sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" ruleQuery: ").append(toIndentedString(ruleQuery)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); sb.append(" suppressionQuery: ").append(toIndentedString(suppressionQuery)).append("\n"); sb.append(" updateDate: ").append(toIndentedString(updateDate)).append("\n"); sb.append(" updater: ").append(toIndentedString(updater)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionCreateAttributes.java index 2636b948c92..aa6fd9c26ea 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionCreateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionCreateAttributes.java @@ -25,6 +25,7 @@ SecurityMonitoringSuppressionCreateAttributes.JSON_PROPERTY_EXPIRATION_DATE, SecurityMonitoringSuppressionCreateAttributes.JSON_PROPERTY_NAME, SecurityMonitoringSuppressionCreateAttributes.JSON_PROPERTY_RULE_QUERY, + SecurityMonitoringSuppressionCreateAttributes.JSON_PROPERTY_START_DATE, SecurityMonitoringSuppressionCreateAttributes.JSON_PROPERTY_SUPPRESSION_QUERY }) @jakarta.annotation.Generated( @@ -49,6 +50,9 @@ public class SecurityMonitoringSuppressionCreateAttributes { public static final String JSON_PROPERTY_RULE_QUERY = "rule_query"; private String ruleQuery; + public static final String JSON_PROPERTY_START_DATE = "start_date"; + private Long startDate; + public static final String JSON_PROPERTY_SUPPRESSION_QUERY = "suppression_query"; private String suppressionQuery; @@ -192,6 +196,28 @@ public void setRuleQuery(String ruleQuery) { this.ruleQuery = ruleQuery; } + public SecurityMonitoringSuppressionCreateAttributes startDate(Long startDate) { + this.startDate = startDate; + return this; + } + + /** + * A Unix millisecond timestamp giving the start date for the suppression rule. After this date, + * it starts suppressing signals. + * + * @return startDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStartDate() { + return startDate; + } + + public void setStartDate(Long startDate) { + this.startDate = startDate; + } + public SecurityMonitoringSuppressionCreateAttributes suppressionQuery(String suppressionQuery) { this.suppressionQuery = suppressionQuery; return this; @@ -283,6 +309,7 @@ public boolean equals(Object o) { this.expirationDate, securityMonitoringSuppressionCreateAttributes.expirationDate) && Objects.equals(this.name, securityMonitoringSuppressionCreateAttributes.name) && Objects.equals(this.ruleQuery, securityMonitoringSuppressionCreateAttributes.ruleQuery) + && Objects.equals(this.startDate, securityMonitoringSuppressionCreateAttributes.startDate) && Objects.equals( this.suppressionQuery, securityMonitoringSuppressionCreateAttributes.suppressionQuery) && Objects.equals( @@ -299,6 +326,7 @@ public int hashCode() { expirationDate, name, ruleQuery, + startDate, suppressionQuery, additionalProperties); } @@ -313,6 +341,7 @@ public String toString() { sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" ruleQuery: ").append(toIndentedString(ruleQuery)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); sb.append(" suppressionQuery: ").append(toIndentedString(suppressionQuery)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionUpdateAttributes.java index 783c5bf056c..6378a0a89f3 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionUpdateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionUpdateAttributes.java @@ -25,6 +25,7 @@ SecurityMonitoringSuppressionUpdateAttributes.JSON_PROPERTY_EXPIRATION_DATE, SecurityMonitoringSuppressionUpdateAttributes.JSON_PROPERTY_NAME, SecurityMonitoringSuppressionUpdateAttributes.JSON_PROPERTY_RULE_QUERY, + SecurityMonitoringSuppressionUpdateAttributes.JSON_PROPERTY_START_DATE, SecurityMonitoringSuppressionUpdateAttributes.JSON_PROPERTY_SUPPRESSION_QUERY, SecurityMonitoringSuppressionUpdateAttributes.JSON_PROPERTY_VERSION }) @@ -50,6 +51,9 @@ public class SecurityMonitoringSuppressionUpdateAttributes { public static final String JSON_PROPERTY_RULE_QUERY = "rule_query"; private String ruleQuery; + public static final String JSON_PROPERTY_START_DATE = "start_date"; + private JsonNullable startDate = JsonNullable.undefined(); + public static final String JSON_PROPERTY_SUPPRESSION_QUERY = "suppression_query"; private String suppressionQuery; @@ -198,6 +202,39 @@ public void setRuleQuery(String ruleQuery) { this.ruleQuery = ruleQuery; } + public SecurityMonitoringSuppressionUpdateAttributes startDate(Long startDate) { + this.startDate = JsonNullable.of(startDate); + return this; + } + + /** + * A Unix millisecond timestamp giving the start date for the suppression rule. After this date, + * it starts suppressing signals. If unset, the start date of the suppression rule is left + * untouched. If set to null, the start date is removed. + * + * @return startDate + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getStartDate() { + return startDate.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getStartDate_JsonNullable() { + return startDate; + } + + @JsonProperty(JSON_PROPERTY_START_DATE) + public void setStartDate_JsonNullable(JsonNullable startDate) { + this.startDate = startDate; + } + + public void setStartDate(Long startDate) { + this.startDate = JsonNullable.of(startDate); + } + public SecurityMonitoringSuppressionUpdateAttributes suppressionQuery(String suppressionQuery) { this.suppressionQuery = suppressionQuery; return this; @@ -310,6 +347,7 @@ public boolean equals(Object o) { this.expirationDate, securityMonitoringSuppressionUpdateAttributes.expirationDate) && Objects.equals(this.name, securityMonitoringSuppressionUpdateAttributes.name) && Objects.equals(this.ruleQuery, securityMonitoringSuppressionUpdateAttributes.ruleQuery) + && Objects.equals(this.startDate, securityMonitoringSuppressionUpdateAttributes.startDate) && Objects.equals( this.suppressionQuery, securityMonitoringSuppressionUpdateAttributes.suppressionQuery) && Objects.equals(this.version, securityMonitoringSuppressionUpdateAttributes.version) @@ -327,6 +365,7 @@ public int hashCode() { expirationDate, name, ruleQuery, + startDate, suppressionQuery, version, additionalProperties); @@ -342,6 +381,7 @@ public String toString() { sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" ruleQuery: ").append(toIndentedString(ruleQuery)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); sb.append(" suppressionQuery: ").append(toIndentedString(suppressionQuery)).append("\n"); sb.append(" version: ").append(toIndentedString(version)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.freeze index 5ff3562b5a8..28bfbcc2df0 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.freeze @@ -1 +1 @@ -2024-05-20T17:07:03.155Z \ No newline at end of file +2024-11-27T15:22:34.711Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.json index 1c92ce56073..5220cfa5d6a 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"enabled\":true,\"expiration_date\":1718039223000,\"name\":\"Test-Create_a_suppression_rule_returns_OK_response-1716224823\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"suppression_query\":\"env:staging status:low\"},\"type\":\"suppressions\"}}" + "json": "{\"data\":{\"attributes\":{\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"enabled\":true,\"expiration_date\":1734535354000,\"name\":\"Test-Create_a_suppression_rule_returns_OK_response-1732720954\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"start_date\":1733584954000,\"suppression_query\":\"env:staging status:low\"},\"type\":\"suppressions\"}}" }, "headers": {}, "method": "POST", @@ -12,10 +12,10 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"8qj-mmz-zym\",\"attributes\":{\"name\":\"Test-Create_a_suppression_rule_returns_OK_response-1716224823\",\"enabled\":true,\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"suppression_query\":\"env:staging status:low\",\"data_exclusion_query\":\"\",\"expiration_date\":1718039223000,\"version\":1,\"creation_date\":1716224823374,\"update_date\":1716224823374,\"creator\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"},\"updater\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"}},\"type\":\"suppressions\"}}\n", + "body": "{\"data\":{\"id\":\"ejv-ksi-r4j\",\"type\":\"suppressions\",\"attributes\":{\"creation_date\":1732720954868,\"creator\":{\"handle\":\"frog@datadoghq.com\",\"name\":\"\"},\"data_exclusion_query\":\"\",\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"editable\":true,\"enabled\":true,\"expiration_date\":1734535354000,\"name\":\"Test-Create_a_suppression_rule_returns_OK_response-1732720954\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"start_date\":1733584954000,\"suppression_query\":\"env:staging status:low\",\"update_date\":1732720954868,\"updater\":{\"handle\":\"frog@datadoghq.com\",\"name\":\"\"},\"version\":1}}}", "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "statusCode": 200, @@ -27,22 +27,18 @@ "timeToLive": { "unlimited": true }, - "id": "27a1f916-3c5e-7ca4-58af-a4dfedcf653a" + "id": "935a1a23-dd04-eabb-dc7d-2dd3caa616f9" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/security_monitoring/configuration/suppressions/8qj-mmz-zym", + "path": "/api/v2/security_monitoring/configuration/suppressions/ejv-ksi-r4j", "keepAlive": false, "secure": true }, "httpResponse": { - "headers": { - "Content-Type": [ - "text/html; charset=utf-8" - ] - }, + "headers": {}, "statusCode": 204, "reasonPhrase": "No Content" }, @@ -52,6 +48,6 @@ "timeToLive": { "unlimited": true }, - "id": "d9f9b01e-0568-0cee-8935-b3a7c3962d93" + "id": "b62286dc-79a3-ad34-84cf-c79401028e80" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response.freeze index c745e451305..73982716b61 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response.freeze @@ -1 +1 @@ -2024-05-20T17:07:12.131Z \ No newline at end of file +2024-11-27T15:24:35.169Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response.json index e10226817e8..a5905981c55 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"data_exclusion_query\":\"account_id:12345\",\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"enabled\":true,\"expiration_date\":1718039232000,\"name\":\"Test-Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response-1716224832\",\"rule_query\":\"type:log_detection source:cloudtrail\"},\"type\":\"suppressions\"}}" + "json": "{\"data\":{\"attributes\":{\"data_exclusion_query\":\"account_id:12345\",\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"enabled\":true,\"expiration_date\":1734535475000,\"name\":\"Test-Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response-1732721075\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"start_date\":1733585075000},\"type\":\"suppressions\"}}" }, "headers": {}, "method": "POST", @@ -12,10 +12,10 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"i9m-nqb-ets\",\"attributes\":{\"name\":\"Test-Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response-1716224832\",\"enabled\":true,\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"suppression_query\":\"\",\"data_exclusion_query\":\"account_id:12345\",\"expiration_date\":1718039232000,\"version\":1,\"creation_date\":1716224832354,\"update_date\":1716224832355,\"creator\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"},\"updater\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"}},\"type\":\"suppressions\"}}\n", + "body": "{\"data\":{\"id\":\"rv5-3sh-tvp\",\"type\":\"suppressions\",\"attributes\":{\"creation_date\":1732721075298,\"creator\":{\"handle\":\"frog@datadoghq.com\",\"name\":\"\"},\"data_exclusion_query\":\"account_id:12345\",\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"editable\":true,\"enabled\":true,\"expiration_date\":1734535475000,\"name\":\"Test-Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response-1732721075\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"start_date\":1733585075000,\"suppression_query\":\"\",\"update_date\":1732721075298,\"updater\":{\"handle\":\"frog@datadoghq.com\",\"name\":\"\"},\"version\":1}}}", "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "statusCode": 200, @@ -27,22 +27,18 @@ "timeToLive": { "unlimited": true }, - "id": "297112e6-457f-d059-13f3-dea87bc09b1f" + "id": "a17e6551-1af3-3554-1cd2-8e39316f12e5" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/security_monitoring/configuration/suppressions/i9m-nqb-ets", + "path": "/api/v2/security_monitoring/configuration/suppressions/rv5-3sh-tvp", "keepAlive": false, "secure": true }, "httpResponse": { - "headers": { - "Content-Type": [ - "text/html; charset=utf-8" - ] - }, + "headers": {}, "statusCode": 204, "reasonPhrase": "No Content" }, @@ -52,6 +48,6 @@ "timeToLive": { "unlimited": true }, - "id": "634e6e91-f885-024b-6ea2-4fe399feb9ff" + "id": "78ff53cd-61d6-a98b-250d-4650abfcb889" } ] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature index 1c3c32c5a85..362378f6349 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature @@ -264,21 +264,21 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Create a suppression rule returns "Bad Request" response Given new "CreateSecurityMonitoringSuppression" request - And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}} + And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Create a suppression rule returns "Conflict" response Given new "CreateSecurityMonitoringSuppression" request - And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}} + And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent Then the response status is 409 Conflict @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a suppression rule returns "OK" response Given new "CreateSecurityMonitoringSuppression" request - And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}} + And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "start_date": {{ timestamp('now + 10d') }}000, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "suppressions" @@ -288,7 +288,7 @@ Feature: Security Monitoring @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a suppression rule with an exclusion query returns "OK" response Given new "CreateSecurityMonitoringSuppression" request - And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "data_exclusion_query": "account_id:12345"}, "type": "suppressions"}} + And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "start_date": {{ timestamp('now + 10d') }}000, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "data_exclusion_query": "account_id:12345"}, "type": "suppressions"}} When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "suppressions" @@ -867,7 +867,7 @@ Feature: Security Monitoring Scenario: Update a suppression rule returns "Bad Request" response Given new "UpdateSecurityMonitoringSuppression" request And request contains "suppression_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}} + And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent Then the response status is 400 Bad Request @@ -875,7 +875,7 @@ Feature: Security Monitoring Scenario: Update a suppression rule returns "Concurrent Modification" response Given new "UpdateSecurityMonitoringSuppression" request And request contains "suppression_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}} + And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent Then the response status is 409 Concurrent Modification @@ -883,7 +883,7 @@ Feature: Security Monitoring Scenario: Update a suppression rule returns "Not Found" response Given new "UpdateSecurityMonitoringSuppression" request And request contains "suppression_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}} + And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent Then the response status is 404 Not Found