Skip to content

Commit 6c7b549

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Observability pipelines databricks_zerobus destination (#1534)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 00ae037 commit 6c7b549

6 files changed

Lines changed: 452 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46522,6 +46522,7 @@ components:
4652246522
- $ref: "#/components/schemas/ObservabilityPipelineSplunkHecDestination"
4652346523
- $ref: "#/components/schemas/ObservabilityPipelineSumoLogicDestination"
4652446524
- $ref: "#/components/schemas/ObservabilityPipelineSyslogNgDestination"
46525+
- $ref: "#/components/schemas/ObservabilityPipelineDatabricksZerobusDestination"
4652546526
- $ref: "#/components/schemas/ObservabilityPipelineDatadogMetricsDestination"
4652646527
ObservabilityPipelineConfigPipelineType:
4652746528
default: logs
@@ -46806,6 +46807,74 @@ components:
4680646807
- name
4680746808
- config
4680846809
type: object
46810+
ObservabilityPipelineDatabricksZerobusDestination:
46811+
description: |-
46812+
The `databricks_zerobus` destination sends logs to Databricks using the Zerobus ingestion API, streaming data directly into your Databricks Lakehouse.
46813+
46814+
**Supported pipeline types:** Logs, rehydration
46815+
properties:
46816+
auth:
46817+
$ref: "#/components/schemas/ObservabilityPipelineDatabricksZerobusDestinationAuth"
46818+
buffer:
46819+
$ref: "#/components/schemas/ObservabilityPipelineBufferOptions"
46820+
id:
46821+
description: The unique identifier for this component.
46822+
example: databricks-zerobus-destination
46823+
type: string
46824+
ingestion_endpoint:
46825+
description: Your Databricks Zerobus ingestion endpoint. This is the endpoint used to stream data directly into your Databricks Lakehouse.
46826+
example: https://my-workspace-id.zerobus.us-east-1.cloud.databricks.com
46827+
type: string
46828+
inputs:
46829+
description: A list of component IDs whose output is used as the `input` for this component.
46830+
example: ["filter-processor"]
46831+
items:
46832+
description: The ID of a component whose output is used as input for this destination.
46833+
type: string
46834+
type: array
46835+
table_name:
46836+
description: The fully qualified name of your target Databricks table. Make sure this table already exists in your Databricks workspace before deploying.
46837+
example: catalog.schema.table
46838+
type: string
46839+
type:
46840+
$ref: "#/components/schemas/ObservabilityPipelineDatabricksZerobusDestinationType"
46841+
unity_catalog_endpoint:
46842+
description: Your Databricks workspace URL. This is used to communicate with the Unity Catalog API.
46843+
example: https://my-workspace.cloud.databricks.com
46844+
type: string
46845+
required:
46846+
- id
46847+
- type
46848+
- inputs
46849+
- ingestion_endpoint
46850+
- table_name
46851+
- unity_catalog_endpoint
46852+
- auth
46853+
type: object
46854+
x-pipeline-types: [logs, rehydration]
46855+
ObservabilityPipelineDatabricksZerobusDestinationAuth:
46856+
description: OAuth credentials for authenticating with the Databricks Zerobus ingestion API.
46857+
properties:
46858+
client_id:
46859+
description: Your service principal application ID (UUID).
46860+
example: 9a8b7c6d-1234-5678-abcd-ef0123456789
46861+
type: string
46862+
client_secret_key:
46863+
description: Name of the environment variable or secret that holds the OAuth client secret used to authenticate with the Databricks ingestion endpoint.
46864+
example: DD_OP_DESTINATION_DATABRICKS_ZEROBUS_OAUTH_CLIENT_SECRET
46865+
type: string
46866+
required:
46867+
- client_id
46868+
type: object
46869+
ObservabilityPipelineDatabricksZerobusDestinationType:
46870+
default: databricks_zerobus
46871+
description: The destination type. The value must be `databricks_zerobus`.
46872+
enum:
46873+
- databricks_zerobus
46874+
example: databricks_zerobus
46875+
type: string
46876+
x-enum-varnames:
46877+
- DATABRICKS_ZEROBUS
4680946878
ObservabilityPipelineDatadogAgentSource:
4681046879
description: |-
4681146880
The `datadog_agent` source collects logs/metrics from the Datadog Agent.

src/datadogV2/model/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5516,6 +5516,12 @@ pub mod model_observability_pipeline_syslog_ng_destination;
55165516
pub use self::model_observability_pipeline_syslog_ng_destination::ObservabilityPipelineSyslogNgDestination;
55175517
pub mod model_observability_pipeline_syslog_ng_destination_type;
55185518
pub use self::model_observability_pipeline_syslog_ng_destination_type::ObservabilityPipelineSyslogNgDestinationType;
5519+
pub mod model_observability_pipeline_databricks_zerobus_destination;
5520+
pub use self::model_observability_pipeline_databricks_zerobus_destination::ObservabilityPipelineDatabricksZerobusDestination;
5521+
pub mod model_observability_pipeline_databricks_zerobus_destination_auth;
5522+
pub use self::model_observability_pipeline_databricks_zerobus_destination_auth::ObservabilityPipelineDatabricksZerobusDestinationAuth;
5523+
pub mod model_observability_pipeline_databricks_zerobus_destination_type;
5524+
pub use self::model_observability_pipeline_databricks_zerobus_destination_type::ObservabilityPipelineDatabricksZerobusDestinationType;
55195525
pub mod model_observability_pipeline_datadog_metrics_destination;
55205526
pub use self::model_observability_pipeline_datadog_metrics_destination::ObservabilityPipelineDatadogMetricsDestination;
55215527
pub mod model_observability_pipeline_datadog_metrics_destination_type;

src/datadogV2/model/model_observability_pipeline_config_destination_item.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ pub enum ObservabilityPipelineConfigDestinationItem {
7373
ObservabilityPipelineSyslogNgDestination(
7474
Box<crate::datadogV2::model::ObservabilityPipelineSyslogNgDestination>,
7575
),
76+
ObservabilityPipelineDatabricksZerobusDestination(
77+
Box<crate::datadogV2::model::ObservabilityPipelineDatabricksZerobusDestination>,
78+
),
7679
ObservabilityPipelineDatadogMetricsDestination(
7780
Box<crate::datadogV2::model::ObservabilityPipelineDatadogMetricsDestination>,
7881
),
@@ -271,6 +274,14 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineConfigDestinationItem {
271274
return Ok(ObservabilityPipelineConfigDestinationItem::ObservabilityPipelineSyslogNgDestination(_v));
272275
}
273276
}
277+
if let Ok(_v) = serde_json::from_value::<
278+
Box<crate::datadogV2::model::ObservabilityPipelineDatabricksZerobusDestination>,
279+
>(value.clone())
280+
{
281+
if !_v._unparsed {
282+
return Ok(ObservabilityPipelineConfigDestinationItem::ObservabilityPipelineDatabricksZerobusDestination(_v));
283+
}
284+
}
274285
if let Ok(_v) = serde_json::from_value::<
275286
Box<crate::datadogV2::model::ObservabilityPipelineDatadogMetricsDestination>,
276287
>(value.clone())
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
use serde::de::{Error, MapAccess, Visitor};
5+
use serde::{Deserialize, Deserializer, Serialize};
6+
use serde_with::skip_serializing_none;
7+
use std::fmt::{self, Formatter};
8+
9+
/// The `databricks_zerobus` destination sends logs to Databricks using the Zerobus ingestion API, streaming data directly into your Databricks Lakehouse.
10+
///
11+
/// **Supported pipeline types:** Logs, rehydration
12+
#[non_exhaustive]
13+
#[skip_serializing_none]
14+
#[derive(Clone, Debug, PartialEq, Serialize)]
15+
pub struct ObservabilityPipelineDatabricksZerobusDestination {
16+
/// OAuth credentials for authenticating with the Databricks Zerobus ingestion API.
17+
#[serde(rename = "auth")]
18+
pub auth: crate::datadogV2::model::ObservabilityPipelineDatabricksZerobusDestinationAuth,
19+
/// Configuration for buffer settings on destination components.
20+
#[serde(rename = "buffer")]
21+
pub buffer: Option<crate::datadogV2::model::ObservabilityPipelineBufferOptions>,
22+
/// The unique identifier for this component.
23+
#[serde(rename = "id")]
24+
pub id: String,
25+
/// Your Databricks Zerobus ingestion endpoint. This is the endpoint used to stream data directly into your Databricks Lakehouse.
26+
#[serde(rename = "ingestion_endpoint")]
27+
pub ingestion_endpoint: String,
28+
/// A list of component IDs whose output is used as the `input` for this component.
29+
#[serde(rename = "inputs")]
30+
pub inputs: Vec<String>,
31+
/// The fully qualified name of your target Databricks table. Make sure this table already exists in your Databricks workspace before deploying.
32+
#[serde(rename = "table_name")]
33+
pub table_name: String,
34+
/// The destination type. The value must be `databricks_zerobus`.
35+
#[serde(rename = "type")]
36+
pub type_: crate::datadogV2::model::ObservabilityPipelineDatabricksZerobusDestinationType,
37+
/// Your Databricks workspace URL. This is used to communicate with the Unity Catalog API.
38+
#[serde(rename = "unity_catalog_endpoint")]
39+
pub unity_catalog_endpoint: String,
40+
#[serde(flatten)]
41+
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
42+
#[serde(skip)]
43+
#[serde(default)]
44+
pub(crate) _unparsed: bool,
45+
}
46+
47+
impl ObservabilityPipelineDatabricksZerobusDestination {
48+
pub fn new(
49+
auth: crate::datadogV2::model::ObservabilityPipelineDatabricksZerobusDestinationAuth,
50+
id: String,
51+
ingestion_endpoint: String,
52+
inputs: Vec<String>,
53+
table_name: String,
54+
type_: crate::datadogV2::model::ObservabilityPipelineDatabricksZerobusDestinationType,
55+
unity_catalog_endpoint: String,
56+
) -> ObservabilityPipelineDatabricksZerobusDestination {
57+
ObservabilityPipelineDatabricksZerobusDestination {
58+
auth,
59+
buffer: None,
60+
id,
61+
ingestion_endpoint,
62+
inputs,
63+
table_name,
64+
type_,
65+
unity_catalog_endpoint,
66+
additional_properties: std::collections::BTreeMap::new(),
67+
_unparsed: false,
68+
}
69+
}
70+
71+
pub fn buffer(
72+
mut self,
73+
value: crate::datadogV2::model::ObservabilityPipelineBufferOptions,
74+
) -> Self {
75+
self.buffer = Some(value);
76+
self
77+
}
78+
79+
pub fn additional_properties(
80+
mut self,
81+
value: std::collections::BTreeMap<String, serde_json::Value>,
82+
) -> Self {
83+
self.additional_properties = value;
84+
self
85+
}
86+
}
87+
88+
impl<'de> Deserialize<'de> for ObservabilityPipelineDatabricksZerobusDestination {
89+
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
90+
where
91+
D: Deserializer<'de>,
92+
{
93+
struct ObservabilityPipelineDatabricksZerobusDestinationVisitor;
94+
impl<'a> Visitor<'a> for ObservabilityPipelineDatabricksZerobusDestinationVisitor {
95+
type Value = ObservabilityPipelineDatabricksZerobusDestination;
96+
97+
fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
98+
f.write_str("a mapping")
99+
}
100+
101+
fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
102+
where
103+
M: MapAccess<'a>,
104+
{
105+
let mut auth: Option<
106+
crate::datadogV2::model::ObservabilityPipelineDatabricksZerobusDestinationAuth,
107+
> = None;
108+
let mut buffer: Option<
109+
crate::datadogV2::model::ObservabilityPipelineBufferOptions,
110+
> = None;
111+
let mut id: Option<String> = None;
112+
let mut ingestion_endpoint: Option<String> = None;
113+
let mut inputs: Option<Vec<String>> = None;
114+
let mut table_name: Option<String> = None;
115+
let mut type_: Option<
116+
crate::datadogV2::model::ObservabilityPipelineDatabricksZerobusDestinationType,
117+
> = None;
118+
let mut unity_catalog_endpoint: Option<String> = None;
119+
let mut additional_properties: std::collections::BTreeMap<
120+
String,
121+
serde_json::Value,
122+
> = std::collections::BTreeMap::new();
123+
let mut _unparsed = false;
124+
125+
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
126+
match k.as_str() {
127+
"auth" => {
128+
auth = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
129+
}
130+
"buffer" => {
131+
if v.is_null() {
132+
continue;
133+
}
134+
buffer = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
135+
if let Some(ref _buffer) = buffer {
136+
match _buffer {
137+
crate::datadogV2::model::ObservabilityPipelineBufferOptions::UnparsedObject(_buffer) => {
138+
_unparsed = true;
139+
},
140+
_ => {}
141+
}
142+
}
143+
}
144+
"id" => {
145+
id = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
146+
}
147+
"ingestion_endpoint" => {
148+
ingestion_endpoint =
149+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
150+
}
151+
"inputs" => {
152+
inputs = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
153+
}
154+
"table_name" => {
155+
table_name = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
156+
}
157+
"type" => {
158+
type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
159+
if let Some(ref _type_) = type_ {
160+
match _type_ {
161+
crate::datadogV2::model::ObservabilityPipelineDatabricksZerobusDestinationType::UnparsedObject(_type_) => {
162+
_unparsed = true;
163+
},
164+
_ => {}
165+
}
166+
}
167+
}
168+
"unity_catalog_endpoint" => {
169+
unity_catalog_endpoint =
170+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
171+
}
172+
&_ => {
173+
if let Ok(value) = serde_json::from_value(v.clone()) {
174+
additional_properties.insert(k, value);
175+
}
176+
}
177+
}
178+
}
179+
let auth = auth.ok_or_else(|| M::Error::missing_field("auth"))?;
180+
let id = id.ok_or_else(|| M::Error::missing_field("id"))?;
181+
let ingestion_endpoint = ingestion_endpoint
182+
.ok_or_else(|| M::Error::missing_field("ingestion_endpoint"))?;
183+
let inputs = inputs.ok_or_else(|| M::Error::missing_field("inputs"))?;
184+
let table_name = table_name.ok_or_else(|| M::Error::missing_field("table_name"))?;
185+
let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?;
186+
let unity_catalog_endpoint = unity_catalog_endpoint
187+
.ok_or_else(|| M::Error::missing_field("unity_catalog_endpoint"))?;
188+
189+
let content = ObservabilityPipelineDatabricksZerobusDestination {
190+
auth,
191+
buffer,
192+
id,
193+
ingestion_endpoint,
194+
inputs,
195+
table_name,
196+
type_,
197+
unity_catalog_endpoint,
198+
additional_properties,
199+
_unparsed,
200+
};
201+
202+
Ok(content)
203+
}
204+
}
205+
206+
deserializer.deserialize_any(ObservabilityPipelineDatabricksZerobusDestinationVisitor)
207+
}
208+
}

0 commit comments

Comments
 (0)