diff --git a/.generated-info b/.generated-info index 46da9f7a2c..b3179495b8 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "04d09cb", - "generated": "2025-07-23 09:22:38.369" + "spec_repo_commit": "4727afe", + "generated": "2025-07-23 15:37:01.942" } diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 5ce0fd12fc..91a0e38e09 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/docs/datadog_api_client.v1.model.rst b/docs/datadog_api_client.v1.model.rst index 81106650ff..8dcb7440c2 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -1719,6 +1719,34 @@ datadog\_api\_client.v1.model.logs\_date\_remapper\_type module :members: :show-inheritance: +datadog\_api\_client.v1.model.logs\_decoder\_processor module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.logs_decoder_processor + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.logs\_decoder\_processor\_binary\_to\_text\_encoding module +----------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.logs_decoder_processor_binary_to_text_encoding + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.logs\_decoder\_processor\_input\_representation module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v1.model.logs_decoder_processor_input_representation + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.logs\_decoder\_processor\_type module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.logs_decoder_processor_type + :members: + :show-inheritance: + datadog\_api\_client.v1.model.logs\_exclusion module ---------------------------------------------------- diff --git a/examples/v1/logs-pipelines/CreateLogsPipeline_3336967838.py b/examples/v1/logs-pipelines/CreateLogsPipeline_3336967838.py new file mode 100644 index 0000000000..f6c71f1948 --- /dev/null +++ b/examples/v1/logs-pipelines/CreateLogsPipeline_3336967838.py @@ -0,0 +1,42 @@ +""" +Create a pipeline with Decoder Processor returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v1.api.logs_pipelines_api import LogsPipelinesApi +from datadog_api_client.v1.model.logs_decoder_processor import LogsDecoderProcessor +from datadog_api_client.v1.model.logs_decoder_processor_binary_to_text_encoding import ( + LogsDecoderProcessorBinaryToTextEncoding, +) +from datadog_api_client.v1.model.logs_decoder_processor_input_representation import ( + LogsDecoderProcessorInputRepresentation, +) +from datadog_api_client.v1.model.logs_decoder_processor_type import LogsDecoderProcessorType +from datadog_api_client.v1.model.logs_filter import LogsFilter +from datadog_api_client.v1.model.logs_pipeline import LogsPipeline + +body = LogsPipeline( + filter=LogsFilter( + query="source:python", + ), + name="testDecoderProcessor", + processors=[ + LogsDecoderProcessor( + type=LogsDecoderProcessorType.DECODER_PROCESSOR, + is_enabled=True, + name="test_decoder", + source="encoded.field", + target="decoded.field", + binary_to_text_encoding=LogsDecoderProcessorBinaryToTextEncoding.BASE16, + input_representation=LogsDecoderProcessorInputRepresentation.UTF_8, + ), + ], + tags=[], +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = LogsPipelinesApi(api_client) + response = api_instance.create_logs_pipeline(body=body) + + print(response) diff --git a/src/datadog_api_client/v1/model/logs_decoder_processor.py b/src/datadog_api_client/v1/model/logs_decoder_processor.py new file mode 100644 index 0000000000..76cdca526e --- /dev/null +++ b/src/datadog_api_client/v1/model/logs_decoder_processor.py @@ -0,0 +1,104 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v1.model.logs_decoder_processor_binary_to_text_encoding import ( + LogsDecoderProcessorBinaryToTextEncoding, + ) + from datadog_api_client.v1.model.logs_decoder_processor_input_representation import ( + LogsDecoderProcessorInputRepresentation, + ) + from datadog_api_client.v1.model.logs_decoder_processor_type import LogsDecoderProcessorType + + +class LogsDecoderProcessor(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.logs_decoder_processor_binary_to_text_encoding import ( + LogsDecoderProcessorBinaryToTextEncoding, + ) + from datadog_api_client.v1.model.logs_decoder_processor_input_representation import ( + LogsDecoderProcessorInputRepresentation, + ) + from datadog_api_client.v1.model.logs_decoder_processor_type import LogsDecoderProcessorType + + return { + "binary_to_text_encoding": (LogsDecoderProcessorBinaryToTextEncoding,), + "input_representation": (LogsDecoderProcessorInputRepresentation,), + "is_enabled": (bool,), + "name": (str,), + "source": (str,), + "target": (str,), + "type": (LogsDecoderProcessorType,), + } + + 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", + } + + def __init__( + self_, + binary_to_text_encoding: LogsDecoderProcessorBinaryToTextEncoding, + input_representation: LogsDecoderProcessorInputRepresentation, + source: str, + target: str, + type: LogsDecoderProcessorType, + is_enabled: Union[bool, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + 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. + + :param binary_to_text_encoding: The encoding used to represent the binary data. + :type binary_to_text_encoding: LogsDecoderProcessorBinaryToTextEncoding + + :param input_representation: The original representation of input string. + :type input_representation: LogsDecoderProcessorInputRepresentation + + :param is_enabled: Whether the processor is enabled. + :type is_enabled: bool, optional + + :param name: Name of the processor. + :type name: str, optional + + :param source: Name of the log attribute with the encoded data. + :type source: str + + :param target: Name of the log attribute that contains the decoded data. + :type target: str + + :param type: Type of logs decoder processor. + :type type: LogsDecoderProcessorType + """ + if is_enabled is not unset: + kwargs["is_enabled"] = is_enabled + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) + + self_.binary_to_text_encoding = binary_to_text_encoding + self_.input_representation = input_representation + self_.source = source + self_.target = target + self_.type = type diff --git a/src/datadog_api_client/v1/model/logs_decoder_processor_binary_to_text_encoding.py b/src/datadog_api_client/v1/model/logs_decoder_processor_binary_to_text_encoding.py new file mode 100644 index 0000000000..039e34a6dc --- /dev/null +++ b/src/datadog_api_client/v1/model/logs_decoder_processor_binary_to_text_encoding.py @@ -0,0 +1,38 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class LogsDecoderProcessorBinaryToTextEncoding(ModelSimple): + """ + The encoding used to represent the binary data. + + :param value: Must be one of ["base64", "base16"]. + :type value: str + """ + + allowed_values = { + "base64", + "base16", + } + BASE64: ClassVar["LogsDecoderProcessorBinaryToTextEncoding"] + BASE16: ClassVar["LogsDecoderProcessorBinaryToTextEncoding"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +LogsDecoderProcessorBinaryToTextEncoding.BASE64 = LogsDecoderProcessorBinaryToTextEncoding("base64") +LogsDecoderProcessorBinaryToTextEncoding.BASE16 = LogsDecoderProcessorBinaryToTextEncoding("base16") diff --git a/src/datadog_api_client/v1/model/logs_decoder_processor_input_representation.py b/src/datadog_api_client/v1/model/logs_decoder_processor_input_representation.py new file mode 100644 index 0000000000..3f27f90097 --- /dev/null +++ b/src/datadog_api_client/v1/model/logs_decoder_processor_input_representation.py @@ -0,0 +1,38 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class LogsDecoderProcessorInputRepresentation(ModelSimple): + """ + The original representation of input string. + + :param value: Must be one of ["utf_8", "integer"]. + :type value: str + """ + + allowed_values = { + "utf_8", + "integer", + } + UTF_8: ClassVar["LogsDecoderProcessorInputRepresentation"] + INTEGER: ClassVar["LogsDecoderProcessorInputRepresentation"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +LogsDecoderProcessorInputRepresentation.UTF_8 = LogsDecoderProcessorInputRepresentation("utf_8") +LogsDecoderProcessorInputRepresentation.INTEGER = LogsDecoderProcessorInputRepresentation("integer") diff --git a/src/datadog_api_client/v1/model/logs_decoder_processor_type.py b/src/datadog_api_client/v1/model/logs_decoder_processor_type.py new file mode 100644 index 0000000000..3d2fc54d44 --- /dev/null +++ b/src/datadog_api_client/v1/model/logs_decoder_processor_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class LogsDecoderProcessorType(ModelSimple): + """ + Type of logs decoder processor. + + :param value: If omitted defaults to "decoder-processor". Must be one of ["decoder-processor"]. + :type value: str + """ + + allowed_values = { + "decoder-processor", + } + DECODER_PROCESSOR: ClassVar["LogsDecoderProcessorType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +LogsDecoderProcessorType.DECODER_PROCESSOR = LogsDecoderProcessorType("decoder-processor") diff --git a/src/datadog_api_client/v1/model/logs_pipeline.py b/src/datadog_api_client/v1/model/logs_pipeline.py index e837687665..8485c7e2eb 100644 --- a/src/datadog_api_client/v1/model/logs_pipeline.py +++ b/src/datadog_api_client/v1/model/logs_pipeline.py @@ -34,6 +34,7 @@ from datadog_api_client.v1.model.logs_trace_remapper import LogsTraceRemapper from datadog_api_client.v1.model.logs_span_remapper import LogsSpanRemapper from datadog_api_client.v1.model.logs_array_processor import LogsArrayProcessor + from datadog_api_client.v1.model.logs_decoder_processor import LogsDecoderProcessor class LogsPipeline(ModelNormal): @@ -101,6 +102,7 @@ def __init__( LogsTraceRemapper, LogsSpanRemapper, LogsArrayProcessor, + LogsDecoderProcessor, ] ], UnsetType, diff --git a/src/datadog_api_client/v1/model/logs_pipeline_processor.py b/src/datadog_api_client/v1/model/logs_pipeline_processor.py index d61b2763a2..c66f8690dd 100644 --- a/src/datadog_api_client/v1/model/logs_pipeline_processor.py +++ b/src/datadog_api_client/v1/model/logs_pipeline_processor.py @@ -34,6 +34,7 @@ from datadog_api_client.v1.model.logs_trace_remapper import LogsTraceRemapper from datadog_api_client.v1.model.logs_span_remapper import LogsSpanRemapper from datadog_api_client.v1.model.logs_array_processor import LogsArrayProcessor + from datadog_api_client.v1.model.logs_decoder_processor import LogsDecoderProcessor class LogsPipelineProcessor(ModelNormal): @@ -87,6 +88,7 @@ def __init__( LogsTraceRemapper, LogsSpanRemapper, LogsArrayProcessor, + LogsDecoderProcessor, ] ], UnsetType, diff --git a/src/datadog_api_client/v1/model/logs_processor.py b/src/datadog_api_client/v1/model/logs_processor.py index 9e81c62970..6baebc4f66 100644 --- a/src/datadog_api_client/v1/model/logs_processor.py +++ b/src/datadog_api_client/v1/model/logs_processor.py @@ -94,6 +94,12 @@ def __init__(self, **kwargs): :param operation: Configuration of the array processor operation to perform. :type operation: LogsArrayProcessorOperation + + :param binary_to_text_encoding: The encoding used to represent the binary data. + :type binary_to_text_encoding: LogsDecoderProcessorBinaryToTextEncoding + + :param input_representation: The original representation of input string. + :type input_representation: LogsDecoderProcessorInputRepresentation """ super().__init__(kwargs) @@ -124,6 +130,7 @@ def _composed_schemas(_): from datadog_api_client.v1.model.logs_trace_remapper import LogsTraceRemapper from datadog_api_client.v1.model.logs_span_remapper import LogsSpanRemapper from datadog_api_client.v1.model.logs_array_processor import LogsArrayProcessor + from datadog_api_client.v1.model.logs_decoder_processor import LogsDecoderProcessor return { "oneOf": [ @@ -145,5 +152,6 @@ def _composed_schemas(_): LogsTraceRemapper, LogsSpanRemapper, LogsArrayProcessor, + LogsDecoderProcessor, ], } diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index da1a5978e5..45685b6a28 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -277,6 +277,14 @@ from datadog_api_client.v1.model.logs_daily_limit_reset import LogsDailyLimitReset from datadog_api_client.v1.model.logs_date_remapper import LogsDateRemapper from datadog_api_client.v1.model.logs_date_remapper_type import LogsDateRemapperType +from datadog_api_client.v1.model.logs_decoder_processor import LogsDecoderProcessor +from datadog_api_client.v1.model.logs_decoder_processor_binary_to_text_encoding import ( + LogsDecoderProcessorBinaryToTextEncoding, +) +from datadog_api_client.v1.model.logs_decoder_processor_input_representation import ( + LogsDecoderProcessorInputRepresentation, +) +from datadog_api_client.v1.model.logs_decoder_processor_type import LogsDecoderProcessorType from datadog_api_client.v1.model.logs_exclusion import LogsExclusion from datadog_api_client.v1.model.logs_exclusion_filter import LogsExclusionFilter from datadog_api_client.v1.model.logs_filter import LogsFilter @@ -1341,6 +1349,10 @@ "LogsDailyLimitReset", "LogsDateRemapper", "LogsDateRemapperType", + "LogsDecoderProcessor", + "LogsDecoderProcessorBinaryToTextEncoding", + "LogsDecoderProcessorInputRepresentation", + "LogsDecoderProcessorType", "LogsExclusion", "LogsExclusionFilter", "LogsFilter", diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_pipeline_with_decoder_processor_returns_ok_response.frozen b/tests/v1/cassettes/test_scenarios/test_create_a_pipeline_with_decoder_processor_returns_ok_response.frozen new file mode 100644 index 0000000000..0e0841ea4b --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_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/tests/v1/cassettes/test_scenarios/test_create_a_pipeline_with_decoder_processor_returns_ok_response.yaml b/tests/v1/cassettes/test_scenarios/test_create_a_pipeline_with_decoder_processor_returns_ok_response.yaml new file mode 100644 index 0000000000..a91aec02c7 --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_create_a_pipeline_with_decoder_processor_returns_ok_response.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"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: + 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 +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v1/logs/config/pipelines/BEg5CcvmSfyIGoMi9PWyTQ + response: + body: + string: '{} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v1/features/logs_pipelines.feature b/tests/v1/features/logs_pipelines.feature index bf817fda07..66305bbbaf 100644 --- a/tests/v1/features/logs_pipelines.feature +++ b/tests/v1/features/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