diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 4707c147e8..612b0604bd 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -6212,6 +6212,38 @@ components: type: string x-enum-varnames: - DECODER_PROCESSOR + LogsExcludeAttributeProcessor: + description: |- + Use this processor to remove an attribute from a log during processing. + The processor strips the specified attribute from the log event, which is useful + when the attribute contains sensitive data or is no longer needed downstream. + properties: + attribute_to_exclude: + description: Name of the log attribute to remove from the log event. + example: foo + type: string + is_enabled: + default: false + description: Whether or not the processor is enabled. + type: boolean + name: + description: Name of the processor. + type: string + type: + $ref: "#/components/schemas/LogsExcludeAttributeProcessorType" + required: + - type + - attribute_to_exclude + type: object + LogsExcludeAttributeProcessorType: + default: exclude-attribute + description: Type of logs exclude attribute processor. + enum: + - exclude-attribute + example: exclude-attribute + type: string + x-enum-varnames: + - EXCLUDE_ATTRIBUTE LogsExclusion: description: Represents the index exclusion filter object from configuration API. properties: @@ -6819,6 +6851,7 @@ components: - $ref: "#/components/schemas/LogsArrayProcessor" - $ref: "#/components/schemas/LogsDecoderProcessor" - $ref: "#/components/schemas/LogsSchemaProcessor" + - $ref: "#/components/schemas/LogsExcludeAttributeProcessor" 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 9b46a58093..4a44242a26 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -2027,6 +2027,20 @@ datadog\_api\_client.v1.model.logs\_decoder\_processor\_type module :members: :show-inheritance: +datadog\_api\_client.v1.model.logs\_exclude\_attribute\_processor module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v1.model.logs_exclude_attribute_processor + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.logs\_exclude\_attribute\_processor\_type module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v1.model.logs_exclude_attribute_processor_type + :members: + :show-inheritance: + datadog\_api\_client.v1.model.logs\_exclusion module ---------------------------------------------------- diff --git a/src/datadog_api_client/v1/model/logs_exclude_attribute_processor.py b/src/datadog_api_client/v1/model/logs_exclude_attribute_processor.py new file mode 100644 index 0000000000..7769106fb0 --- /dev/null +++ b/src/datadog_api_client/v1/model/logs_exclude_attribute_processor.py @@ -0,0 +1,71 @@ +# 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_exclude_attribute_processor_type import LogsExcludeAttributeProcessorType + + +class LogsExcludeAttributeProcessor(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.logs_exclude_attribute_processor_type import LogsExcludeAttributeProcessorType + + return { + "attribute_to_exclude": (str,), + "is_enabled": (bool,), + "name": (str,), + "type": (LogsExcludeAttributeProcessorType,), + } + + attribute_map = { + "attribute_to_exclude": "attribute_to_exclude", + "is_enabled": "is_enabled", + "name": "name", + "type": "type", + } + + def __init__( + self_, + attribute_to_exclude: str, + type: LogsExcludeAttributeProcessorType, + is_enabled: Union[bool, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Use this processor to remove an attribute from a log during processing. + The processor strips the specified attribute from the log event, which is useful + when the attribute contains sensitive data or is no longer needed downstream. + + :param attribute_to_exclude: Name of the log attribute to remove from the log event. + :type attribute_to_exclude: str + + :param is_enabled: Whether or not the processor is enabled. + :type is_enabled: bool, optional + + :param name: Name of the processor. + :type name: str, optional + + :param type: Type of logs exclude attribute processor. + :type type: LogsExcludeAttributeProcessorType + """ + if is_enabled is not unset: + kwargs["is_enabled"] = is_enabled + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) + + self_.attribute_to_exclude = attribute_to_exclude + self_.type = type diff --git a/src/datadog_api_client/v1/model/logs_exclude_attribute_processor_type.py b/src/datadog_api_client/v1/model/logs_exclude_attribute_processor_type.py new file mode 100644 index 0000000000..3ef1f953dd --- /dev/null +++ b/src/datadog_api_client/v1/model/logs_exclude_attribute_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 LogsExcludeAttributeProcessorType(ModelSimple): + """ + Type of logs exclude attribute processor. + + :param value: If omitted defaults to "exclude-attribute". Must be one of ["exclude-attribute"]. + :type value: str + """ + + allowed_values = { + "exclude-attribute", + } + EXCLUDE_ATTRIBUTE: ClassVar["LogsExcludeAttributeProcessorType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +LogsExcludeAttributeProcessorType.EXCLUDE_ATTRIBUTE = LogsExcludeAttributeProcessorType("exclude-attribute") diff --git a/src/datadog_api_client/v1/model/logs_pipeline.py b/src/datadog_api_client/v1/model/logs_pipeline.py index c7dc54b78b..75aa50d693 100644 --- a/src/datadog_api_client/v1/model/logs_pipeline.py +++ b/src/datadog_api_client/v1/model/logs_pipeline.py @@ -36,6 +36,7 @@ from datadog_api_client.v1.model.logs_array_processor import LogsArrayProcessor from datadog_api_client.v1.model.logs_decoder_processor import LogsDecoderProcessor from datadog_api_client.v1.model.logs_schema_processor import LogsSchemaProcessor + from datadog_api_client.v1.model.logs_exclude_attribute_processor import LogsExcludeAttributeProcessor class LogsPipeline(ModelNormal): @@ -105,6 +106,7 @@ def __init__( LogsArrayProcessor, LogsDecoderProcessor, LogsSchemaProcessor, + LogsExcludeAttributeProcessor, ] ], 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 9bccc1439f..07d59fd9f7 100644 --- a/src/datadog_api_client/v1/model/logs_pipeline_processor.py +++ b/src/datadog_api_client/v1/model/logs_pipeline_processor.py @@ -36,6 +36,7 @@ from datadog_api_client.v1.model.logs_array_processor import LogsArrayProcessor from datadog_api_client.v1.model.logs_decoder_processor import LogsDecoderProcessor from datadog_api_client.v1.model.logs_schema_processor import LogsSchemaProcessor + from datadog_api_client.v1.model.logs_exclude_attribute_processor import LogsExcludeAttributeProcessor class LogsPipelineProcessor(ModelNormal): @@ -96,6 +97,7 @@ def __init__( LogsArrayProcessor, LogsDecoderProcessor, LogsSchemaProcessor, + LogsExcludeAttributeProcessor, ] ], UnsetType, diff --git a/src/datadog_api_client/v1/model/logs_processor.py b/src/datadog_api_client/v1/model/logs_processor.py index 09b3f12d72..07498773fc 100644 --- a/src/datadog_api_client/v1/model/logs_processor.py +++ b/src/datadog_api_client/v1/model/logs_processor.py @@ -112,6 +112,9 @@ def __init__(self, **kwargs): :param schema: Configuration of the schema data to use. :type schema: LogsSchemaData + + :param attribute_to_exclude: Name of the log attribute to remove from the log event. + :type attribute_to_exclude: str """ super().__init__(kwargs) @@ -144,6 +147,7 @@ def _composed_schemas(_): from datadog_api_client.v1.model.logs_array_processor import LogsArrayProcessor from datadog_api_client.v1.model.logs_decoder_processor import LogsDecoderProcessor from datadog_api_client.v1.model.logs_schema_processor import LogsSchemaProcessor + from datadog_api_client.v1.model.logs_exclude_attribute_processor import LogsExcludeAttributeProcessor return { "oneOf": [ @@ -167,5 +171,6 @@ def _composed_schemas(_): LogsArrayProcessor, LogsDecoderProcessor, LogsSchemaProcessor, + LogsExcludeAttributeProcessor, ], } diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index 74c9c174e4..bcd5b37bbe 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -341,6 +341,8 @@ LogsDecoderProcessorInputRepresentation, ) from datadog_api_client.v1.model.logs_decoder_processor_type import LogsDecoderProcessorType +from datadog_api_client.v1.model.logs_exclude_attribute_processor import LogsExcludeAttributeProcessor +from datadog_api_client.v1.model.logs_exclude_attribute_processor_type import LogsExcludeAttributeProcessorType 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 @@ -1635,6 +1637,8 @@ "LogsDecoderProcessorBinaryToTextEncoding", "LogsDecoderProcessorInputRepresentation", "LogsDecoderProcessorType", + "LogsExcludeAttributeProcessor", + "LogsExcludeAttributeProcessorType", "LogsExclusion", "LogsExclusionFilter", "LogsFilter",