Skip to content
Open
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
12 changes: 12 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7265,6 +7265,12 @@ components:
maximum: 99.99
minimum: 50
type: number
description:
description: |-
A description of the index, to help explain its purpose or configuration to other users.
Maximum length of 250 characters.
example: "Contains logs matching the criteria defined by the filter."
type: string
exclusion_filters:
description: |-
An array of exclusion objects. The logs are tested against the query of each filter,
Expand Down Expand Up @@ -7339,6 +7345,12 @@ components:
maximum: 99.99
minimum: 50
type: number
description:
description: |-
A description of the index, to help explain its purpose or configuration to other users.
Maximum length of 250 characters.
example: "Contains logs matching the criteria defined by the filter."
type: string
disable_daily_limit:
description: |-
If true, sets the `daily_limit` value to null and the index is not limited on a daily basis (any
Expand Down
1 change: 1 addition & 0 deletions examples/v1/logs-indexes/CreateLogsIndex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
reset_utc_offset: "+02:00",
}),
daily_limit_warning_threshold_percentage: 70,
description: "Contains logs matching the criteria defined by the filter.",
exclusion_filters: [
DatadogAPIClient::V1::LogsExclusion.new({
filter: DatadogAPIClient::V1::LogsExclusionFilter.new({
Expand Down
1 change: 1 addition & 0 deletions examples/v1/logs-indexes/UpdateLogsIndex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
reset_utc_offset: "+02:00",
}),
daily_limit_warning_threshold_percentage: 70,
description: "Contains logs matching the criteria defined by the filter.",
disable_daily_limit: false,
exclusion_filters: [
DatadogAPIClient::V1::LogsExclusion.new({
Expand Down
10 changes: 5 additions & 5 deletions features/v1/logs_indexes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ Feature: Logs Indexes
@generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core
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_attribute": "@ci.job_id", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]}
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, "description": "Contains logs matching the criteria defined by the filter.", "exclusion_filters": [{"filter": {"query": "*", "sample_attribute": "@ci.job_id", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]}
When the request is sent
Then the response status is 400 Invalid Parameter Error

@generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core
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_attribute": "@ci.job_id", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]}
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, "description": "Contains logs matching the criteria defined by the filter.", "exclusion_filters": [{"filter": {"query": "*", "sample_attribute": "@ci.job_id", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core
Scenario: Create an index returns "Unprocessable Entity" 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_attribute": "@ci.job_id", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]}
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, "description": "Contains logs matching the criteria defined by the filter.", "exclusion_filters": [{"filter": {"query": "*", "sample_attribute": "@ci.job_id", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]}
When the request is sent
Then the response status is 422 Unprocessable Entity

Expand Down Expand Up @@ -73,15 +73,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_attribute": "@ci.job_id", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]}
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, "description": "Contains logs matching the criteria defined by the filter.", "disable_daily_limit": false, "exclusion_filters": [{"filter": {"query": "*", "sample_attribute": "@ci.job_id", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]}
When the request is sent
Then the response status is 400 Invalid Parameter Error

@generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core
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_attribute": "@ci.job_id", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]}
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, "description": "Contains logs matching the criteria defined by the filter.", "disable_daily_limit": false, "exclusion_filters": [{"filter": {"query": "*", "sample_attribute": "@ci.job_id", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]}
When the request is sent
Then the response status is 200 OK

Expand Down
13 changes: 12 additions & 1 deletion lib/datadog_api_client/v1/models/logs_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class LogsIndex
# A percentage threshold of the daily quota at which a Datadog warning event is generated.
attr_reader :daily_limit_warning_threshold_percentage

# A description of the index, to help explain its purpose or configuration to other users.
# Maximum length of 250 characters.
attr_accessor :description

# An array of exclusion objects. The logs are tested against the query of each filter,
# following the order of the array. Only the first matching active exclusion matters,
# others (if any) are ignored.
Expand Down Expand Up @@ -67,6 +71,7 @@ def self.attribute_map
:'daily_limit' => :'daily_limit',
:'daily_limit_reset' => :'daily_limit_reset',
:'daily_limit_warning_threshold_percentage' => :'daily_limit_warning_threshold_percentage',
:'description' => :'description',
:'exclusion_filters' => :'exclusion_filters',
:'filter' => :'filter',
:'is_rate_limited' => :'is_rate_limited',
Expand All @@ -84,6 +89,7 @@ def self.openapi_types
:'daily_limit' => :'Integer',
:'daily_limit_reset' => :'LogsDailyLimitReset',
:'daily_limit_warning_threshold_percentage' => :'Float',
:'description' => :'String',
:'exclusion_filters' => :'Array<LogsExclusion>',
:'filter' => :'LogsFilter',
:'is_rate_limited' => :'Boolean',
Expand Down Expand Up @@ -124,6 +130,10 @@ def initialize(attributes = {})
self.daily_limit_warning_threshold_percentage = attributes[:'daily_limit_warning_threshold_percentage']
end

if attributes.key?(:'description')
self.description = attributes[:'description']
end

if attributes.key?(:'exclusion_filters')
if (value = attributes[:'exclusion_filters']).is_a?(Array)
self.exclusion_filters = value
Expand Down Expand Up @@ -230,6 +240,7 @@ def ==(o)
daily_limit == o.daily_limit &&
daily_limit_reset == o.daily_limit_reset &&
daily_limit_warning_threshold_percentage == o.daily_limit_warning_threshold_percentage &&
description == o.description &&
exclusion_filters == o.exclusion_filters &&
filter == o.filter &&
is_rate_limited == o.is_rate_limited &&
Expand All @@ -244,7 +255,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[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, tags, additional_properties].hash
[daily_limit, daily_limit_reset, daily_limit_warning_threshold_percentage, description, exclusion_filters, filter, is_rate_limited, name, num_flex_logs_retention_days, num_retention_days, tags, additional_properties].hash
end
end
end
13 changes: 12 additions & 1 deletion lib/datadog_api_client/v1/models/logs_index_update_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class LogsIndexUpdateRequest
# A percentage threshold of the daily quota at which a Datadog warning event is generated.
attr_reader :daily_limit_warning_threshold_percentage

# A description of the index, to help explain its purpose or configuration to other users.
# Maximum length of 250 characters.
attr_accessor :description

# If true, sets the `daily_limit` value to null and the index is not limited on a daily basis (any
# specified `daily_limit` value in the request is ignored). If false or omitted, the index's current
# `daily_limit` is maintained.
Expand Down Expand Up @@ -69,6 +73,7 @@ def self.attribute_map
:'daily_limit' => :'daily_limit',
:'daily_limit_reset' => :'daily_limit_reset',
:'daily_limit_warning_threshold_percentage' => :'daily_limit_warning_threshold_percentage',
:'description' => :'description',
:'disable_daily_limit' => :'disable_daily_limit',
:'exclusion_filters' => :'exclusion_filters',
:'filter' => :'filter',
Expand All @@ -85,6 +90,7 @@ def self.openapi_types
:'daily_limit' => :'Integer',
:'daily_limit_reset' => :'LogsDailyLimitReset',
:'daily_limit_warning_threshold_percentage' => :'Float',
:'description' => :'String',
:'disable_daily_limit' => :'Boolean',
:'exclusion_filters' => :'Array<LogsExclusion>',
:'filter' => :'LogsFilter',
Expand Down Expand Up @@ -124,6 +130,10 @@ def initialize(attributes = {})
self.daily_limit_warning_threshold_percentage = attributes[:'daily_limit_warning_threshold_percentage']
end

if attributes.key?(:'description')
self.description = attributes[:'description']
end

if attributes.key?(:'disable_daily_limit')
self.disable_daily_limit = attributes[:'disable_daily_limit']
end
Expand Down Expand Up @@ -215,6 +225,7 @@ def ==(o)
daily_limit == o.daily_limit &&
daily_limit_reset == o.daily_limit_reset &&
daily_limit_warning_threshold_percentage == o.daily_limit_warning_threshold_percentage &&
description == o.description &&
disable_daily_limit == o.disable_daily_limit &&
exclusion_filters == o.exclusion_filters &&
filter == o.filter &&
Expand All @@ -228,7 +239,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[daily_limit, daily_limit_reset, daily_limit_warning_threshold_percentage, disable_daily_limit, exclusion_filters, filter, num_flex_logs_retention_days, num_retention_days, tags, additional_properties].hash
[daily_limit, daily_limit_reset, daily_limit_warning_threshold_percentage, description, disable_daily_limit, exclusion_filters, filter, num_flex_logs_retention_days, num_retention_days, tags, additional_properties].hash
end
end
end
Loading