Skip to content

Add num_flex_logs_retention_days field to logs_indexes api spec #1771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-08-26 18:14:59.022582",
"spec_repo_commit": "0857d88a"
"regenerated": "2024-08-27 12:12:32.595463",
"spec_repo_commit": "09daef2e"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-08-26 18:14:59.040511",
"spec_repo_commit": "0857d88a"
"regenerated": "2024-08-27 12:12:32.613577",
"spec_repo_commit": "09daef2e"
}
}
}
54 changes: 44 additions & 10 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions examples/v1/logs-indexes/CreateLogsIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const params: v1.LogsIndexesApiCreateLogsIndexRequest = {
query: "source:python",
},
name: "main",
numFlexLogsRetentionDays: 360,
numRetentionDays: 15,
},
};
Expand Down
1 change: 1 addition & 0 deletions examples/v1/logs-indexes/UpdateLogsIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const params: v1.LogsIndexesApiUpdateLogsIndexRequest = {
filter: {
query: "source:python",
},
numFlexLogsRetentionDays: 360,
numRetentionDays: 15,
},
name: "name",
Expand Down
8 changes: 4 additions & 4 deletions features/v1/logs_indexes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -53,15 +53,15 @@ 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

@generated @skip @team:DataDog/logs-backend
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

Expand Down
16 changes: 14 additions & 2 deletions packages/datadog-api-client-v1/models/LogsIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,15 @@ export class LogsIndex {
*/
"name": string;
/**
* The number of days before logs are deleted from this index. Available values depend on
* retention plans specified in your organization's contract/subscriptions.
* 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.
*/
"numFlexLogsRetentionDays"?: number;
/**
* 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.
*/
"numRetentionDays"?: number;

Expand Down Expand Up @@ -98,6 +105,11 @@ export class LogsIndex {
type: "string",
required: true,
},
numFlexLogsRetentionDays: {
baseName: "num_flex_logs_retention_days",
type: "number",
format: "int64",
},
numRetentionDays: {
baseName: "num_retention_days",
type: "number",
Expand Down
21 changes: 17 additions & 4 deletions packages/datadog-api-client-v1/models/LogsIndexUpdateRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,19 @@ export class LogsIndexUpdateRequest {
*/
"filter": LogsFilter;
/**
* The number of days before logs are deleted from this index. Available values depend on
* retention plans specified in your organization's contract/subscriptions.
* 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.
*/
"numFlexLogsRetentionDays"?: number;
/**
* 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.
*/
"numRetentionDays"?: number;

Expand Down Expand Up @@ -93,6 +101,11 @@ export class LogsIndexUpdateRequest {
type: "LogsFilter",
required: true,
},
numFlexLogsRetentionDays: {
baseName: "num_flex_logs_retention_days",
type: "number",
format: "int64",
},
numRetentionDays: {
baseName: "num_retention_days",
type: "number",
Expand Down
Loading