diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 8708a330662..4f6ab374993 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -99533,6 +99533,18 @@ components: type: string x-enum-varnames: - AMAZON_SECURITY_LAKE + ObservabilityPipelineAnomalyDetection: + description: |- + Anomaly detection settings for the pipeline. + Only applies to `logs` pipelines. Requires Observability Pipelines Worker 2.25 or later. + properties: + enabled: + description: Whether anomaly detection is enabled for the pipeline. + example: true + type: boolean + required: + - enabled + type: object ObservabilityPipelineAwsAuth: description: |- AWS authentication credentials used for accessing AWS services such as S3. @@ -100213,12 +100225,20 @@ components: ObservabilityPipelineConfig: description: Specifies the pipeline's configuration, including its sources, processors, and destinations. properties: + anomaly_detection: + $ref: "#/components/schemas/ObservabilityPipelineAnomalyDetection" destinations: description: A list of destination components where processed logs are sent. example: [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}] items: $ref: "#/components/schemas/ObservabilityPipelineConfigDestinationItem" type: array + end_to_end_acknowledgements: + description: |- + Set to `true` to enable end-to-end acknowledgments for the pipeline. + Requires Observability Pipelines Worker 2.14 or later. + example: false + type: boolean pipeline_type: $ref: "#/components/schemas/ObservabilityPipelineConfigPipelineType" processor_groups: diff --git a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineAnomalyDetection.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineAnomalyDetection.java new file mode 100644 index 00000000000..369c850c53e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineAnomalyDetection.java @@ -0,0 +1,148 @@ +/* + * 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.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Anomaly detection settings for the pipeline. Only applies to logs pipelines. + * Requires Observability Pipelines Worker 2.25 or later. + */ +@JsonPropertyOrder({ObservabilityPipelineAnomalyDetection.JSON_PROPERTY_ENABLED}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ObservabilityPipelineAnomalyDetection { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public ObservabilityPipelineAnomalyDetection() {} + + @JsonCreator + public ObservabilityPipelineAnomalyDetection( + @JsonProperty(required = true, value = JSON_PROPERTY_ENABLED) Boolean enabled) { + this.enabled = enabled; + } + + public ObservabilityPipelineAnomalyDetection enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether anomaly detection is enabled for the pipeline. + * + * @return enabled + */ + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ObservabilityPipelineAnomalyDetection + */ + @JsonAnySetter + public ObservabilityPipelineAnomalyDetection putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ObservabilityPipelineAnomalyDetection object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObservabilityPipelineAnomalyDetection observabilityPipelineAnomalyDetection = + (ObservabilityPipelineAnomalyDetection) o; + return Objects.equals(this.enabled, observabilityPipelineAnomalyDetection.enabled) + && Objects.equals( + this.additionalProperties, observabilityPipelineAnomalyDetection.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObservabilityPipelineAnomalyDetection {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineConfig.java b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineConfig.java index 90445155423..6fce5db5759 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineConfig.java +++ b/src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineConfig.java @@ -21,7 +21,9 @@ /** Specifies the pipeline's configuration, including its sources, processors, and destinations. */ @JsonPropertyOrder({ + ObservabilityPipelineConfig.JSON_PROPERTY_ANOMALY_DETECTION, ObservabilityPipelineConfig.JSON_PROPERTY_DESTINATIONS, + ObservabilityPipelineConfig.JSON_PROPERTY_END_TO_END_ACKNOWLEDGEMENTS, ObservabilityPipelineConfig.JSON_PROPERTY_PIPELINE_TYPE, ObservabilityPipelineConfig.JSON_PROPERTY_PROCESSOR_GROUPS, ObservabilityPipelineConfig.JSON_PROPERTY_PROCESSORS, @@ -32,9 +34,16 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class ObservabilityPipelineConfig { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANOMALY_DETECTION = "anomaly_detection"; + private ObservabilityPipelineAnomalyDetection anomalyDetection; + public static final String JSON_PROPERTY_DESTINATIONS = "destinations"; private List destinations = new ArrayList<>(); + public static final String JSON_PROPERTY_END_TO_END_ACKNOWLEDGEMENTS = + "end_to_end_acknowledgements"; + private Boolean endToEndAcknowledgements; + public static final String JSON_PROPERTY_PIPELINE_TYPE = "pipeline_type"; private ObservabilityPipelineConfigPipelineType pipelineType = ObservabilityPipelineConfigPipelineType.LOGS; @@ -69,6 +78,33 @@ public ObservabilityPipelineConfig( } } + public ObservabilityPipelineConfig anomalyDetection( + ObservabilityPipelineAnomalyDetection anomalyDetection) { + this.anomalyDetection = anomalyDetection; + this.unparsed |= anomalyDetection.unparsed; + return this; + } + + /** + * Anomaly detection settings for the pipeline. Only applies to logs pipelines. + * Requires Observability Pipelines Worker 2.25 or later. + * + * @return anomalyDetection + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ANOMALY_DETECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ObservabilityPipelineAnomalyDetection getAnomalyDetection() { + return anomalyDetection; + } + + public void setAnomalyDetection(ObservabilityPipelineAnomalyDetection anomalyDetection) { + this.anomalyDetection = anomalyDetection; + if (anomalyDetection != null) { + this.unparsed |= anomalyDetection.unparsed; + } + } + public ObservabilityPipelineConfig destinations( List destinations) { this.destinations = destinations; @@ -105,6 +141,28 @@ public void setDestinations(List des } } + public ObservabilityPipelineConfig endToEndAcknowledgements(Boolean endToEndAcknowledgements) { + this.endToEndAcknowledgements = endToEndAcknowledgements; + return this; + } + + /** + * Set to true to enable end-to-end acknowledgments for the pipeline. Requires + * Observability Pipelines Worker 2.14 or later. + * + * @return endToEndAcknowledgements + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END_TO_END_ACKNOWLEDGEMENTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEndToEndAcknowledgements() { + return endToEndAcknowledgements; + } + + public void setEndToEndAcknowledgements(Boolean endToEndAcknowledgements) { + this.endToEndAcknowledgements = endToEndAcknowledgements; + } + public ObservabilityPipelineConfig pipelineType( ObservabilityPipelineConfigPipelineType pipelineType) { this.pipelineType = pipelineType; @@ -339,7 +397,10 @@ public boolean equals(Object o) { return false; } ObservabilityPipelineConfig observabilityPipelineConfig = (ObservabilityPipelineConfig) o; - return Objects.equals(this.destinations, observabilityPipelineConfig.destinations) + return Objects.equals(this.anomalyDetection, observabilityPipelineConfig.anomalyDetection) + && Objects.equals(this.destinations, observabilityPipelineConfig.destinations) + && Objects.equals( + this.endToEndAcknowledgements, observabilityPipelineConfig.endToEndAcknowledgements) && Objects.equals(this.pipelineType, observabilityPipelineConfig.pipelineType) && Objects.equals(this.processorGroups, observabilityPipelineConfig.processorGroups) && Objects.equals(this.processors, observabilityPipelineConfig.processors) @@ -353,7 +414,9 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( + anomalyDetection, destinations, + endToEndAcknowledgements, pipelineType, processorGroups, processors, @@ -366,7 +429,11 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ObservabilityPipelineConfig {\n"); + sb.append(" anomalyDetection: ").append(toIndentedString(anomalyDetection)).append("\n"); sb.append(" destinations: ").append(toIndentedString(destinations)).append("\n"); + sb.append(" endToEndAcknowledgements: ") + .append(toIndentedString(endToEndAcknowledgements)) + .append("\n"); sb.append(" pipelineType: ").append(toIndentedString(pipelineType)).append("\n"); sb.append(" processorGroups: ").append(toIndentedString(processorGroups)).append("\n"); sb.append(" processors: ").append(toIndentedString(processors)).append("\n"); diff --git a/src/test/resources/com/datadog/api/client/v2/api/observability_pipelines.feature b/src/test/resources/com/datadog/api/client/v2/api/observability_pipelines.feature index 9f3a119fab4..a3a4fc54940 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/observability_pipelines.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/observability_pipelines.feature @@ -20,7 +20,7 @@ Feature: Observability Pipelines @generated @skip @team:ddoghq/observability-pipelines Scenario: Create a new pipeline returns "Conflict" response Given new "CreatePipeline" request - And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "pipeline_type": "logs", "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}, {"enabled": true, "field": "message", "id": "json-processor", "include": "*", "type": "parse_json"}]}], "processors": [], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Main Observability Pipeline"}, "type": "pipelines"}} + And body with value {"data": {"attributes": {"config": {"anomaly_detection": {"enabled": true}, "destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "end_to_end_acknowledgements": false, "pipeline_type": "logs", "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}, {"enabled": true, "field": "message", "id": "json-processor", "include": "*", "type": "parse_json"}]}], "processors": [], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Main Observability Pipeline"}, "type": "pipelines"}} When the request is sent Then the response status is 409 Conflict @@ -123,7 +123,7 @@ Feature: Observability Pipelines Scenario: Update a pipeline returns "Conflict" response Given new "UpdatePipeline" request And request contains "pipeline_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "pipeline_type": "logs", "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}, {"enabled": true, "field": "message", "id": "json-processor", "include": "*", "type": "parse_json"}]}], "processors": [], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Main Observability Pipeline"}, "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "pipelines"}} + And body with value {"data": {"attributes": {"config": {"anomaly_detection": {"enabled": true}, "destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "end_to_end_acknowledgements": false, "pipeline_type": "logs", "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}, {"enabled": true, "field": "message", "id": "json-processor", "include": "*", "type": "parse_json"}]}], "processors": [], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Main Observability Pipeline"}, "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "pipelines"}} When the request is sent Then the response status is 409 Conflict