Skip to content

Commit 877da7b

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add num_flex_logs_retention_days field to logs_indexes api spec (#1967)
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 67ce41b commit 877da7b

File tree

7 files changed

+89
-26
lines changed

7 files changed

+89
-26
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:52.742428",
8-
"spec_repo_commit": "0857d88a"
7+
"regenerated": "2024-08-27 12:12:28.154237",
8+
"spec_repo_commit": "09daef2e"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-08-26 18:14:52.760097",
13-
"spec_repo_commit": "0857d88a"
12+
"regenerated": "2024-08-27 12:12:28.172796",
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.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
query: "source:python",
2424
}),
2525
name: "main",
26+
num_flex_logs_retention_days: 360,
2627
num_retention_days: 15,
2728
})
2829
p api_instance.create_logs_index(body)

examples/v1/logs-indexes/UpdateLogsIndex.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
filter: DatadogAPIClient::V1::LogsFilter.new({
2424
query: "source:python",
2525
}),
26+
num_flex_logs_retention_days: 360,
2627
num_retention_days: 15,
2728
})
2829
p api_instance.update_logs_index("name", body)

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

lib/datadog_api_client/v1/models/logs_index.rb

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,14 @@ class LogsIndex
4545
# The name of the index.
4646
attr_reader :name
4747

48-
# The number of days before logs are deleted from this index. Available values depend on
49-
# retention plans specified in your organization's contract/subscriptions.
48+
# The total number of days logs are stored in Standard and Flex Tier before being deleted from the index.
49+
# 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`,
50+
# and then stored in Flex Tier until the number of days specified in `num_flex_logs_retention_days` is reached.
51+
# The available values depend on retention plans specified in your organization's contract/subscriptions.
52+
attr_accessor :num_flex_logs_retention_days
53+
54+
# The number of days logs are stored in Standard Tier before aging into the Flex Tier or being deleted from the index.
55+
# The available values depend on retention plans specified in your organization's contract/subscriptions.
5056
attr_accessor :num_retention_days
5157

5258
attr_accessor :additional_properties
@@ -62,6 +68,7 @@ def self.attribute_map
6268
:'filter' => :'filter',
6369
:'is_rate_limited' => :'is_rate_limited',
6470
:'name' => :'name',
71+
:'num_flex_logs_retention_days' => :'num_flex_logs_retention_days',
6572
:'num_retention_days' => :'num_retention_days'
6673
}
6774
end
@@ -77,6 +84,7 @@ def self.openapi_types
7784
:'filter' => :'LogsFilter',
7885
:'is_rate_limited' => :'Boolean',
7986
:'name' => :'String',
87+
:'num_flex_logs_retention_days' => :'Integer',
8088
:'num_retention_days' => :'Integer'
8189
}
8290
end
@@ -129,6 +137,10 @@ def initialize(attributes = {})
129137
self.name = attributes[:'name']
130138
end
131139

140+
if attributes.key?(:'num_flex_logs_retention_days')
141+
self.num_flex_logs_retention_days = attributes[:'num_flex_logs_retention_days']
142+
end
143+
132144
if attributes.key?(:'num_retention_days')
133145
self.num_retention_days = attributes[:'num_retention_days']
134146
end
@@ -211,6 +223,7 @@ def ==(o)
211223
filter == o.filter &&
212224
is_rate_limited == o.is_rate_limited &&
213225
name == o.name &&
226+
num_flex_logs_retention_days == o.num_flex_logs_retention_days &&
214227
num_retention_days == o.num_retention_days
215228
additional_properties == o.additional_properties
216229
end
@@ -219,7 +232,7 @@ def ==(o)
219232
# @return [Integer] Hash code
220233
# @!visibility private
221234
def hash
222-
[daily_limit, daily_limit_reset, daily_limit_warning_threshold_percentage, exclusion_filters, filter, is_rate_limited, name, num_retention_days].hash
235+
[daily_limit, daily_limit_reset, daily_limit_warning_threshold_percentage, exclusion_filters, filter, is_rate_limited, name, num_flex_logs_retention_days, num_retention_days].hash
223236
end
224237
end
225238
end

lib/datadog_api_client/v1/models/logs_index_update_request.rb

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,18 @@ class LogsIndexUpdateRequest
4343
# Filter for logs.
4444
attr_reader :filter
4545

46-
# The number of days before logs are deleted from this index. Available values depend on
47-
# retention plans specified in your organization's contract/subscriptions.
46+
# The total number of days logs are stored in Standard and Flex Tier before being deleted from the index.
47+
# 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`,
48+
# and then stored in Flex Tier until the number of days specified in `num_flex_logs_retention_days` is reached.
49+
# The available values depend on retention plans specified in your organization's contract/subscriptions.
4850
#
49-
# **Note:** Changing the retention for an index adjusts the length of retention for all logs
50-
# already in this index. It may also affect billing.
51+
# **Note**: Changing this value affects all logs already in this index. It may also affect billing.
52+
attr_accessor :num_flex_logs_retention_days
53+
54+
# The number of days logs are stored in Standard Tier before aging into the Flex Tier or being deleted from the index.
55+
# The available values depend on retention plans specified in your organization's contract/subscriptions.
56+
#
57+
# **Note**: Changing this value affects all logs already in this index. It may also affect billing.
5158
attr_accessor :num_retention_days
5259

5360
attr_accessor :additional_properties
@@ -62,6 +69,7 @@ def self.attribute_map
6269
:'disable_daily_limit' => :'disable_daily_limit',
6370
:'exclusion_filters' => :'exclusion_filters',
6471
:'filter' => :'filter',
72+
:'num_flex_logs_retention_days' => :'num_flex_logs_retention_days',
6573
:'num_retention_days' => :'num_retention_days'
6674
}
6775
end
@@ -76,6 +84,7 @@ def self.openapi_types
7684
:'disable_daily_limit' => :'Boolean',
7785
:'exclusion_filters' => :'Array<LogsExclusion>',
7886
:'filter' => :'LogsFilter',
87+
:'num_flex_logs_retention_days' => :'Integer',
7988
:'num_retention_days' => :'Integer'
8089
}
8190
end
@@ -124,6 +133,10 @@ def initialize(attributes = {})
124133
self.filter = attributes[:'filter']
125134
end
126135

136+
if attributes.key?(:'num_flex_logs_retention_days')
137+
self.num_flex_logs_retention_days = attributes[:'num_flex_logs_retention_days']
138+
end
139+
127140
if attributes.key?(:'num_retention_days')
128141
self.num_retention_days = attributes[:'num_retention_days']
129142
end
@@ -194,6 +207,7 @@ def ==(o)
194207
disable_daily_limit == o.disable_daily_limit &&
195208
exclusion_filters == o.exclusion_filters &&
196209
filter == o.filter &&
210+
num_flex_logs_retention_days == o.num_flex_logs_retention_days &&
197211
num_retention_days == o.num_retention_days
198212
additional_properties == o.additional_properties
199213
end
@@ -202,7 +216,7 @@ def ==(o)
202216
# @return [Integer] Hash code
203217
# @!visibility private
204218
def hash
205-
[daily_limit, daily_limit_reset, daily_limit_warning_threshold_percentage, disable_daily_limit, exclusion_filters, filter, num_retention_days].hash
219+
[daily_limit, daily_limit_reset, daily_limit_warning_threshold_percentage, disable_daily_limit, exclusion_filters, filter, num_flex_logs_retention_days, num_retention_days].hash
206220
end
207221
end
208222
end

0 commit comments

Comments
 (0)