Skip to content

Commit 578bed3

Browse files
Merge master into datadog-api-spec/test/d.marin/oncall-api
2 parents a84853d + 9b3bdbc commit 578bed3

File tree

38 files changed

+445
-59
lines changed

38 files changed

+445
-59
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-04-08 14:37:43.058121",
8-
"spec_repo_commit": "642b7d0b"
7+
"regenerated": "2025-04-08 20:55:41.621292",
8+
"spec_repo_commit": "21cf6edb"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-04-08 14:37:43.074501",
13-
"spec_repo_commit": "642b7d0b"
12+
"regenerated": "2025-04-08 20:55:41.637249",
13+
"spec_repo_commit": "21cf6edb"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17271,6 +17271,14 @@ components:
1727117271
example: 0
1727217272
format: int64
1727317273
type: integer
17274+
ip_addresses:
17275+
description: The interface IP addresses
17276+
example:
17277+
- 1.1.1.1
17278+
- 1.1.1.2
17279+
items:
17280+
type: string
17281+
type: array
1727417282
mac_address:
1727517283
description: The interface MAC address
1727617284
example: 00:00:00:00:00:00
@@ -25238,6 +25246,14 @@ components:
2523825246
example: 1.0
2523925247
format: double
2524025248
type: number
25249+
trace_rate:
25250+
description: 'Sample rate to apply to traces containing spans going through
25251+
this retention filter.
25252+
25253+
A value of 1.0 keeps all traces with spans matching the query.'
25254+
example: 1.0
25255+
format: double
25256+
type: number
2524125257
type: object
2524225258
RetentionFilterAllType:
2524325259
default: spans-sampling-processor
@@ -25297,6 +25313,14 @@ components:
2529725313
example: 1.0
2529825314
format: double
2529925315
type: number
25316+
trace_rate:
25317+
description: 'Sample rate to apply to traces containing spans going through
25318+
this retention filter.
25319+
25320+
A value of 1.0 keeps all traces with spans matching the query.'
25321+
example: 1.0
25322+
format: double
25323+
type: number
2530025324
type: object
2530125325
RetentionFilterCreateAttributes:
2530225326
description: The object describing the configuration of the retention filter
@@ -25322,6 +25346,14 @@ components:
2532225346
example: 1.0
2532325347
format: double
2532425348
type: number
25349+
trace_rate:
25350+
description: 'Sample rate to apply to traces containing spans going through
25351+
this retention filter.
25352+
25353+
A value of 1.0 keeps all traces with spans matching the query.'
25354+
example: 1.0
25355+
format: double
25356+
type: number
2532525357
required:
2532625358
- name
2532725359
- filter
@@ -25393,6 +25425,14 @@ components:
2539325425
example: 1.0
2539425426
format: double
2539525427
type: number
25428+
trace_rate:
25429+
description: 'Sample rate to apply to traces containing spans going through
25430+
this retention filter.
25431+
25432+
A value of 1.0 keeps all traces with spans matching the query.'
25433+
example: 1.0
25434+
format: double
25435+
type: number
2539625436
required:
2539725437
- name
2539825438
- filter
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Create a retention filter with trace rate returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_apm_retention_filters::APMRetentionFiltersAPI;
4+
use datadog_api_client::datadogV2::model::ApmRetentionFilterType;
5+
use datadog_api_client::datadogV2::model::RetentionFilterCreateAttributes;
6+
use datadog_api_client::datadogV2::model::RetentionFilterCreateData;
7+
use datadog_api_client::datadogV2::model::RetentionFilterCreateRequest;
8+
use datadog_api_client::datadogV2::model::RetentionFilterType;
9+
use datadog_api_client::datadogV2::model::SpansFilterCreate;
10+
11+
#[tokio::main]
12+
async fn main() {
13+
let body = RetentionFilterCreateRequest::new(RetentionFilterCreateData::new(
14+
RetentionFilterCreateAttributes::new(
15+
true,
16+
SpansFilterCreate::new("@http.status_code:200 service:my-service".to_string()),
17+
RetentionFilterType::SPANS_SAMPLING_PROCESSOR,
18+
"my retention filter".to_string(),
19+
1.0,
20+
)
21+
.trace_rate(1.0 as f64),
22+
ApmRetentionFilterType::apm_retention_filter,
23+
));
24+
let configuration = datadog::Configuration::new();
25+
let api = APMRetentionFiltersAPI::with_config(configuration);
26+
let resp = api.create_apm_retention_filter(body).await;
27+
if let Ok(value) = resp {
28+
println!("{:#?}", value);
29+
} else {
30+
println!("{:#?}", resp.unwrap_err());
31+
}
32+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Update a retention filter with trace rate returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_apm_retention_filters::APMRetentionFiltersAPI;
4+
use datadog_api_client::datadogV2::model::ApmRetentionFilterType;
5+
use datadog_api_client::datadogV2::model::RetentionFilterAllType;
6+
use datadog_api_client::datadogV2::model::RetentionFilterUpdateAttributes;
7+
use datadog_api_client::datadogV2::model::RetentionFilterUpdateData;
8+
use datadog_api_client::datadogV2::model::RetentionFilterUpdateRequest;
9+
use datadog_api_client::datadogV2::model::SpansFilterCreate;
10+
11+
#[tokio::main]
12+
async fn main() {
13+
// there is a valid "retention_filter" in the system
14+
let retention_filter_data_id = std::env::var("RETENTION_FILTER_DATA_ID").unwrap();
15+
let body = RetentionFilterUpdateRequest::new(RetentionFilterUpdateData::new(
16+
RetentionFilterUpdateAttributes::new(
17+
true,
18+
SpansFilterCreate::new("@_top_level:1 test:service-demo".to_string()),
19+
RetentionFilterAllType::SPANS_SAMPLING_PROCESSOR,
20+
"test".to_string(),
21+
0.9,
22+
)
23+
.trace_rate(1.0 as f64),
24+
"test-id".to_string(),
25+
ApmRetentionFilterType::apm_retention_filter,
26+
));
27+
let configuration = datadog::Configuration::new();
28+
let api = APMRetentionFiltersAPI::with_config(configuration);
29+
let resp = api
30+
.update_apm_retention_filter(retention_filter_data_id.clone(), body)
31+
.await;
32+
if let Ok(value) = resp {
33+
println!("{:#?}", value);
34+
} else {
35+
println!("{:#?}", resp.unwrap_err());
36+
}
37+
}

src/datadogV2/model/model_interface_attributes.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ pub struct InterfaceAttributes {
2020
/// The interface index
2121
#[serde(rename = "index")]
2222
pub index: Option<i64>,
23+
/// The interface IP addresses
24+
#[serde(rename = "ip_addresses")]
25+
pub ip_addresses: Option<Vec<String>>,
2326
/// The interface MAC address
2427
#[serde(rename = "mac_address")]
2528
pub mac_address: Option<String>,
@@ -42,6 +45,7 @@ impl InterfaceAttributes {
4245
alias: None,
4346
description: None,
4447
index: None,
48+
ip_addresses: None,
4549
mac_address: None,
4650
name: None,
4751
status: None,
@@ -65,6 +69,11 @@ impl InterfaceAttributes {
6569
self
6670
}
6771

72+
pub fn ip_addresses(mut self, value: Vec<String>) -> Self {
73+
self.ip_addresses = Some(value);
74+
self
75+
}
76+
6877
pub fn mac_address(mut self, value: String) -> Self {
6978
self.mac_address = Some(value);
7079
self
@@ -115,6 +124,7 @@ impl<'de> Deserialize<'de> for InterfaceAttributes {
115124
let mut alias: Option<String> = None;
116125
let mut description: Option<String> = None;
117126
let mut index: Option<i64> = None;
127+
let mut ip_addresses: Option<Vec<String>> = None;
118128
let mut mac_address: Option<String> = None;
119129
let mut name: Option<String> = None;
120130
let mut status: Option<crate::datadogV2::model::InterfaceAttributesStatus> = None;
@@ -145,6 +155,13 @@ impl<'de> Deserialize<'de> for InterfaceAttributes {
145155
}
146156
index = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
147157
}
158+
"ip_addresses" => {
159+
if v.is_null() {
160+
continue;
161+
}
162+
ip_addresses =
163+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
164+
}
148165
"mac_address" => {
149166
if v.is_null() {
150167
continue;
@@ -184,6 +201,7 @@ impl<'de> Deserialize<'de> for InterfaceAttributes {
184201
alias,
185202
description,
186203
index,
204+
ip_addresses,
187205
mac_address,
188206
name,
189207
status,

src/datadogV2/model/model_retention_filter_all_attributes.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ pub struct RetentionFilterAllAttributes {
4545
/// a value of 1.0 keeps all spans matching the query.
4646
#[serde(rename = "rate")]
4747
pub rate: Option<f64>,
48+
/// Sample rate to apply to traces containing spans going through this retention filter.
49+
/// A value of 1.0 keeps all traces with spans matching the query.
50+
#[serde(rename = "trace_rate")]
51+
pub trace_rate: Option<f64>,
4852
#[serde(flatten)]
4953
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
5054
#[serde(skip)]
@@ -66,6 +70,7 @@ impl RetentionFilterAllAttributes {
6670
modified_by: None,
6771
name: None,
6872
rate: None,
73+
trace_rate: None,
6974
additional_properties: std::collections::BTreeMap::new(),
7075
_unparsed: false,
7176
}
@@ -126,6 +131,11 @@ impl RetentionFilterAllAttributes {
126131
self
127132
}
128133

134+
pub fn trace_rate(mut self, value: f64) -> Self {
135+
self.trace_rate = Some(value);
136+
self
137+
}
138+
129139
pub fn additional_properties(
130140
mut self,
131141
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -169,6 +179,7 @@ impl<'de> Deserialize<'de> for RetentionFilterAllAttributes {
169179
let mut modified_by: Option<String> = None;
170180
let mut name: Option<String> = None;
171181
let mut rate: Option<f64> = None;
182+
let mut trace_rate: Option<f64> = None;
172183
let mut additional_properties: std::collections::BTreeMap<
173184
String,
174185
serde_json::Value,
@@ -255,6 +266,12 @@ impl<'de> Deserialize<'de> for RetentionFilterAllAttributes {
255266
}
256267
rate = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
257268
}
269+
"trace_rate" => {
270+
if v.is_null() {
271+
continue;
272+
}
273+
trace_rate = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
274+
}
258275
&_ => {
259276
if let Ok(value) = serde_json::from_value(v.clone()) {
260277
additional_properties.insert(k, value);
@@ -275,6 +292,7 @@ impl<'de> Deserialize<'de> for RetentionFilterAllAttributes {
275292
modified_by,
276293
name,
277294
rate,
295+
trace_rate,
278296
additional_properties,
279297
_unparsed,
280298
};

src/datadogV2/model/model_retention_filter_attributes.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ pub struct RetentionFilterAttributes {
4545
/// a value of 1.0 keeps all spans matching the query.
4646
#[serde(rename = "rate")]
4747
pub rate: Option<f64>,
48+
/// Sample rate to apply to traces containing spans going through this retention filter.
49+
/// A value of 1.0 keeps all traces with spans matching the query.
50+
#[serde(rename = "trace_rate")]
51+
pub trace_rate: Option<f64>,
4852
#[serde(flatten)]
4953
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
5054
#[serde(skip)]
@@ -66,6 +70,7 @@ impl RetentionFilterAttributes {
6670
modified_by: None,
6771
name: None,
6872
rate: None,
73+
trace_rate: None,
6974
additional_properties: std::collections::BTreeMap::new(),
7075
_unparsed: false,
7176
}
@@ -126,6 +131,11 @@ impl RetentionFilterAttributes {
126131
self
127132
}
128133

134+
pub fn trace_rate(mut self, value: f64) -> Self {
135+
self.trace_rate = Some(value);
136+
self
137+
}
138+
129139
pub fn additional_properties(
130140
mut self,
131141
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -169,6 +179,7 @@ impl<'de> Deserialize<'de> for RetentionFilterAttributes {
169179
let mut modified_by: Option<String> = None;
170180
let mut name: Option<String> = None;
171181
let mut rate: Option<f64> = None;
182+
let mut trace_rate: Option<f64> = None;
172183
let mut additional_properties: std::collections::BTreeMap<
173184
String,
174185
serde_json::Value,
@@ -255,6 +266,12 @@ impl<'de> Deserialize<'de> for RetentionFilterAttributes {
255266
}
256267
rate = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
257268
}
269+
"trace_rate" => {
270+
if v.is_null() {
271+
continue;
272+
}
273+
trace_rate = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
274+
}
258275
&_ => {
259276
if let Ok(value) = serde_json::from_value(v.clone()) {
260277
additional_properties.insert(k, value);
@@ -275,6 +292,7 @@ impl<'de> Deserialize<'de> for RetentionFilterAttributes {
275292
modified_by,
276293
name,
277294
rate,
295+
trace_rate,
278296
additional_properties,
279297
_unparsed,
280298
};

0 commit comments

Comments
 (0)