Skip to content

Commit 4f337fa

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add num_flex_logs_retention_days field to logs_indexes api spec (#253)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 97f059e commit 4f337fa

File tree

7 files changed

+103
-24
lines changed

7 files changed

+103
-24
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": "2024-08-26 18:14:57.005234",
8-
"spec_repo_commit": "0857d88a"
7+
"regenerated": "2024-08-27 12:12:32.673802",
8+
"spec_repo_commit": "09daef2e"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-08-26 18:14:57.023212",
13-
"spec_repo_commit": "0857d88a"
12+
"regenerated": "2024-08-27 12:12:32.691295",
13+
"spec_repo_commit": "09daef2e"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5576,11 +5576,27 @@ components:
55765576
description: The name of the index.
55775577
example: main
55785578
type: string
5579+
num_flex_logs_retention_days:
5580+
description: 'The total number of days logs are stored in Standard and Flex
5581+
Tier before being deleted from the index.
5582+
5583+
If Standard Tier is enabled on this index, logs are first retained in
5584+
Standard Tier for the number of days specified through `num_retention_days`,
5585+
5586+
and then stored in Flex Tier until the number of days specified in `num_flex_logs_retention_days`
5587+
is reached.
5588+
5589+
The available values depend on retention plans specified in your organization''s
5590+
contract/subscriptions.'
5591+
example: 360
5592+
format: int64
5593+
type: integer
55795594
num_retention_days:
5580-
description: 'The number of days before logs are deleted from this index.
5581-
Available values depend on
5595+
description: 'The number of days logs are stored in Standard Tier before
5596+
aging into the Flex Tier or being deleted from the index.
55825597

5583-
retention plans specified in your organization''s contract/subscriptions.'
5598+
The available values depend on retention plans specified in your organization''s
5599+
contract/subscriptions.'
55845600
example: 15
55855601
format: int64
55865602
type: integer
@@ -5639,17 +5655,35 @@ components:
56395655
type: array
56405656
filter:
56415657
$ref: '#/components/schemas/LogsFilter'
5642-
num_retention_days:
5643-
description: 'The number of days before logs are deleted from this index.
5644-
Available values depend on
5658+
num_flex_logs_retention_days:
5659+
description: 'The total number of days logs are stored in Standard and Flex
5660+
Tier before being deleted from the index.
5661+
5662+
If Standard Tier is enabled on this index, logs are first retained in
5663+
Standard Tier for the number of days specified through `num_retention_days`,
56455664

5646-
retention plans specified in your organization''s contract/subscriptions.
5665+
and then stored in Flex Tier until the number of days specified in `num_flex_logs_retention_days`
5666+
is reached.
5667+
5668+
The available values depend on retention plans specified in your organization''s
5669+
contract/subscriptions.
5670+
5671+
5672+
**Note**: Changing this value affects all logs already in this index.
5673+
It may also affect billing.'
5674+
example: 360
5675+
format: int64
5676+
type: integer
5677+
num_retention_days:
5678+
description: 'The number of days logs are stored in Standard Tier before
5679+
aging into the Flex Tier or being deleted from the index.
56475680

5681+
The available values depend on retention plans specified in your organization''s
5682+
contract/subscriptions.
56485683

5649-
**Note:** Changing the retention for an index adjusts the length of retention
5650-
for all logs
56515684

5652-
already in this index. It may also affect billing.'
5685+
**Note**: Changing this value affects all logs already in this index.
5686+
It may also affect billing.'
56535687
example: 15
56545688
format: int64
56555689
type: integer

examples/v1_logs-indexes_CreateLogsIndex.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ async fn main() {
2222
.daily_limit_warning_threshold_percentage(70.0 as f64)
2323
.exclusion_filters(vec![LogsExclusion::new("payment".to_string())
2424
.filter(LogsExclusionFilter::new(1.0).query("*".to_string()))])
25+
.num_flex_logs_retention_days(360)
2526
.num_retention_days(15);
2627
let configuration = datadog::Configuration::new();
2728
let api = LogsIndexesAPI::with_config(configuration);

examples/v1_logs-indexes_UpdateLogsIndex.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ async fn main() {
2020
.disable_daily_limit(false)
2121
.exclusion_filters(vec![LogsExclusion::new("payment".to_string())
2222
.filter(LogsExclusionFilter::new(1.0).query("*".to_string()))])
23+
.num_flex_logs_retention_days(360)
2324
.num_retention_days(15);
2425
let configuration = datadog::Configuration::new();
2526
let api = LogsIndexesAPI::with_config(configuration);

src/datadogV1/model/model_logs_index.rs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,14 @@ pub struct LogsIndex {
3535
/// The name of the index.
3636
#[serde(rename = "name")]
3737
pub name: String,
38-
/// The number of days before logs are deleted from this index. Available values depend on
39-
/// retention plans specified in your organization's contract/subscriptions.
38+
/// The total number of days logs are stored in Standard and Flex Tier before being deleted from the index.
39+
/// If Standard Tier is enabled on this index, logs are first retained in Standard Tier for the number of days specified through `num_retention_days`,
40+
/// and then stored in Flex Tier until the number of days specified in `num_flex_logs_retention_days` is reached.
41+
/// The available values depend on retention plans specified in your organization's contract/subscriptions.
42+
#[serde(rename = "num_flex_logs_retention_days")]
43+
pub num_flex_logs_retention_days: Option<i64>,
44+
/// The number of days logs are stored in Standard Tier before aging into the Flex Tier or being deleted from the index.
45+
/// The available values depend on retention plans specified in your organization's contract/subscriptions.
4046
#[serde(rename = "num_retention_days")]
4147
pub num_retention_days: Option<i64>,
4248
#[serde(flatten)]
@@ -56,6 +62,7 @@ impl LogsIndex {
5662
filter,
5763
is_rate_limited: None,
5864
name,
65+
num_flex_logs_retention_days: None,
5966
num_retention_days: None,
6067
additional_properties: std::collections::BTreeMap::new(),
6168
_unparsed: false,
@@ -90,6 +97,11 @@ impl LogsIndex {
9097
self
9198
}
9299

100+
pub fn num_flex_logs_retention_days(mut self, value: i64) -> Self {
101+
self.num_flex_logs_retention_days = Some(value);
102+
self
103+
}
104+
93105
pub fn num_retention_days(mut self, value: i64) -> Self {
94106
self.num_retention_days = Some(value);
95107
self
@@ -130,6 +142,7 @@ impl<'de> Deserialize<'de> for LogsIndex {
130142
let mut filter: Option<crate::datadogV1::model::LogsFilter> = None;
131143
let mut is_rate_limited: Option<bool> = None;
132144
let mut name: Option<String> = None;
145+
let mut num_flex_logs_retention_days: Option<i64> = None;
133146
let mut num_retention_days: Option<i64> = None;
134147
let mut additional_properties: std::collections::BTreeMap<
135148
String,
@@ -180,6 +193,13 @@ impl<'de> Deserialize<'de> for LogsIndex {
180193
"name" => {
181194
name = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
182195
}
196+
"num_flex_logs_retention_days" => {
197+
if v.is_null() {
198+
continue;
199+
}
200+
num_flex_logs_retention_days =
201+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
202+
}
183203
"num_retention_days" => {
184204
if v.is_null() {
185205
continue;
@@ -205,6 +225,7 @@ impl<'de> Deserialize<'de> for LogsIndex {
205225
filter,
206226
is_rate_limited,
207227
name,
228+
num_flex_logs_retention_days,
208229
num_retention_days,
209230
additional_properties,
210231
_unparsed,

src/datadogV1/model/model_logs_index_update_request.rs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,18 @@ pub struct LogsIndexUpdateRequest {
3333
/// Filter for logs.
3434
#[serde(rename = "filter")]
3535
pub filter: crate::datadogV1::model::LogsFilter,
36-
/// The number of days before logs are deleted from this index. Available values depend on
37-
/// retention plans specified in your organization's contract/subscriptions.
36+
/// The total number of days logs are stored in Standard and Flex Tier before being deleted from the index.
37+
/// If Standard Tier is enabled on this index, logs are first retained in Standard Tier for the number of days specified through `num_retention_days`,
38+
/// and then stored in Flex Tier until the number of days specified in `num_flex_logs_retention_days` is reached.
39+
/// The available values depend on retention plans specified in your organization's contract/subscriptions.
3840
///
39-
/// **Note:** Changing the retention for an index adjusts the length of retention for all logs
40-
/// already in this index. It may also affect billing.
41+
/// **Note**: Changing this value affects all logs already in this index. It may also affect billing.
42+
#[serde(rename = "num_flex_logs_retention_days")]
43+
pub num_flex_logs_retention_days: Option<i64>,
44+
/// The number of days logs are stored in Standard Tier before aging into the Flex Tier or being deleted from the index.
45+
/// The available values depend on retention plans specified in your organization's contract/subscriptions.
46+
///
47+
/// **Note**: Changing this value affects all logs already in this index. It may also affect billing.
4148
#[serde(rename = "num_retention_days")]
4249
pub num_retention_days: Option<i64>,
4350
#[serde(flatten)]
@@ -56,6 +63,7 @@ impl LogsIndexUpdateRequest {
5663
disable_daily_limit: None,
5764
exclusion_filters: None,
5865
filter,
66+
num_flex_logs_retention_days: None,
5967
num_retention_days: None,
6068
additional_properties: std::collections::BTreeMap::new(),
6169
_unparsed: false,
@@ -90,6 +98,11 @@ impl LogsIndexUpdateRequest {
9098
self
9199
}
92100

101+
pub fn num_flex_logs_retention_days(mut self, value: i64) -> Self {
102+
self.num_flex_logs_retention_days = Some(value);
103+
self
104+
}
105+
93106
pub fn num_retention_days(mut self, value: i64) -> Self {
94107
self.num_retention_days = Some(value);
95108
self
@@ -129,6 +142,7 @@ impl<'de> Deserialize<'de> for LogsIndexUpdateRequest {
129142
let mut exclusion_filters: Option<Vec<crate::datadogV1::model::LogsExclusion>> =
130143
None;
131144
let mut filter: Option<crate::datadogV1::model::LogsFilter> = None;
145+
let mut num_flex_logs_retention_days: Option<i64> = None;
132146
let mut num_retention_days: Option<i64> = None;
133147
let mut additional_properties: std::collections::BTreeMap<
134148
String,
@@ -176,6 +190,13 @@ impl<'de> Deserialize<'de> for LogsIndexUpdateRequest {
176190
"filter" => {
177191
filter = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
178192
}
193+
"num_flex_logs_retention_days" => {
194+
if v.is_null() {
195+
continue;
196+
}
197+
num_flex_logs_retention_days =
198+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
199+
}
179200
"num_retention_days" => {
180201
if v.is_null() {
181202
continue;
@@ -199,6 +220,7 @@ impl<'de> Deserialize<'de> for LogsIndexUpdateRequest {
199220
disable_daily_limit,
200221
exclusion_filters,
201222
filter,
223+
num_flex_logs_retention_days,
202224
num_retention_days,
203225
additional_properties,
204226
_unparsed,

tests/scenarios/features/v1/logs_indexes.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ Feature: Logs Indexes
1212
@generated @skip @team:DataDog/logs-backend
1313
Scenario: Create an index returns "Invalid Parameter Error" response
1414
Given new "CreateLogsIndex" request
15-
And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_retention_days": 15}
15+
And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15}
1616
When the request is sent
1717
Then the response status is 400 Invalid Parameter Error
1818

1919
@generated @skip @team:DataDog/logs-backend
2020
Scenario: Create an index returns "OK" response
2121
Given new "CreateLogsIndex" request
22-
And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_retention_days": 15}
22+
And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15}
2323
When the request is sent
2424
Then the response status is 200 OK
2525

@@ -53,15 +53,15 @@ Feature: Logs Indexes
5353
Scenario: Update an index returns "Invalid Parameter Error" response
5454
Given new "UpdateLogsIndex" request
5555
And request contains "name" parameter from "REPLACE.ME"
56-
And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "disable_daily_limit": false, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_retention_days": 15}
56+
And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "disable_daily_limit": false, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_flex_logs_retention_days": 360, "num_retention_days": 15}
5757
When the request is sent
5858
Then the response status is 400 Invalid Parameter Error
5959

6060
@generated @skip @team:DataDog/logs-backend
6161
Scenario: Update an index returns "OK" response
6262
Given new "UpdateLogsIndex" request
6363
And request contains "name" parameter from "REPLACE.ME"
64-
And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "disable_daily_limit": false, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_retention_days": 15}
64+
And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "disable_daily_limit": false, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_flex_logs_retention_days": 360, "num_retention_days": 15}
6565
When the request is sent
6666
Then the response status is 200 OK
6767

0 commit comments

Comments
 (0)