diff --git a/.apigentools-info b/.apigentools-info index 40ed234683..9f8fba1102 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-08-26 18:14:51.589283", - "spec_repo_commit": "0857d88a" + "regenerated": "2024-08-27 12:12:27.969266", + "spec_repo_commit": "09daef2e" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-08-26 18:14:51.607938", - "spec_repo_commit": "0857d88a" + "regenerated": "2024-08-27 12:12:27.987178", + "spec_repo_commit": "09daef2e" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index d0a4c167da..8942f45728 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -5576,11 +5576,27 @@ components: description: The name of the index. example: main type: string + num_flex_logs_retention_days: + description: 'The total number of days logs are stored in Standard and Flex + Tier before being deleted from the index. + + 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`, + + and then stored in Flex Tier until the number of days specified in `num_flex_logs_retention_days` + is reached. + + The available values depend on retention plans specified in your organization''s + contract/subscriptions.' + example: 360 + format: int64 + type: integer num_retention_days: - description: 'The number of days before logs are deleted from this index. - Available values depend on + description: 'The number of days logs are stored in Standard Tier before + aging into the Flex Tier or being deleted from the index. - retention plans specified in your organization''s contract/subscriptions.' + The available values depend on retention plans specified in your organization''s + contract/subscriptions.' example: 15 format: int64 type: integer @@ -5639,17 +5655,35 @@ components: type: array filter: $ref: '#/components/schemas/LogsFilter' - num_retention_days: - description: 'The number of days before logs are deleted from this index. - Available values depend on + num_flex_logs_retention_days: + description: 'The total number of days logs are stored in Standard and Flex + Tier before being deleted from the index. + + 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`, - retention plans specified in your organization''s contract/subscriptions. + and then stored in Flex Tier until the number of days specified in `num_flex_logs_retention_days` + is reached. + + The available values depend on retention plans specified in your organization''s + contract/subscriptions. + + + **Note**: Changing this value affects all logs already in this index. + It may also affect billing.' + example: 360 + format: int64 + type: integer + num_retention_days: + description: 'The number of days logs are stored in Standard Tier before + aging into the Flex Tier or being deleted from the index. + The available values depend on retention plans specified in your organization''s + contract/subscriptions. - **Note:** Changing the retention for an index adjusts the length of retention - for all logs - already in this index. It may also affect billing.' + **Note**: Changing this value affects all logs already in this index. + It may also affect billing.' example: 15 format: int64 type: integer diff --git a/examples/v1/logs-indexes/CreateLogsIndex.py b/examples/v1/logs-indexes/CreateLogsIndex.py index 5dbcaac11b..c6d18c4c03 100644 --- a/examples/v1/logs-indexes/CreateLogsIndex.py +++ b/examples/v1/logs-indexes/CreateLogsIndex.py @@ -30,6 +30,7 @@ query="source:python", ), name="main", + num_flex_logs_retention_days=360, num_retention_days=15, ) diff --git a/examples/v1/logs-indexes/UpdateLogsIndex.py b/examples/v1/logs-indexes/UpdateLogsIndex.py index e0c3104fde..85d58bdaf7 100644 --- a/examples/v1/logs-indexes/UpdateLogsIndex.py +++ b/examples/v1/logs-indexes/UpdateLogsIndex.py @@ -30,6 +30,7 @@ filter=LogsFilter( query="source:python", ), + num_flex_logs_retention_days=360, num_retention_days=15, ) diff --git a/src/datadog_api_client/v1/model/logs_index.py b/src/datadog_api_client/v1/model/logs_index.py index 59368cad9e..07f210be98 100644 --- a/src/datadog_api_client/v1/model/logs_index.py +++ b/src/datadog_api_client/v1/model/logs_index.py @@ -41,6 +41,7 @@ def openapi_types(_): "filter": (LogsFilter,), "is_rate_limited": (bool,), "name": (str,), + "num_flex_logs_retention_days": (int,), "num_retention_days": (int,), } @@ -52,6 +53,7 @@ def openapi_types(_): "filter": "filter", "is_rate_limited": "is_rate_limited", "name": "name", + "num_flex_logs_retention_days": "num_flex_logs_retention_days", "num_retention_days": "num_retention_days", } read_only_vars = { @@ -67,6 +69,7 @@ def __init__( daily_limit_warning_threshold_percentage: Union[float, UnsetType] = unset, exclusion_filters: Union[List[LogsExclusion], UnsetType] = unset, is_rate_limited: Union[bool, UnsetType] = unset, + num_flex_logs_retention_days: Union[int, UnsetType] = unset, num_retention_days: Union[int, UnsetType] = unset, **kwargs, ): @@ -97,8 +100,14 @@ def __init__( :param name: The name of the index. :type name: str - :param num_retention_days: The number of days before logs are deleted from this index. Available values depend on - retention plans specified in your organization's contract/subscriptions. + :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. + 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`` , + and then stored in Flex Tier until the number of days specified in ``num_flex_logs_retention_days`` is reached. + The available values depend on retention plans specified in your organization's contract/subscriptions. + :type num_flex_logs_retention_days: int, optional + + :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. + The available values depend on retention plans specified in your organization's contract/subscriptions. :type num_retention_days: int, optional """ if daily_limit is not unset: @@ -111,6 +120,8 @@ def __init__( kwargs["exclusion_filters"] = exclusion_filters if is_rate_limited is not unset: kwargs["is_rate_limited"] = is_rate_limited + if num_flex_logs_retention_days is not unset: + kwargs["num_flex_logs_retention_days"] = num_flex_logs_retention_days if num_retention_days is not unset: kwargs["num_retention_days"] = num_retention_days super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/logs_index_update_request.py b/src/datadog_api_client/v1/model/logs_index_update_request.py index c435ee46d4..5e91b459dd 100644 --- a/src/datadog_api_client/v1/model/logs_index_update_request.py +++ b/src/datadog_api_client/v1/model/logs_index_update_request.py @@ -40,6 +40,7 @@ def openapi_types(_): "disable_daily_limit": (bool,), "exclusion_filters": ([LogsExclusion],), "filter": (LogsFilter,), + "num_flex_logs_retention_days": (int,), "num_retention_days": (int,), } @@ -50,6 +51,7 @@ def openapi_types(_): "disable_daily_limit": "disable_daily_limit", "exclusion_filters": "exclusion_filters", "filter": "filter", + "num_flex_logs_retention_days": "num_flex_logs_retention_days", "num_retention_days": "num_retention_days", } @@ -61,6 +63,7 @@ def __init__( daily_limit_warning_threshold_percentage: Union[float, UnsetType] = unset, disable_daily_limit: Union[bool, UnsetType] = unset, exclusion_filters: Union[List[LogsExclusion], UnsetType] = unset, + num_flex_logs_retention_days: Union[int, UnsetType] = unset, num_retention_days: Union[int, UnsetType] = unset, **kwargs, ): @@ -89,11 +92,18 @@ def __init__( :param filter: Filter for logs. :type filter: LogsFilter - :param num_retention_days: The number of days before logs are deleted from this index. Available values depend on - retention plans specified in your organization's contract/subscriptions. + :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. + 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`` , + and then stored in Flex Tier until the number of days specified in ``num_flex_logs_retention_days`` is reached. + The available values depend on retention plans specified in your organization's contract/subscriptions. - **Note:** Changing the retention for an index adjusts the length of retention for all logs - already in this index. It may also affect billing. + **Note** : Changing this value affects all logs already in this index. It may also affect billing. + :type num_flex_logs_retention_days: int, optional + + :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. + The available values depend on retention plans specified in your organization's contract/subscriptions. + + **Note** : Changing this value affects all logs already in this index. It may also affect billing. :type num_retention_days: int, optional """ if daily_limit is not unset: @@ -106,6 +116,8 @@ def __init__( kwargs["disable_daily_limit"] = disable_daily_limit if exclusion_filters is not unset: kwargs["exclusion_filters"] = exclusion_filters + if num_flex_logs_retention_days is not unset: + kwargs["num_flex_logs_retention_days"] = num_flex_logs_retention_days if num_retention_days is not unset: kwargs["num_retention_days"] = num_retention_days super().__init__(kwargs) diff --git a/tests/v1/features/logs_indexes.feature b/tests/v1/features/logs_indexes.feature index 8d982e9546..76b2d87a49 100644 --- a/tests/v1/features/logs_indexes.feature +++ b/tests/v1/features/logs_indexes.feature @@ -12,14 +12,14 @@ Feature: Logs Indexes @generated @skip @team:DataDog/logs-backend Scenario: Create an index returns "Invalid Parameter Error" response Given new "CreateLogsIndex" request - 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} + 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} When the request is sent Then the response status is 400 Invalid Parameter Error @generated @skip @team:DataDog/logs-backend Scenario: Create an index returns "OK" response Given new "CreateLogsIndex" request - 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} + 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} When the request is sent Then the response status is 200 OK @@ -53,7 +53,7 @@ Feature: Logs Indexes Scenario: Update an index returns "Invalid Parameter Error" response Given new "UpdateLogsIndex" request And request contains "name" parameter from "REPLACE.ME" - 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} + 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} When the request is sent Then the response status is 400 Invalid Parameter Error @@ -61,7 +61,7 @@ Feature: Logs Indexes Scenario: Update an index returns "OK" response Given new "UpdateLogsIndex" request And request contains "name" parameter from "REPLACE.ME" - 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} + 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} When the request is sent Then the response status is 200 OK