From 5fb290202340673d05a982fe2c4897a8b580bd70 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 26 Mar 2026 13:53:56 +0000 Subject: [PATCH] Regenerate client from commit d3fa54d of spec repo --- .generator/schemas/v1/openapi.yaml | 8 +++++++- examples/v1/logs-indexes/CreateLogsIndex.rb | 1 + examples/v1/logs-indexes/UpdateLogsIndex.rb | 1 + features/v1/logs_indexes.feature | 10 +++++----- lib/datadog_api_client/v1/api/logs_indexes_api.rb | 2 +- .../v1/models/logs_exclusion_filter.rb | 13 ++++++++++++- 6 files changed, 27 insertions(+), 8 deletions(-) diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 4b8fb50414e5..1e953cb02924 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -5931,6 +5931,12 @@ components: Scope down exclusion filter to only a subset of logs with a log query. example: "*" type: string + sample_attribute: + description: |- + Sample attribute to use for the sampling of logs going through this exclusion filter. + When set, only the logs with the specified attribute are sampled. + example: "@ci.job_id" + type: string sample_rate: description: |- Sample rate to apply to logs going through this exclusion filter, @@ -29894,7 +29900,7 @@ paths: Update an index as identified by its name. Returns the Index object passed in the request body when the request is successful. - Using the `PUT` method updates your index’s configuration by **replacing** + Using the `PUT` method updates your index's configuration by **replacing** your current configuration with the new one sent to your Datadog organization. operationId: UpdateLogsIndex parameters: diff --git a/examples/v1/logs-indexes/CreateLogsIndex.rb b/examples/v1/logs-indexes/CreateLogsIndex.rb index bde00c5338a0..78b4d22c20de 100644 --- a/examples/v1/logs-indexes/CreateLogsIndex.rb +++ b/examples/v1/logs-indexes/CreateLogsIndex.rb @@ -14,6 +14,7 @@ DatadogAPIClient::V1::LogsExclusion.new({ filter: DatadogAPIClient::V1::LogsExclusionFilter.new({ query: "*", + sample_attribute: "@ci.job_id", sample_rate: 1.0, }), name: "payment", diff --git a/examples/v1/logs-indexes/UpdateLogsIndex.rb b/examples/v1/logs-indexes/UpdateLogsIndex.rb index 1e7a4e1ab9b1..20af8ae09f13 100644 --- a/examples/v1/logs-indexes/UpdateLogsIndex.rb +++ b/examples/v1/logs-indexes/UpdateLogsIndex.rb @@ -15,6 +15,7 @@ DatadogAPIClient::V1::LogsExclusion.new({ filter: DatadogAPIClient::V1::LogsExclusionFilter.new({ query: "*", + sample_attribute: "@ci.job_id", sample_rate: 1.0, }), name: "payment", diff --git a/features/v1/logs_indexes.feature b/features/v1/logs_indexes.feature index 8277ce4ae244..4091527029ba 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_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, "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_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, "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_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, "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_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, "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_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, "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/api/logs_indexes_api.rb b/lib/datadog_api_client/v1/api/logs_indexes_api.rb index 157db7c2caad..721f8197cf33 100644 --- a/lib/datadog_api_client/v1/api/logs_indexes_api.rb +++ b/lib/datadog_api_client/v1/api/logs_indexes_api.rb @@ -355,7 +355,7 @@ def update_logs_index(name, body, opts = {}) # Update an index as identified by its name. # Returns the Index object passed in the request body when the request is successful. # - # Using the `PUT` method updates your index’s configuration by **replacing** + # Using the `PUT` method updates your index's configuration by **replacing** # your current configuration with the new one sent to your Datadog organization. # # @param name [String] Name of the log index. diff --git a/lib/datadog_api_client/v1/models/logs_exclusion_filter.rb b/lib/datadog_api_client/v1/models/logs_exclusion_filter.rb index 2b87370c2251..640c757bce91 100644 --- a/lib/datadog_api_client/v1/models/logs_exclusion_filter.rb +++ b/lib/datadog_api_client/v1/models/logs_exclusion_filter.rb @@ -25,6 +25,10 @@ class LogsExclusionFilter # Scope down exclusion filter to only a subset of logs with a log query. attr_accessor :query + # Sample attribute to use for the sampling of logs going through this exclusion filter. + # When set, only the logs with the specified attribute are sampled. + attr_accessor :sample_attribute + # Sample rate to apply to logs going through this exclusion filter, # a value of 1.0 excludes all logs matching the query. attr_reader :sample_rate @@ -36,6 +40,7 @@ class LogsExclusionFilter def self.attribute_map { :'query' => :'query', + :'sample_attribute' => :'sample_attribute', :'sample_rate' => :'sample_rate' } end @@ -45,6 +50,7 @@ def self.attribute_map def self.openapi_types { :'query' => :'String', + :'sample_attribute' => :'String', :'sample_rate' => :'Float' } end @@ -71,6 +77,10 @@ def initialize(attributes = {}) self.query = attributes[:'query'] end + if attributes.key?(:'sample_attribute') + self.sample_attribute = attributes[:'sample_attribute'] + end + if attributes.key?(:'sample_rate') self.sample_rate = attributes[:'sample_rate'] end @@ -121,6 +131,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && query == o.query && + sample_attribute == o.sample_attribute && sample_rate == o.sample_rate && additional_properties == o.additional_properties end @@ -129,7 +140,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [query, sample_rate, additional_properties].hash + [query, sample_attribute, sample_rate, additional_properties].hash end end end