Skip to content

Commit eb798ce

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 5058d5a of spec repo (#3718)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 22870e1 commit eb798ce

6 files changed

Lines changed: 207 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64398,6 +64398,8 @@ components:
6439864398
$ref: "#/components/schemas/ObservabilityPipelineClickhouseDestinationBatch"
6439964399
batch_encoding:
6440064400
$ref: "#/components/schemas/ObservabilityPipelineClickhouseDestinationBatchEncoding"
64401+
buffer:
64402+
$ref: "#/components/schemas/ObservabilityPipelineBufferOptions"
6440164403
compression:
6440264404
$ref: "#/components/schemas/ObservabilityPipelineClickhouseDestinationCompression"
6440364405
database:
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
"""
2+
Validate an observability pipeline with ClickHouse destination with all fields set returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi
7+
from datadog_api_client.v2.model.observability_pipeline_buffer_options_memory_type import (
8+
ObservabilityPipelineBufferOptionsMemoryType,
9+
)
10+
from datadog_api_client.v2.model.observability_pipeline_buffer_options_when_full import (
11+
ObservabilityPipelineBufferOptionsWhenFull,
12+
)
13+
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination import (
14+
ObservabilityPipelineClickhouseDestination,
15+
)
16+
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination_auth import (
17+
ObservabilityPipelineClickhouseDestinationAuth,
18+
)
19+
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination_auth_strategy import (
20+
ObservabilityPipelineClickhouseDestinationAuthStrategy,
21+
)
22+
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination_batch import (
23+
ObservabilityPipelineClickhouseDestinationBatch,
24+
)
25+
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination_batch_encoding import (
26+
ObservabilityPipelineClickhouseDestinationBatchEncoding,
27+
)
28+
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination_batch_encoding_codec import (
29+
ObservabilityPipelineClickhouseDestinationBatchEncodingCodec,
30+
)
31+
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination_compression_algorithm import (
32+
ObservabilityPipelineClickhouseDestinationCompressionAlgorithm,
33+
)
34+
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination_compression_object import (
35+
ObservabilityPipelineClickhouseDestinationCompressionObject,
36+
)
37+
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination_format import (
38+
ObservabilityPipelineClickhouseDestinationFormat,
39+
)
40+
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination_type import (
41+
ObservabilityPipelineClickhouseDestinationType,
42+
)
43+
from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig
44+
from datadog_api_client.v2.model.observability_pipeline_config_processor_group import (
45+
ObservabilityPipelineConfigProcessorGroup,
46+
)
47+
from datadog_api_client.v2.model.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes
48+
from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source import (
49+
ObservabilityPipelineDatadogAgentSource,
50+
)
51+
from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source_type import (
52+
ObservabilityPipelineDatadogAgentSourceType,
53+
)
54+
from datadog_api_client.v2.model.observability_pipeline_filter_processor import ObservabilityPipelineFilterProcessor
55+
from datadog_api_client.v2.model.observability_pipeline_filter_processor_type import (
56+
ObservabilityPipelineFilterProcessorType,
57+
)
58+
from datadog_api_client.v2.model.observability_pipeline_memory_buffer_size_options import (
59+
ObservabilityPipelineMemoryBufferSizeOptions,
60+
)
61+
from datadog_api_client.v2.model.observability_pipeline_spec import ObservabilityPipelineSpec
62+
from datadog_api_client.v2.model.observability_pipeline_spec_data import ObservabilityPipelineSpecData
63+
from datadog_api_client.v2.model.observability_pipeline_tls import ObservabilityPipelineTls
64+
65+
body = ObservabilityPipelineSpec(
66+
data=ObservabilityPipelineSpecData(
67+
attributes=ObservabilityPipelineDataAttributes(
68+
config=ObservabilityPipelineConfig(
69+
destinations=[
70+
ObservabilityPipelineClickhouseDestination(
71+
id="clickhouse-destination",
72+
inputs=[
73+
"my-processor-group",
74+
],
75+
type=ObservabilityPipelineClickhouseDestinationType.CLICKHOUSE,
76+
endpoint_url_key="CLICKHOUSE_ENDPOINT_URL",
77+
database="my_database",
78+
table="application_logs",
79+
format=ObservabilityPipelineClickhouseDestinationFormat.ARROW_STREAM,
80+
skip_unknown_fields=True,
81+
date_time_best_effort=True,
82+
compression=ObservabilityPipelineClickhouseDestinationCompressionObject(
83+
algorithm=ObservabilityPipelineClickhouseDestinationCompressionAlgorithm.GZIP,
84+
level=6,
85+
),
86+
auth=ObservabilityPipelineClickhouseDestinationAuth(
87+
strategy=ObservabilityPipelineClickhouseDestinationAuthStrategy.BASIC,
88+
username_key="CLICKHOUSE_USERNAME",
89+
password_key="CLICKHOUSE_PASSWORD",
90+
),
91+
batch=ObservabilityPipelineClickhouseDestinationBatch(
92+
max_events=1000,
93+
timeout_secs=1,
94+
),
95+
batch_encoding=ObservabilityPipelineClickhouseDestinationBatchEncoding(
96+
codec=ObservabilityPipelineClickhouseDestinationBatchEncodingCodec.ARROW_STREAM,
97+
allow_nullable_fields=True,
98+
),
99+
tls=ObservabilityPipelineTls(
100+
crt_file="/path/to/cert.crt",
101+
ca_file="/path/to/ca.crt",
102+
key_file="/path/to/key.key",
103+
key_pass_key="TLS_KEY_PASSPHRASE",
104+
),
105+
buffer=ObservabilityPipelineMemoryBufferSizeOptions(
106+
type=ObservabilityPipelineBufferOptionsMemoryType.MEMORY,
107+
max_events=500,
108+
when_full=ObservabilityPipelineBufferOptionsWhenFull.BLOCK,
109+
),
110+
),
111+
],
112+
processor_groups=[
113+
ObservabilityPipelineConfigProcessorGroup(
114+
enabled=True,
115+
id="my-processor-group",
116+
include="service:my-service",
117+
inputs=[
118+
"datadog-agent-source",
119+
],
120+
processors=[
121+
ObservabilityPipelineFilterProcessor(
122+
enabled=True,
123+
id="filter-processor",
124+
include="status:error",
125+
type=ObservabilityPipelineFilterProcessorType.FILTER,
126+
),
127+
],
128+
),
129+
],
130+
sources=[
131+
ObservabilityPipelineDatadogAgentSource(
132+
id="datadog-agent-source",
133+
type=ObservabilityPipelineDatadogAgentSourceType.DATADOG_AGENT,
134+
),
135+
],
136+
),
137+
name="Pipeline with ClickHouse Destination All Fields",
138+
),
139+
type="pipelines",
140+
),
141+
)
142+
143+
configuration = Configuration()
144+
with ApiClient(configuration) as api_client:
145+
api_instance = ObservabilityPipelinesApi(api_client)
146+
response = api_instance.validate_pipeline(body=body)
147+
148+
print(response)

src/datadog_api_client/v2/model/observability_pipeline_clickhouse_destination.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination_batch_encoding import (
2525
ObservabilityPipelineClickhouseDestinationBatchEncoding,
2626
)
27+
from datadog_api_client.v2.model.observability_pipeline_buffer_options import ObservabilityPipelineBufferOptions
2728
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination_compression import (
2829
ObservabilityPipelineClickhouseDestinationCompression,
2930
)
@@ -34,6 +35,15 @@
3435
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination_type import (
3536
ObservabilityPipelineClickhouseDestinationType,
3637
)
38+
from datadog_api_client.v2.model.observability_pipeline_disk_buffer_options import (
39+
ObservabilityPipelineDiskBufferOptions,
40+
)
41+
from datadog_api_client.v2.model.observability_pipeline_memory_buffer_options import (
42+
ObservabilityPipelineMemoryBufferOptions,
43+
)
44+
from datadog_api_client.v2.model.observability_pipeline_memory_buffer_size_options import (
45+
ObservabilityPipelineMemoryBufferSizeOptions,
46+
)
3747
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination_compression_object import (
3848
ObservabilityPipelineClickhouseDestinationCompressionObject,
3949
)
@@ -51,6 +61,7 @@ def openapi_types(_):
5161
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination_batch_encoding import (
5262
ObservabilityPipelineClickhouseDestinationBatchEncoding,
5363
)
64+
from datadog_api_client.v2.model.observability_pipeline_buffer_options import ObservabilityPipelineBufferOptions
5465
from datadog_api_client.v2.model.observability_pipeline_clickhouse_destination_compression import (
5566
ObservabilityPipelineClickhouseDestinationCompression,
5667
)
@@ -66,6 +77,7 @@ def openapi_types(_):
6677
"auth": (ObservabilityPipelineClickhouseDestinationAuth,),
6778
"batch": (ObservabilityPipelineClickhouseDestinationBatch,),
6879
"batch_encoding": (ObservabilityPipelineClickhouseDestinationBatchEncoding,),
80+
"buffer": (ObservabilityPipelineBufferOptions,),
6981
"compression": (ObservabilityPipelineClickhouseDestinationCompression,),
7082
"database": (str,),
7183
"date_time_best_effort": (bool,),
@@ -83,6 +95,7 @@ def openapi_types(_):
8395
"auth": "auth",
8496
"batch": "batch",
8597
"batch_encoding": "batch_encoding",
98+
"buffer": "buffer",
8699
"compression": "compression",
87100
"database": "database",
88101
"date_time_best_effort": "date_time_best_effort",
@@ -105,6 +118,13 @@ def __init__(
105118
auth: Union[ObservabilityPipelineClickhouseDestinationAuth, UnsetType] = unset,
106119
batch: Union[ObservabilityPipelineClickhouseDestinationBatch, UnsetType] = unset,
107120
batch_encoding: Union[ObservabilityPipelineClickhouseDestinationBatchEncoding, UnsetType] = unset,
121+
buffer: Union[
122+
ObservabilityPipelineBufferOptions,
123+
ObservabilityPipelineDiskBufferOptions,
124+
ObservabilityPipelineMemoryBufferOptions,
125+
ObservabilityPipelineMemoryBufferSizeOptions,
126+
UnsetType,
127+
] = unset,
108128
compression: Union[
109129
ObservabilityPipelineClickhouseDestinationCompression,
110130
str,
@@ -135,6 +155,9 @@ def __init__(
135155
Required when ``format`` is ``arrow_stream``. The ``codec`` field must be set to ``arrow_stream``.
136156
:type batch_encoding: ObservabilityPipelineClickhouseDestinationBatchEncoding, optional
137157
158+
:param buffer: Configuration for buffer settings on destination components.
159+
:type buffer: ObservabilityPipelineBufferOptions, optional
160+
138161
:param compression: Compression setting for outbound HTTP requests to ClickHouse.
139162
Can be specified as a shorthand string ( ``"gzip"`` or ``"none"`` ) or as an object
140163
with an ``algorithm`` field and an optional ``level`` (gzip only, 1–9).
@@ -183,6 +206,8 @@ def __init__(
183206
kwargs["batch"] = batch
184207
if batch_encoding is not unset:
185208
kwargs["batch_encoding"] = batch_encoding
209+
if buffer is not unset:
210+
kwargs["buffer"] = buffer
186211
if compression is not unset:
187212
kwargs["compression"] = compression
188213
if database is not unset:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-06-24T16:45:05.037Z
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
interactions:
2+
- request:
3+
body: '{"data":{"attributes":{"config":{"destinations":[{"auth":{"password_key":"CLICKHOUSE_PASSWORD","strategy":"basic","username_key":"CLICKHOUSE_USERNAME"},"batch":{"max_events":1000,"timeout_secs":1},"batch_encoding":{"allow_nullable_fields":true,"codec":"arrow_stream"},"buffer":{"max_events":500,"type":"memory","when_full":"block"},"compression":{"algorithm":"gzip","level":6},"database":"my_database","date_time_best_effort":true,"endpoint_url_key":"CLICKHOUSE_ENDPOINT_URL","format":"arrow_stream","id":"clickhouse-destination","inputs":["my-processor-group"],"skip_unknown_fields":true,"table":"application_logs","tls":{"ca_file":"/path/to/ca.crt","crt_file":"/path/to/cert.crt","key_file":"/path/to/key.key","key_pass_key":"TLS_KEY_PASSPHRASE"},"type":"clickhouse"}],"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"}]}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Pipeline
4+
with ClickHouse Destination All Fields"},"type":"pipelines"}}'
5+
headers:
6+
accept:
7+
- application/json
8+
content-type:
9+
- application/json
10+
method: POST
11+
uri: https://api.datadoghq.com/api/v2/obs-pipelines/pipelines/validate
12+
response:
13+
body:
14+
string: '{"errors":[]}
15+
16+
'
17+
headers:
18+
content-type:
19+
- application/vnd.api+json
20+
status:
21+
code: 200
22+
message: OK
23+
version: 1

tests/v2/features/observability_pipelines.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ Feature: Observability Pipelines
192192
Then the response status is 200 OK
193193
And the response "errors" has length 0
194194

195+
@team:DataDog/observability-pipelines
196+
Scenario: Validate an observability pipeline with ClickHouse destination with all fields set returns "OK" response
197+
Given new "ValidatePipeline" request
198+
And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "clickhouse-destination", "inputs": ["my-processor-group"], "type": "clickhouse", "endpoint_url_key": "CLICKHOUSE_ENDPOINT_URL", "database": "my_database", "table": "application_logs", "format": "arrow_stream", "skip_unknown_fields": true, "date_time_best_effort": true, "compression": {"algorithm": "gzip", "level": 6}, "auth": {"strategy": "basic", "username_key": "CLICKHOUSE_USERNAME", "password_key": "CLICKHOUSE_PASSWORD"}, "batch": {"max_events": 1000, "timeout_secs": 1}, "batch_encoding": {"codec": "arrow_stream", "allow_nullable_fields": true}, "tls": {"crt_file": "/path/to/cert.crt", "ca_file": "/path/to/ca.crt", "key_file": "/path/to/key.key", "key_pass_key": "TLS_KEY_PASSPHRASE"}, "buffer": {"type": "memory", "max_events": 500, "when_full": "block"}}], "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"}]}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Pipeline with ClickHouse Destination All Fields"}, "type": "pipelines"}}
199+
When the request is sent
200+
Then the response status is 200 OK
201+
And the response "errors" has length 0
202+
195203
@team:DataDog/observability-pipelines
196204
Scenario: Validate an observability pipeline with HTTP server source valid_tokens returns "OK" response
197205
Given new "ValidatePipeline" request

0 commit comments

Comments
 (0)