Skip to content

Commit f6ea820

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Adding datastream to Open Search destination and adding Auth Strategy for Observability Pipeline API (#3400)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent e0f0839 commit f6ea820

File tree

4 files changed

+256
-2
lines changed

4 files changed

+256
-2
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38691,12 +38691,14 @@ components:
3869138691
- none
3869238692
- basic
3869338693
- bearer
38694+
- custom
3869438695
example: basic
3869538696
type: string
3869638697
x-enum-varnames:
3869738698
- NONE
3869838699
- BASIC
3869938700
- BEARER
38701+
- CUSTOM
3870038702
ObservabilityPipelineHttpClientSourceType:
3870138703
default: http_client
3870238704
description: The source type. The value should always be `http_client`.
@@ -39259,6 +39261,8 @@ components:
3925939261
description: The index to write logs to.
3926039262
example: logs-index
3926139263
type: string
39264+
data_stream:
39265+
$ref: '#/components/schemas/ObservabilityPipelineOpenSearchDestinationDataStream'
3926239266
id:
3926339267
description: The unique identifier for this component.
3926439268
example: opensearch-destination
@@ -39280,6 +39284,23 @@ components:
3928039284
type: object
3928139285
x-pipeline-types:
3928239286
- logs
39287+
ObservabilityPipelineOpenSearchDestinationDataStream:
39288+
description: Configuration options for writing to OpenSearch Data Streams instead
39289+
of a fixed index.
39290+
properties:
39291+
dataset:
39292+
description: The data stream dataset for your logs. This groups logs by
39293+
their source or application.
39294+
type: string
39295+
dtype:
39296+
description: The data stream type for your logs. This determines how logs
39297+
are categorized within the data stream.
39298+
type: string
39299+
namespace:
39300+
description: The data stream namespace for your logs. This separates logs
39301+
into different environments or domains.
39302+
type: string
39303+
type: object
3928339304
ObservabilityPipelineOpenSearchDestinationType:
3928439305
default: opensearch
3928539306
description: The destination type. The value should always be `opensearch`.

src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineHttpClientSourceAuthStrategy.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,16 @@
2626
public class ObservabilityPipelineHttpClientSourceAuthStrategy extends ModelEnum<String> {
2727

2828
private static final Set<String> allowedValues =
29-
new HashSet<String>(Arrays.asList("none", "basic", "bearer"));
29+
new HashSet<String>(Arrays.asList("none", "basic", "bearer", "custom"));
3030

3131
public static final ObservabilityPipelineHttpClientSourceAuthStrategy NONE =
3232
new ObservabilityPipelineHttpClientSourceAuthStrategy("none");
3333
public static final ObservabilityPipelineHttpClientSourceAuthStrategy BASIC =
3434
new ObservabilityPipelineHttpClientSourceAuthStrategy("basic");
3535
public static final ObservabilityPipelineHttpClientSourceAuthStrategy BEARER =
3636
new ObservabilityPipelineHttpClientSourceAuthStrategy("bearer");
37+
public static final ObservabilityPipelineHttpClientSourceAuthStrategy CUSTOM =
38+
new ObservabilityPipelineHttpClientSourceAuthStrategy("custom");
3739

3840
ObservabilityPipelineHttpClientSourceAuthStrategy(String value) {
3941
super(value, allowedValues);

src/main/java/com/datadog/api/client/v2/model/ObservabilityPipelineOpenSearchDestination.java

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
*/
2727
@JsonPropertyOrder({
2828
ObservabilityPipelineOpenSearchDestination.JSON_PROPERTY_BULK_INDEX,
29+
ObservabilityPipelineOpenSearchDestination.JSON_PROPERTY_DATA_STREAM,
2930
ObservabilityPipelineOpenSearchDestination.JSON_PROPERTY_ID,
3031
ObservabilityPipelineOpenSearchDestination.JSON_PROPERTY_INPUTS,
3132
ObservabilityPipelineOpenSearchDestination.JSON_PROPERTY_TYPE
@@ -37,6 +38,9 @@ public class ObservabilityPipelineOpenSearchDestination {
3738
public static final String JSON_PROPERTY_BULK_INDEX = "bulk_index";
3839
private String bulkIndex;
3940

41+
public static final String JSON_PROPERTY_DATA_STREAM = "data_stream";
42+
private ObservabilityPipelineOpenSearchDestinationDataStream dataStream;
43+
4044
public static final String JSON_PROPERTY_ID = "id";
4145
private String id;
4246

@@ -82,6 +86,29 @@ public void setBulkIndex(String bulkIndex) {
8286
this.bulkIndex = bulkIndex;
8387
}
8488

89+
public ObservabilityPipelineOpenSearchDestination dataStream(
90+
ObservabilityPipelineOpenSearchDestinationDataStream dataStream) {
91+
this.dataStream = dataStream;
92+
this.unparsed |= dataStream.unparsed;
93+
return this;
94+
}
95+
96+
/**
97+
* Configuration options for writing to OpenSearch Data Streams instead of a fixed index.
98+
*
99+
* @return dataStream
100+
*/
101+
@jakarta.annotation.Nullable
102+
@JsonProperty(JSON_PROPERTY_DATA_STREAM)
103+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
104+
public ObservabilityPipelineOpenSearchDestinationDataStream getDataStream() {
105+
return dataStream;
106+
}
107+
108+
public void setDataStream(ObservabilityPipelineOpenSearchDestinationDataStream dataStream) {
109+
this.dataStream = dataStream;
110+
}
111+
85112
public ObservabilityPipelineOpenSearchDestination id(String id) {
86113
this.id = id;
87114
return this;
@@ -211,6 +238,7 @@ public boolean equals(Object o) {
211238
ObservabilityPipelineOpenSearchDestination observabilityPipelineOpenSearchDestination =
212239
(ObservabilityPipelineOpenSearchDestination) o;
213240
return Objects.equals(this.bulkIndex, observabilityPipelineOpenSearchDestination.bulkIndex)
241+
&& Objects.equals(this.dataStream, observabilityPipelineOpenSearchDestination.dataStream)
214242
&& Objects.equals(this.id, observabilityPipelineOpenSearchDestination.id)
215243
&& Objects.equals(this.inputs, observabilityPipelineOpenSearchDestination.inputs)
216244
&& Objects.equals(this.type, observabilityPipelineOpenSearchDestination.type)
@@ -221,14 +249,15 @@ public boolean equals(Object o) {
221249

222250
@Override
223251
public int hashCode() {
224-
return Objects.hash(bulkIndex, id, inputs, type, additionalProperties);
252+
return Objects.hash(bulkIndex, dataStream, id, inputs, type, additionalProperties);
225253
}
226254

227255
@Override
228256
public String toString() {
229257
StringBuilder sb = new StringBuilder();
230258
sb.append("class ObservabilityPipelineOpenSearchDestination {\n");
231259
sb.append(" bulkIndex: ").append(toIndentedString(bulkIndex)).append("\n");
260+
sb.append(" dataStream: ").append(toIndentedString(dataStream)).append("\n");
232261
sb.append(" id: ").append(toIndentedString(id)).append("\n");
233262
sb.append(" inputs: ").append(toIndentedString(inputs)).append("\n");
234263
sb.append(" type: ").append(toIndentedString(type)).append("\n");
Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
/*
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2019-Present Datadog, Inc.
5+
*/
6+
7+
package com.datadog.api.client.v2.model;
8+
9+
import com.fasterxml.jackson.annotation.JsonAnyGetter;
10+
import com.fasterxml.jackson.annotation.JsonAnySetter;
11+
import com.fasterxml.jackson.annotation.JsonIgnore;
12+
import com.fasterxml.jackson.annotation.JsonInclude;
13+
import com.fasterxml.jackson.annotation.JsonProperty;
14+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
15+
import java.util.HashMap;
16+
import java.util.Map;
17+
import java.util.Objects;
18+
19+
/** Configuration options for writing to OpenSearch Data Streams instead of a fixed index. */
20+
@JsonPropertyOrder({
21+
ObservabilityPipelineOpenSearchDestinationDataStream.JSON_PROPERTY_DATASET,
22+
ObservabilityPipelineOpenSearchDestinationDataStream.JSON_PROPERTY_DTYPE,
23+
ObservabilityPipelineOpenSearchDestinationDataStream.JSON_PROPERTY_NAMESPACE
24+
})
25+
@jakarta.annotation.Generated(
26+
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
27+
public class ObservabilityPipelineOpenSearchDestinationDataStream {
28+
@JsonIgnore public boolean unparsed = false;
29+
public static final String JSON_PROPERTY_DATASET = "dataset";
30+
private String dataset;
31+
32+
public static final String JSON_PROPERTY_DTYPE = "dtype";
33+
private String dtype;
34+
35+
public static final String JSON_PROPERTY_NAMESPACE = "namespace";
36+
private String namespace;
37+
38+
public ObservabilityPipelineOpenSearchDestinationDataStream dataset(String dataset) {
39+
this.dataset = dataset;
40+
return this;
41+
}
42+
43+
/**
44+
* The data stream dataset for your logs. This groups logs by their source or application.
45+
*
46+
* @return dataset
47+
*/
48+
@jakarta.annotation.Nullable
49+
@JsonProperty(JSON_PROPERTY_DATASET)
50+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
51+
public String getDataset() {
52+
return dataset;
53+
}
54+
55+
public void setDataset(String dataset) {
56+
this.dataset = dataset;
57+
}
58+
59+
public ObservabilityPipelineOpenSearchDestinationDataStream dtype(String dtype) {
60+
this.dtype = dtype;
61+
return this;
62+
}
63+
64+
/**
65+
* The data stream type for your logs. This determines how logs are categorized within the data
66+
* stream.
67+
*
68+
* @return dtype
69+
*/
70+
@jakarta.annotation.Nullable
71+
@JsonProperty(JSON_PROPERTY_DTYPE)
72+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
73+
public String getDtype() {
74+
return dtype;
75+
}
76+
77+
public void setDtype(String dtype) {
78+
this.dtype = dtype;
79+
}
80+
81+
public ObservabilityPipelineOpenSearchDestinationDataStream namespace(String namespace) {
82+
this.namespace = namespace;
83+
return this;
84+
}
85+
86+
/**
87+
* The data stream namespace for your logs. This separates logs into different environments or
88+
* domains.
89+
*
90+
* @return namespace
91+
*/
92+
@jakarta.annotation.Nullable
93+
@JsonProperty(JSON_PROPERTY_NAMESPACE)
94+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
95+
public String getNamespace() {
96+
return namespace;
97+
}
98+
99+
public void setNamespace(String namespace) {
100+
this.namespace = namespace;
101+
}
102+
103+
/**
104+
* A container for additional, undeclared properties. This is a holder for any undeclared
105+
* properties as specified with the 'additionalProperties' keyword in the OAS document.
106+
*/
107+
private Map<String, Object> additionalProperties;
108+
109+
/**
110+
* Set the additional (undeclared) property with the specified name and value. If the property
111+
* does not already exist, create it otherwise replace it.
112+
*
113+
* @param key The arbitrary key to set
114+
* @param value The associated value
115+
* @return ObservabilityPipelineOpenSearchDestinationDataStream
116+
*/
117+
@JsonAnySetter
118+
public ObservabilityPipelineOpenSearchDestinationDataStream putAdditionalProperty(
119+
String key, Object value) {
120+
if (this.additionalProperties == null) {
121+
this.additionalProperties = new HashMap<String, Object>();
122+
}
123+
this.additionalProperties.put(key, value);
124+
return this;
125+
}
126+
127+
/**
128+
* Return the additional (undeclared) property.
129+
*
130+
* @return The additional properties
131+
*/
132+
@JsonAnyGetter
133+
public Map<String, Object> getAdditionalProperties() {
134+
return additionalProperties;
135+
}
136+
137+
/**
138+
* Return the additional (undeclared) property with the specified name.
139+
*
140+
* @param key The arbitrary key to get
141+
* @return The specific additional property for the given key
142+
*/
143+
public Object getAdditionalProperty(String key) {
144+
if (this.additionalProperties == null) {
145+
return null;
146+
}
147+
return this.additionalProperties.get(key);
148+
}
149+
150+
/**
151+
* Return true if this ObservabilityPipelineOpenSearchDestinationDataStream object is equal to o.
152+
*/
153+
@Override
154+
public boolean equals(Object o) {
155+
if (this == o) {
156+
return true;
157+
}
158+
if (o == null || getClass() != o.getClass()) {
159+
return false;
160+
}
161+
ObservabilityPipelineOpenSearchDestinationDataStream
162+
observabilityPipelineOpenSearchDestinationDataStream =
163+
(ObservabilityPipelineOpenSearchDestinationDataStream) o;
164+
return Objects.equals(
165+
this.dataset, observabilityPipelineOpenSearchDestinationDataStream.dataset)
166+
&& Objects.equals(this.dtype, observabilityPipelineOpenSearchDestinationDataStream.dtype)
167+
&& Objects.equals(
168+
this.namespace, observabilityPipelineOpenSearchDestinationDataStream.namespace)
169+
&& Objects.equals(
170+
this.additionalProperties,
171+
observabilityPipelineOpenSearchDestinationDataStream.additionalProperties);
172+
}
173+
174+
@Override
175+
public int hashCode() {
176+
return Objects.hash(dataset, dtype, namespace, additionalProperties);
177+
}
178+
179+
@Override
180+
public String toString() {
181+
StringBuilder sb = new StringBuilder();
182+
sb.append("class ObservabilityPipelineOpenSearchDestinationDataStream {\n");
183+
sb.append(" dataset: ").append(toIndentedString(dataset)).append("\n");
184+
sb.append(" dtype: ").append(toIndentedString(dtype)).append("\n");
185+
sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n");
186+
sb.append(" additionalProperties: ")
187+
.append(toIndentedString(additionalProperties))
188+
.append("\n");
189+
sb.append('}');
190+
return sb.toString();
191+
}
192+
193+
/**
194+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
195+
*/
196+
private String toIndentedString(Object o) {
197+
if (o == null) {
198+
return "null";
199+
}
200+
return o.toString().replace("\n", "\n ");
201+
}
202+
}

0 commit comments

Comments
 (0)