Skip to content

Commit baebe4d

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add num_flex_logs_retention_days field to logs_indexes api spec (#2119)
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 eb15837 commit baebe4d

File tree

7 files changed

+83
-24
lines changed

7 files changed

+83
-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:51.589283",
8-
"spec_repo_commit": "0857d88a"
7+
"regenerated": "2024-08-27 12:12:27.969266",
8+
"spec_repo_commit": "09daef2e"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-08-26 18:14:51.607938",
13-
"spec_repo_commit": "0857d88a"
12+
"regenerated": "2024-08-27 12:12:27.987178",
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.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
query="source:python",
3131
),
3232
name="main",
33+
num_flex_logs_retention_days=360,
3334
num_retention_days=15,
3435
)
3536

examples/v1/logs-indexes/UpdateLogsIndex.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
filter=LogsFilter(
3131
query="source:python",
3232
),
33+
num_flex_logs_retention_days=360,
3334
num_retention_days=15,
3435
)
3536

src/datadog_api_client/v1/model/logs_index.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def openapi_types(_):
4141
"filter": (LogsFilter,),
4242
"is_rate_limited": (bool,),
4343
"name": (str,),
44+
"num_flex_logs_retention_days": (int,),
4445
"num_retention_days": (int,),
4546
}
4647

@@ -52,6 +53,7 @@ def openapi_types(_):
5253
"filter": "filter",
5354
"is_rate_limited": "is_rate_limited",
5455
"name": "name",
56+
"num_flex_logs_retention_days": "num_flex_logs_retention_days",
5557
"num_retention_days": "num_retention_days",
5658
}
5759
read_only_vars = {
@@ -67,6 +69,7 @@ def __init__(
6769
daily_limit_warning_threshold_percentage: Union[float, UnsetType] = unset,
6870
exclusion_filters: Union[List[LogsExclusion], UnsetType] = unset,
6971
is_rate_limited: Union[bool, UnsetType] = unset,
72+
num_flex_logs_retention_days: Union[int, UnsetType] = unset,
7073
num_retention_days: Union[int, UnsetType] = unset,
7174
**kwargs,
7275
):
@@ -97,8 +100,14 @@ def __init__(
97100
:param name: The name of the index.
98101
:type name: str
99102
100-
:param num_retention_days: The number of days before logs are deleted from this index. Available values depend on
101-
retention plans specified in your organization's contract/subscriptions.
103+
:param num_flex_logs_retention_days: The total number of days logs are stored in Standard and Flex Tier before being deleted from the index.
104+
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`` ,
105+
and then stored in Flex Tier until the number of days specified in ``num_flex_logs_retention_days`` is reached.
106+
The available values depend on retention plans specified in your organization's contract/subscriptions.
107+
:type num_flex_logs_retention_days: int, optional
108+
109+
:param num_retention_days: The number of days logs are stored in Standard Tier before aging into the Flex Tier or being deleted from the index.
110+
The available values depend on retention plans specified in your organization's contract/subscriptions.
102111
:type num_retention_days: int, optional
103112
"""
104113
if daily_limit is not unset:
@@ -111,6 +120,8 @@ def __init__(
111120
kwargs["exclusion_filters"] = exclusion_filters
112121
if is_rate_limited is not unset:
113122
kwargs["is_rate_limited"] = is_rate_limited
123+
if num_flex_logs_retention_days is not unset:
124+
kwargs["num_flex_logs_retention_days"] = num_flex_logs_retention_days
114125
if num_retention_days is not unset:
115126
kwargs["num_retention_days"] = num_retention_days
116127
super().__init__(kwargs)

src/datadog_api_client/v1/model/logs_index_update_request.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def openapi_types(_):
4040
"disable_daily_limit": (bool,),
4141
"exclusion_filters": ([LogsExclusion],),
4242
"filter": (LogsFilter,),
43+
"num_flex_logs_retention_days": (int,),
4344
"num_retention_days": (int,),
4445
}
4546

@@ -50,6 +51,7 @@ def openapi_types(_):
5051
"disable_daily_limit": "disable_daily_limit",
5152
"exclusion_filters": "exclusion_filters",
5253
"filter": "filter",
54+
"num_flex_logs_retention_days": "num_flex_logs_retention_days",
5355
"num_retention_days": "num_retention_days",
5456
}
5557

@@ -61,6 +63,7 @@ def __init__(
6163
daily_limit_warning_threshold_percentage: Union[float, UnsetType] = unset,
6264
disable_daily_limit: Union[bool, UnsetType] = unset,
6365
exclusion_filters: Union[List[LogsExclusion], UnsetType] = unset,
66+
num_flex_logs_retention_days: Union[int, UnsetType] = unset,
6467
num_retention_days: Union[int, UnsetType] = unset,
6568
**kwargs,
6669
):
@@ -89,11 +92,18 @@ def __init__(
8992
:param filter: Filter for logs.
9093
:type filter: LogsFilter
9194
92-
:param num_retention_days: The number of days before logs are deleted from this index. Available values depend on
93-
retention plans specified in your organization's contract/subscriptions.
95+
:param num_flex_logs_retention_days: The total number of days logs are stored in Standard and Flex Tier before being deleted from the index.
96+
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`` ,
97+
and then stored in Flex Tier until the number of days specified in ``num_flex_logs_retention_days`` is reached.
98+
The available values depend on retention plans specified in your organization's contract/subscriptions.
9499
95-
**Note:** Changing the retention for an index adjusts the length of retention for all logs
96-
already in this index. It may also affect billing.
100+
**Note** : Changing this value affects all logs already in this index. It may also affect billing.
101+
:type num_flex_logs_retention_days: int, optional
102+
103+
:param num_retention_days: The number of days logs are stored in Standard Tier before aging into the Flex Tier or being deleted from the index.
104+
The available values depend on retention plans specified in your organization's contract/subscriptions.
105+
106+
**Note** : Changing this value affects all logs already in this index. It may also affect billing.
97107
:type num_retention_days: int, optional
98108
"""
99109
if daily_limit is not unset:
@@ -106,6 +116,8 @@ def __init__(
106116
kwargs["disable_daily_limit"] = disable_daily_limit
107117
if exclusion_filters is not unset:
108118
kwargs["exclusion_filters"] = exclusion_filters
119+
if num_flex_logs_retention_days is not unset:
120+
kwargs["num_flex_logs_retention_days"] = num_flex_logs_retention_days
109121
if num_retention_days is not unset:
110122
kwargs["num_retention_days"] = num_retention_days
111123
super().__init__(kwargs)

tests/v1/features/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)