diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 3013d46b7cb4..82417bdc1911 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -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, @@ -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 diff --git a/examples/v1/logs-indexes/CreateLogsIndex.rb b/examples/v1/logs-indexes/CreateLogsIndex.rb index 78b4d22c20de..edf75b54f010 100644 --- a/examples/v1/logs-indexes/CreateLogsIndex.rb +++ b/examples/v1/logs-indexes/CreateLogsIndex.rb @@ -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({ diff --git a/examples/v1/logs-indexes/UpdateLogsIndex.rb b/examples/v1/logs-indexes/UpdateLogsIndex.rb index 20af8ae09f13..4e56d0ac1782 100644 --- a/examples/v1/logs-indexes/UpdateLogsIndex.rb +++ b/examples/v1/logs-indexes/UpdateLogsIndex.rb @@ -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({ diff --git a/features/v1/logs_indexes.feature b/features/v1/logs_indexes.feature index 4091527029ba..d3f0b48fe154 100644 --- a/features/v1/logs_indexes.feature +++ b/features/v1/logs_indexes.feature @@ -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 @@ -73,7 +73,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_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 @@ -81,7 +81,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_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 diff --git a/lib/datadog_api_client/v1/models/logs_index.rb b/lib/datadog_api_client/v1/models/logs_index.rb index aa72bcc5cccc..26b3c6649bf9 100644 --- a/lib/datadog_api_client/v1/models/logs_index.rb +++ b/lib/datadog_api_client/v1/models/logs_index.rb @@ -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. @@ -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', @@ -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', :'filter' => :'LogsFilter', :'is_rate_limited' => :'Boolean', @@ -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 @@ -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 && @@ -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 diff --git a/lib/datadog_api_client/v1/models/logs_index_update_request.rb b/lib/datadog_api_client/v1/models/logs_index_update_request.rb index 534812e4fd3b..4a513b9f8bfd 100644 --- a/lib/datadog_api_client/v1/models/logs_index_update_request.rb +++ b/lib/datadog_api_client/v1/models/logs_index_update_request.rb @@ -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. @@ -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', @@ -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', :'filter' => :'LogsFilter', @@ -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 @@ -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 && @@ -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