diff --git a/.generated-info b/.generated-info index 1d96858d418..5e61f7884db 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "04d09cb", - "generated": "2025-07-23 09:22:24.045" + "spec_repo_commit": "4727afe", + "generated": "2025-07-23 15:36:20.048" } diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 5ce0fd12fcd..91a0e38e097 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -5547,6 +5547,72 @@ components: type: string x-enum-varnames: - DATE_REMAPPER + LogsDecoderProcessor: + description: 'The decoder processor decodes any source attribute containing + a + + base64/base16-encoded UTF-8/ASCII string back to its original value, storing + the + + result in a target attribute.' + properties: + binary_to_text_encoding: + $ref: '#/components/schemas/LogsDecoderProcessorBinaryToTextEncoding' + input_representation: + $ref: '#/components/schemas/LogsDecoderProcessorInputRepresentation' + is_enabled: + default: false + description: Whether the processor is enabled. + type: boolean + name: + description: Name of the processor. + type: string + source: + description: Name of the log attribute with the encoded data. + example: encoded.field + type: string + target: + description: Name of the log attribute that contains the decoded data. + example: decoded.field + type: string + type: + $ref: '#/components/schemas/LogsDecoderProcessorType' + required: + - source + - target + - binary_to_text_encoding + - input_representation + - type + type: object + LogsDecoderProcessorBinaryToTextEncoding: + description: The encoding used to represent the binary data. + enum: + - base64 + - base16 + example: base64 + type: string + x-enum-varnames: + - BASE64 + - BASE16 + LogsDecoderProcessorInputRepresentation: + description: The original representation of input string. + enum: + - utf_8 + - integer + example: utf_8 + type: string + x-enum-varnames: + - UTF_8 + - INTEGER + LogsDecoderProcessorType: + default: decoder-processor + description: Type of logs decoder processor. + enum: + - decoder-processor + example: decoder-processor + type: string + x-enum-varnames: + - DECODER_PROCESSOR LogsExclusion: description: Represents the index exclusion filter object from configuration API. @@ -6215,6 +6281,7 @@ components: - $ref: '#/components/schemas/LogsTraceRemapper' - $ref: '#/components/schemas/LogsSpanRemapper' - $ref: '#/components/schemas/LogsArrayProcessor' + - $ref: '#/components/schemas/LogsDecoderProcessor' LogsQueryCompute: description: Define computation for a log query. properties: diff --git a/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Decoder-Processor-returns-OK-response.frozen b/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Decoder-Processor-returns-OK-response.frozen new file mode 100644 index 00000000000..0e0841ea4b8 --- /dev/null +++ b/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Decoder-Processor-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-07-22T13:27:59.975Z \ No newline at end of file diff --git a/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Decoder-Processor-returns-OK-response.yml b/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Decoder-Processor-returns-OK-response.yml new file mode 100644 index 00000000000..3ec1578047b --- /dev/null +++ b/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Decoder-Processor-returns-OK-response.yml @@ -0,0 +1,46 @@ +http_interactions: +- recorded_at: Tue, 22 Jul 2025 13:27:59 GMT + request: + body: + encoding: UTF-8 + string: '{"filter":{"query":"source:python"},"name":"testDecoderProcessor","processors":[{"binary_to_text_encoding":"base16","input_representation":"utf_8","is_enabled":true,"name":"test_decoder","source":"encoded.field","target":"decoded.field","type":"decoder-processor"}],"tags":[]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/logs/config/pipelines + response: + body: + encoding: UTF-8 + string: '{"id":"BEg5CcvmSfyIGoMi9PWyTQ","type":"pipeline","name":"testDecoderProcessor","is_enabled":false,"is_read_only":false,"filter":{"query":"source:python"},"processors":[{"name":"test_decoder","is_enabled":true,"source":"encoded.field","target":"decoded.field","binary_to_text_encoding":"base16","input_representation":"utf_8","type":"decoder-processor"}],"tags":[]} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Tue, 22 Jul 2025 13:27:59 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v1/logs/config/pipelines/BEg5CcvmSfyIGoMi9PWyTQ + response: + body: + encoding: UTF-8 + string: '{} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v1/logs-pipelines/CreateLogsPipeline_3336967838.rb b/examples/v1/logs-pipelines/CreateLogsPipeline_3336967838.rb new file mode 100644 index 00000000000..21e28766504 --- /dev/null +++ b/examples/v1/logs-pipelines/CreateLogsPipeline_3336967838.rb @@ -0,0 +1,24 @@ +# Create a pipeline with Decoder Processor returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::LogsPipelinesAPI.new + +body = DatadogAPIClient::V1::LogsPipeline.new({ + filter: DatadogAPIClient::V1::LogsFilter.new({ + query: "source:python", + }), + name: "testDecoderProcessor", + processors: [ + DatadogAPIClient::V1::LogsDecoderProcessor.new({ + type: DatadogAPIClient::V1::LogsDecoderProcessorType::DECODER_PROCESSOR, + is_enabled: true, + name: "test_decoder", + source: "encoded.field", + target: "decoded.field", + binary_to_text_encoding: DatadogAPIClient::V1::LogsDecoderProcessorBinaryToTextEncoding::BASE16, + input_representation: DatadogAPIClient::V1::LogsDecoderProcessorInputRepresentation::UTF_8, + }), + ], + tags: [], +}) +p api_instance.create_logs_pipeline(body) diff --git a/features/v1/logs_pipelines.feature b/features/v1/logs_pipelines.feature index bf817fda07c..66305bbbaf2 100644 --- a/features/v1/logs_pipelines.feature +++ b/features/v1/logs_pipelines.feature @@ -70,6 +70,13 @@ Feature: Logs Pipelines When the request is sent Then the response status is 200 OK + @team:DataDog/event-platform-experience + Scenario: Create a pipeline with Decoder Processor returns "OK" response + Given new "CreateLogsPipeline" request + And body with value {"filter": {"query": "source:python"}, "name": "testDecoderProcessor", "processors": [{"type": "decoder-processor", "is_enabled": true, "name": "test_decoder", "source": "encoded.field", "target": "decoded.field", "binary_to_text_encoding": "base16", "input_representation": "utf_8"}], "tags": []} + When the request is sent + Then the response status is 200 OK + @team:DataDog/event-platform-experience Scenario: Create a pipeline with Span Id Remapper returns "OK" response Given new "CreateLogsPipeline" request diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index b275dfa5468..1b48b4d5f24 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -248,6 +248,10 @@ def overrides "v1.logs_daily_limit_reset" => "LogsDailyLimitReset", "v1.logs_date_remapper" => "LogsDateRemapper", "v1.logs_date_remapper_type" => "LogsDateRemapperType", + "v1.logs_decoder_processor" => "LogsDecoderProcessor", + "v1.logs_decoder_processor_binary_to_text_encoding" => "LogsDecoderProcessorBinaryToTextEncoding", + "v1.logs_decoder_processor_input_representation" => "LogsDecoderProcessorInputRepresentation", + "v1.logs_decoder_processor_type" => "LogsDecoderProcessorType", "v1.logs_exclusion" => "LogsExclusion", "v1.logs_exclusion_filter" => "LogsExclusionFilter", "v1.logs_filter" => "LogsFilter", diff --git a/lib/datadog_api_client/v1/models/logs_decoder_processor.rb b/lib/datadog_api_client/v1/models/logs_decoder_processor.rb new file mode 100644 index 00000000000..40a6cbe7476 --- /dev/null +++ b/lib/datadog_api_client/v1/models/logs_decoder_processor.rb @@ -0,0 +1,229 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # The decoder processor decodes any source attribute containing a + # base64/base16-encoded UTF-8/ASCII string back to its original value, storing the + # result in a target attribute. + class LogsDecoderProcessor + include BaseGenericModel + + # The encoding used to represent the binary data. + attr_reader :binary_to_text_encoding + + # The original representation of input string. + attr_reader :input_representation + + # Whether the processor is enabled. + attr_accessor :is_enabled + + # Name of the processor. + attr_accessor :name + + # Name of the log attribute with the encoded data. + attr_reader :source + + # Name of the log attribute that contains the decoded data. + attr_reader :target + + # Type of logs decoder processor. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'binary_to_text_encoding' => :'binary_to_text_encoding', + :'input_representation' => :'input_representation', + :'is_enabled' => :'is_enabled', + :'name' => :'name', + :'source' => :'source', + :'target' => :'target', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'binary_to_text_encoding' => :'LogsDecoderProcessorBinaryToTextEncoding', + :'input_representation' => :'LogsDecoderProcessorInputRepresentation', + :'is_enabled' => :'Boolean', + :'name' => :'String', + :'source' => :'String', + :'target' => :'String', + :'type' => :'LogsDecoderProcessorType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::LogsDecoderProcessor` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'binary_to_text_encoding') + self.binary_to_text_encoding = attributes[:'binary_to_text_encoding'] + end + + if attributes.key?(:'input_representation') + self.input_representation = attributes[:'input_representation'] + end + + if attributes.key?(:'is_enabled') + self.is_enabled = attributes[:'is_enabled'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + + if attributes.key?(:'target') + self.target = attributes[:'target'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @binary_to_text_encoding.nil? + return false if @input_representation.nil? + return false if @source.nil? + return false if @target.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param binary_to_text_encoding [Object] Object to be assigned + # @!visibility private + def binary_to_text_encoding=(binary_to_text_encoding) + if binary_to_text_encoding.nil? + fail ArgumentError, 'invalid value for "binary_to_text_encoding", binary_to_text_encoding cannot be nil.' + end + @binary_to_text_encoding = binary_to_text_encoding + end + + # Custom attribute writer method with validation + # @param input_representation [Object] Object to be assigned + # @!visibility private + def input_representation=(input_representation) + if input_representation.nil? + fail ArgumentError, 'invalid value for "input_representation", input_representation cannot be nil.' + end + @input_representation = input_representation + end + + # Custom attribute writer method with validation + # @param source [Object] Object to be assigned + # @!visibility private + def source=(source) + if source.nil? + fail ArgumentError, 'invalid value for "source", source cannot be nil.' + end + @source = source + end + + # Custom attribute writer method with validation + # @param target [Object] Object to be assigned + # @!visibility private + def target=(target) + if target.nil? + fail ArgumentError, 'invalid value for "target", target cannot be nil.' + end + @target = target + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + binary_to_text_encoding == o.binary_to_text_encoding && + input_representation == o.input_representation && + is_enabled == o.is_enabled && + name == o.name && + source == o.source && + target == o.target && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [binary_to_text_encoding, input_representation, is_enabled, name, source, target, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/logs_decoder_processor_binary_to_text_encoding.rb b/lib/datadog_api_client/v1/models/logs_decoder_processor_binary_to_text_encoding.rb new file mode 100644 index 00000000000..95d8b9e5760 --- /dev/null +++ b/lib/datadog_api_client/v1/models/logs_decoder_processor_binary_to_text_encoding.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # The encoding used to represent the binary data. + class LogsDecoderProcessorBinaryToTextEncoding + include BaseEnumModel + + BASE64 = "base64".freeze + BASE16 = "base16".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/logs_decoder_processor_input_representation.rb b/lib/datadog_api_client/v1/models/logs_decoder_processor_input_representation.rb new file mode 100644 index 00000000000..67cff083daa --- /dev/null +++ b/lib/datadog_api_client/v1/models/logs_decoder_processor_input_representation.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # The original representation of input string. + class LogsDecoderProcessorInputRepresentation + include BaseEnumModel + + UTF_8 = "utf_8".freeze + INTEGER = "integer".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/logs_decoder_processor_type.rb b/lib/datadog_api_client/v1/models/logs_decoder_processor_type.rb new file mode 100644 index 00000000000..a5b58c3ecee --- /dev/null +++ b/lib/datadog_api_client/v1/models/logs_decoder_processor_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Type of logs decoder processor. + class LogsDecoderProcessorType + include BaseEnumModel + + DECODER_PROCESSOR = "decoder-processor".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/logs_processor.rb b/lib/datadog_api_client/v1/models/logs_processor.rb index f49af3a672a..328f4676fc1 100644 --- a/lib/datadog_api_client/v1/models/logs_processor.rb +++ b/lib/datadog_api_client/v1/models/logs_processor.rb @@ -43,7 +43,8 @@ def openapi_one_of :'ReferenceTableLogsLookupProcessor', :'LogsTraceRemapper', :'LogsSpanRemapper', - :'LogsArrayProcessor' + :'LogsArrayProcessor', + :'LogsDecoderProcessor' ] end # Builds the object