From d43503edb869b107f0d129284fd08e771d08af38 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 9 Apr 2026 08:53:57 +0000 Subject: [PATCH] Regenerate client from commit db66851 of spec repo --- .generator/schemas/v2/openapi.yaml | 64 ++++++++- docs/datadog_api_client.v2.model.rst | 35 +++++ .../ValidatePipeline_1267410221.py | 85 ++++++++++++ .../ValidatePipeline_2960728933.py | 79 +++++++++++ .../ValidatePipeline_815080644.py | 130 ++++++++++++++++++ ...bility_pipeline_config_destination_item.py | 3 + ...servability_pipeline_config_source_item.py | 4 + ...ine_enrichment_table_field_event_lookup.py | 33 +++++ ...ne_enrichment_table_field_secret_lookup.py | 33 +++++ ...eline_enrichment_table_field_vrl_lookup.py | 33 +++++ ...ne_enrichment_table_file_key_item_field.py | 56 ++++++++ ...ipeline_enrichment_table_file_key_items.py | 36 ++++- ...ability_pipeline_splunk_hec_destination.py | 14 ++ ...e_splunk_hec_destination_token_strategy.py | 42 ++++++ ...bservability_pipeline_splunk_hec_source.py | 9 ++ src/datadog_api_client/v2/models/__init__.py | 20 +++ ...et_field_lookup_returns_ok_response.frozen | 1 + ...cret_field_lookup_returns_ok_response.yaml | 23 ++++ ..._token_strategy_returns_ok_response.frozen | 1 + ...on_token_strategy_returns_ok_response.yaml | 23 ++++ ...store_hec_token_returns_ok_response.frozen | 1 + ...e_store_hec_token_returns_ok_response.yaml | 23 ++++ .../features/observability_pipelines.feature | 26 +++- 23 files changed, 765 insertions(+), 9 deletions(-) create mode 100644 examples/v2/observability-pipelines/ValidatePipeline_1267410221.py create mode 100644 examples/v2/observability-pipelines/ValidatePipeline_2960728933.py create mode 100644 examples/v2/observability-pipelines/ValidatePipeline_815080644.py create mode 100644 src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_field_event_lookup.py create mode 100644 src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_field_secret_lookup.py create mode 100644 src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_field_vrl_lookup.py create mode 100644 src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_file_key_item_field.py create mode 100644 src/datadog_api_client/v2/model/observability_pipeline_splunk_hec_destination_token_strategy.py create mode 100644 tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_enrichment_table_secret_field_lookup_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_enrichment_table_secret_field_lookup_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_destination_token_strategy_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_destination_token_strategy_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_source_store_hec_token_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_source_store_hec_token_returns_ok_response.yaml diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d235bdcd3d..a376b3df8f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -43989,6 +43989,36 @@ components: type: string x-enum-varnames: - ELASTICSEARCH + ObservabilityPipelineEnrichmentTableFieldEventLookup: + description: Specifies an event field path to use as the enrichment table lookup key. + properties: + event: + description: Path to the field in the log event. + example: log.user.id + type: string + required: + - event + type: object + ObservabilityPipelineEnrichmentTableFieldSecretLookup: + description: Specifies a secret reference to use as the enrichment table lookup key. + properties: + secret: + description: The name of the secret whose value is used as the lookup key. + example: LOOKUP_KEY_SECRET + type: string + required: + - secret + type: object + ObservabilityPipelineEnrichmentTableFieldVrlLookup: + description: Specifies a VRL expression to compute the enrichment table lookup key. + properties: + vrl: + description: A VRL expression that resolves to the lookup key value. + example: .user_id + type: string + required: + - vrl + type: object ObservabilityPipelineEnrichmentTableFile: description: Defines a static enrichment table loaded from a CSV file. properties: @@ -44039,6 +44069,18 @@ components: type: string x-enum-varnames: - CSV + ObservabilityPipelineEnrichmentTableFileKeyItemField: + description: |- + Specifies the source of the key value used for enrichment table lookups. + Can be a plain field path string, or an object specifying the lookup type (`event`, `vrl`, or `secret`). + example: log.user.id + oneOf: + - description: A plain field path in the log event. + example: log.user.id + type: string + - $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFieldEventLookup" + - $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFieldVrlLookup" + - $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFieldSecretLookup" ObservabilityPipelineEnrichmentTableFileKeyItems: description: Defines how to map log fields to enrichment table columns during lookups. properties: @@ -44049,9 +44091,7 @@ components: comparison: $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFileKeyItemsComparison" field: - description: The `items` `field`. - example: log.user.id - type: string + $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFileKeyItemField" required: - column - comparison @@ -47072,6 +47112,8 @@ components: description: Name of the environment variable or secret that holds the Splunk HEC token. example: SPLUNK_HEC_TOKEN type: string + token_strategy: + $ref: "#/components/schemas/ObservabilityPipelineSplunkHecDestinationTokenStrategy" type: $ref: "#/components/schemas/ObservabilityPipelineSplunkHecDestinationType" required: @@ -47090,6 +47132,16 @@ components: x-enum-varnames: - JSON - RAW_MESSAGE + ObservabilityPipelineSplunkHecDestinationTokenStrategy: + description: Controls how the Splunk HEC token is supplied. Use `custom` to provide a token with `token_key`, or `from_source` to forward the token received from an upstream Splunk HEC source. + enum: + - custom + - from_source + example: custom + type: string + x-enum-varnames: + - CUSTOM + - FROM_SOURCE ObservabilityPipelineSplunkHecDestinationType: default: splunk_hec description: The destination type. Always `splunk_hec`. @@ -47113,6 +47165,12 @@ components: description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). example: splunk-hec-source type: string + store_hec_token: + description: |- + When `true`, the Splunk HEC token from the incoming request is stored in the event metadata. + This allows downstream components to forward the token to other Splunk HEC destinations. + example: true + type: boolean tls: $ref: "#/components/schemas/ObservabilityPipelineTls" type: diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index e714684121..0521c6a14f 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -19534,6 +19534,27 @@ datadog\_api\_client.v2.model.observability\_pipeline\_elasticsearch\_destinatio :members: :show-inheritance: +datadog\_api\_client.v2.model.observability\_pipeline\_enrichment\_table\_field\_event\_lookup module +----------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_event_lookup + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_enrichment\_table\_field\_secret\_lookup module +------------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_secret_lookup + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.observability\_pipeline\_enrichment\_table\_field\_vrl\_lookup module +--------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_vrl_lookup + :members: + :show-inheritance: + datadog\_api\_client.v2.model.observability\_pipeline\_enrichment\_table\_file module ------------------------------------------------------------------------------------- @@ -19555,6 +19576,13 @@ datadog\_api\_client.v2.model.observability\_pipeline\_enrichment\_table\_file\_ :members: :show-inheritance: +datadog\_api\_client.v2.model.observability\_pipeline\_enrichment\_table\_file\_key\_item\_field module +------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_key_item_field + :members: + :show-inheritance: + datadog\_api\_client.v2.model.observability\_pipeline\_enrichment\_table\_file\_key\_items module ------------------------------------------------------------------------------------------------- @@ -20815,6 +20843,13 @@ datadog\_api\_client.v2.model.observability\_pipeline\_splunk\_hec\_destination\ :members: :show-inheritance: +datadog\_api\_client.v2.model.observability\_pipeline\_splunk\_hec\_destination\_token\_strategy module +------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination_token_strategy + :members: + :show-inheritance: + datadog\_api\_client.v2.model.observability\_pipeline\_splunk\_hec\_destination\_type module -------------------------------------------------------------------------------------------- diff --git a/examples/v2/observability-pipelines/ValidatePipeline_1267410221.py b/examples/v2/observability-pipelines/ValidatePipeline_1267410221.py new file mode 100644 index 0000000000..ebed07a551 --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_1267410221.py @@ -0,0 +1,85 @@ +""" +Validate an observability pipeline with Splunk HEC destination token_strategy returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi +from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig +from datadog_api_client.v2.model.observability_pipeline_config_processor_group import ( + ObservabilityPipelineConfigProcessorGroup, +) +from datadog_api_client.v2.model.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes +from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source import ( + ObservabilityPipelineDatadogAgentSource, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source_type import ( + ObservabilityPipelineDatadogAgentSourceType, +) +from datadog_api_client.v2.model.observability_pipeline_filter_processor import ObservabilityPipelineFilterProcessor +from datadog_api_client.v2.model.observability_pipeline_filter_processor_type import ( + ObservabilityPipelineFilterProcessorType, +) +from datadog_api_client.v2.model.observability_pipeline_spec import ObservabilityPipelineSpec +from datadog_api_client.v2.model.observability_pipeline_spec_data import ObservabilityPipelineSpecData +from datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination import ( + ObservabilityPipelineSplunkHecDestination, +) +from datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination_token_strategy import ( + ObservabilityPipelineSplunkHecDestinationTokenStrategy, +) +from datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination_type import ( + ObservabilityPipelineSplunkHecDestinationType, +) + +body = ObservabilityPipelineSpec( + data=ObservabilityPipelineSpecData( + attributes=ObservabilityPipelineDataAttributes( + config=ObservabilityPipelineConfig( + destinations=[ + ObservabilityPipelineSplunkHecDestination( + id="splunk-hec-destination", + inputs=[ + "my-processor-group", + ], + type=ObservabilityPipelineSplunkHecDestinationType.SPLUNK_HEC, + token_key="SPLUNK_HEC_TOKEN", + token_strategy=ObservabilityPipelineSplunkHecDestinationTokenStrategy.CUSTOM, + ), + ], + processor_groups=[ + ObservabilityPipelineConfigProcessorGroup( + enabled=True, + id="my-processor-group", + include="service:my-service", + inputs=[ + "datadog-agent-source", + ], + processors=[ + ObservabilityPipelineFilterProcessor( + enabled=True, + id="filter-processor", + include="status:error", + type=ObservabilityPipelineFilterProcessorType.FILTER, + ), + ], + ), + ], + sources=[ + ObservabilityPipelineDatadogAgentSource( + id="datadog-agent-source", + type=ObservabilityPipelineDatadogAgentSourceType.DATADOG_AGENT, + ), + ], + ), + name="Pipeline with Splunk HEC token_strategy", + ), + type="pipelines", + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ObservabilityPipelinesApi(api_client) + response = api_instance.validate_pipeline(body=body) + + print(response) diff --git a/examples/v2/observability-pipelines/ValidatePipeline_2960728933.py b/examples/v2/observability-pipelines/ValidatePipeline_2960728933.py new file mode 100644 index 0000000000..1b3aa63445 --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_2960728933.py @@ -0,0 +1,79 @@ +""" +Validate an observability pipeline with Splunk HEC source store_hec_token returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi +from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig +from datadog_api_client.v2.model.observability_pipeline_config_processor_group import ( + ObservabilityPipelineConfigProcessorGroup, +) +from datadog_api_client.v2.model.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes +from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination import ( + ObservabilityPipelineDatadogLogsDestination, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination_type import ( + ObservabilityPipelineDatadogLogsDestinationType, +) +from datadog_api_client.v2.model.observability_pipeline_filter_processor import ObservabilityPipelineFilterProcessor +from datadog_api_client.v2.model.observability_pipeline_filter_processor_type import ( + ObservabilityPipelineFilterProcessorType, +) +from datadog_api_client.v2.model.observability_pipeline_spec import ObservabilityPipelineSpec +from datadog_api_client.v2.model.observability_pipeline_spec_data import ObservabilityPipelineSpecData +from datadog_api_client.v2.model.observability_pipeline_splunk_hec_source import ObservabilityPipelineSplunkHecSource +from datadog_api_client.v2.model.observability_pipeline_splunk_hec_source_type import ( + ObservabilityPipelineSplunkHecSourceType, +) + +body = ObservabilityPipelineSpec( + data=ObservabilityPipelineSpecData( + attributes=ObservabilityPipelineDataAttributes( + config=ObservabilityPipelineConfig( + destinations=[ + ObservabilityPipelineDatadogLogsDestination( + id="datadog-logs-destination", + inputs=[ + "my-processor-group", + ], + type=ObservabilityPipelineDatadogLogsDestinationType.DATADOG_LOGS, + ), + ], + processor_groups=[ + ObservabilityPipelineConfigProcessorGroup( + enabled=True, + id="my-processor-group", + include="service:my-service", + inputs=[ + "splunk-hec-source", + ], + processors=[ + ObservabilityPipelineFilterProcessor( + enabled=True, + id="filter-processor", + include="status:error", + type=ObservabilityPipelineFilterProcessorType.FILTER, + ), + ], + ), + ], + sources=[ + ObservabilityPipelineSplunkHecSource( + id="splunk-hec-source", + type=ObservabilityPipelineSplunkHecSourceType.SPLUNK_HEC, + store_hec_token=True, + ), + ], + ), + name="Pipeline with Splunk HEC store_hec_token", + ), + type="pipelines", + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ObservabilityPipelinesApi(api_client) + response = api_instance.validate_pipeline(body=body) + + print(response) diff --git a/examples/v2/observability-pipelines/ValidatePipeline_815080644.py b/examples/v2/observability-pipelines/ValidatePipeline_815080644.py new file mode 100644 index 0000000000..56b4e9be2a --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_815080644.py @@ -0,0 +1,130 @@ +""" +Validate an observability pipeline with enrichment table secret field lookup returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi +from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig +from datadog_api_client.v2.model.observability_pipeline_config_processor_group import ( + ObservabilityPipelineConfigProcessorGroup, +) +from datadog_api_client.v2.model.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes +from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source import ( + ObservabilityPipelineDatadogAgentSource, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source_type import ( + ObservabilityPipelineDatadogAgentSourceType, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination import ( + ObservabilityPipelineDatadogLogsDestination, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination_type import ( + ObservabilityPipelineDatadogLogsDestinationType, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_secret_lookup import ( + ObservabilityPipelineEnrichmentTableFieldSecretLookup, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file import ( + ObservabilityPipelineEnrichmentTableFile, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_encoding import ( + ObservabilityPipelineEnrichmentTableFileEncoding, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_encoding_type import ( + ObservabilityPipelineEnrichmentTableFileEncodingType, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_key_items import ( + ObservabilityPipelineEnrichmentTableFileKeyItems, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_key_items_comparison import ( + ObservabilityPipelineEnrichmentTableFileKeyItemsComparison, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_schema_items import ( + ObservabilityPipelineEnrichmentTableFileSchemaItems, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_schema_items_type import ( + ObservabilityPipelineEnrichmentTableFileSchemaItemsType, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_processor import ( + ObservabilityPipelineEnrichmentTableProcessor, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_processor_type import ( + ObservabilityPipelineEnrichmentTableProcessorType, +) +from datadog_api_client.v2.model.observability_pipeline_spec import ObservabilityPipelineSpec +from datadog_api_client.v2.model.observability_pipeline_spec_data import ObservabilityPipelineSpecData + +body = ObservabilityPipelineSpec( + data=ObservabilityPipelineSpecData( + attributes=ObservabilityPipelineDataAttributes( + config=ObservabilityPipelineConfig( + destinations=[ + ObservabilityPipelineDatadogLogsDestination( + id="datadog-logs-destination", + inputs=[ + "my-processor-group", + ], + type=ObservabilityPipelineDatadogLogsDestinationType.DATADOG_LOGS, + ), + ], + processor_groups=[ + ObservabilityPipelineConfigProcessorGroup( + enabled=True, + id="my-processor-group", + include="service:my-service", + inputs=[ + "datadog-agent-source", + ], + processors=[ + ObservabilityPipelineEnrichmentTableProcessor( + enabled=True, + id="enrichment-processor", + include="*", + target="enriched", + type=ObservabilityPipelineEnrichmentTableProcessorType.ENRICHMENT_TABLE, + file=ObservabilityPipelineEnrichmentTableFile( + encoding=ObservabilityPipelineEnrichmentTableFileEncoding( + delimiter=",", + type=ObservabilityPipelineEnrichmentTableFileEncodingType.CSV, + includes_headers=True, + ), + key=[ + ObservabilityPipelineEnrichmentTableFileKeyItems( + column="user_id", + comparison=ObservabilityPipelineEnrichmentTableFileKeyItemsComparison.EQUALS, + field=ObservabilityPipelineEnrichmentTableFieldSecretLookup( + secret="LOOKUP_KEY_SECRET", + ), + ), + ], + path="/etc/enrichment/lookup.csv", + schema=[ + ObservabilityPipelineEnrichmentTableFileSchemaItems( + column="user_id", + type=ObservabilityPipelineEnrichmentTableFileSchemaItemsType.STRING, + ), + ], + ), + ), + ], + ), + ], + sources=[ + ObservabilityPipelineDatadogAgentSource( + id="datadog-agent-source", + type=ObservabilityPipelineDatadogAgentSourceType.DATADOG_AGENT, + ), + ], + ), + name="Pipeline with Enrichment Table Secret Field", + ), + type="pipelines", + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ObservabilityPipelinesApi(api_client) + response = api_instance.validate_pipeline(body=body) + + print(response) diff --git a/src/datadog_api_client/v2/model/observability_pipeline_config_destination_item.py b/src/datadog_api_client/v2/model/observability_pipeline_config_destination_item.py index 2365b2f763..afe25be380 100644 --- a/src/datadog_api_client/v2/model/observability_pipeline_config_destination_item.py +++ b/src/datadog_api_client/v2/model/observability_pipeline_config_destination_item.py @@ -194,6 +194,9 @@ def __init__(self, **kwargs): :param sourcetype: The Splunk sourcetype to assign to log events. :type sourcetype: str, optional + :param token_strategy: Controls how the Splunk HEC token is supplied. Use `custom` to provide a token with `token_key`, or `from_source` to forward the token received from an upstream Splunk HEC source. + :type token_strategy: ObservabilityPipelineSplunkHecDestinationTokenStrategy, optional + :param header_custom_fields: A list of custom headers to include in the request to Sumo Logic. :type header_custom_fields: [ObservabilityPipelineSumoLogicDestinationHeaderCustomFieldsItem], optional diff --git a/src/datadog_api_client/v2/model/observability_pipeline_config_source_item.py b/src/datadog_api_client/v2/model/observability_pipeline_config_source_item.py index 58cab2a635..7302bcfada 100644 --- a/src/datadog_api_client/v2/model/observability_pipeline_config_source_item.py +++ b/src/datadog_api_client/v2/model/observability_pipeline_config_source_item.py @@ -94,6 +94,10 @@ def __init__(self, **kwargs): :param framing: Framing method configuration for the socket source. :type framing: ObservabilityPipelineSocketSourceFraming + :param store_hec_token: When `true`, the Splunk HEC token from the incoming request is stored in the event metadata. + This allows downstream components to forward the token to other Splunk HEC destinations. + :type store_hec_token: bool, optional + :param grpc_address_key: Environment variable name containing the gRPC server address for receiving OTLP data. Must be a valid environment variable name (alphanumeric characters and underscores only). :type grpc_address_key: str, optional diff --git a/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_field_event_lookup.py b/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_field_event_lookup.py new file mode 100644 index 0000000000..c06a563e94 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_field_event_lookup.py @@ -0,0 +1,33 @@ +# 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 ( + ModelNormal, + cached_property, +) + + +class ObservabilityPipelineEnrichmentTableFieldEventLookup(ModelNormal): + @cached_property + def openapi_types(_): + return { + "event": (str,), + } + + attribute_map = { + "event": "event", + } + + def __init__(self_, event: str, **kwargs): + """ + Specifies an event field path to use as the enrichment table lookup key. + + :param event: Path to the field in the log event. + :type event: str + """ + super().__init__(kwargs) + + self_.event = event diff --git a/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_field_secret_lookup.py b/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_field_secret_lookup.py new file mode 100644 index 0000000000..47bad0617c --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_field_secret_lookup.py @@ -0,0 +1,33 @@ +# 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 ( + ModelNormal, + cached_property, +) + + +class ObservabilityPipelineEnrichmentTableFieldSecretLookup(ModelNormal): + @cached_property + def openapi_types(_): + return { + "secret": (str,), + } + + attribute_map = { + "secret": "secret", + } + + def __init__(self_, secret: str, **kwargs): + """ + Specifies a secret reference to use as the enrichment table lookup key. + + :param secret: The name of the secret whose value is used as the lookup key. + :type secret: str + """ + super().__init__(kwargs) + + self_.secret = secret diff --git a/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_field_vrl_lookup.py b/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_field_vrl_lookup.py new file mode 100644 index 0000000000..45de357d4f --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_field_vrl_lookup.py @@ -0,0 +1,33 @@ +# 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 ( + ModelNormal, + cached_property, +) + + +class ObservabilityPipelineEnrichmentTableFieldVrlLookup(ModelNormal): + @cached_property + def openapi_types(_): + return { + "vrl": (str,), + } + + attribute_map = { + "vrl": "vrl", + } + + def __init__(self_, vrl: str, **kwargs): + """ + Specifies a VRL expression to compute the enrichment table lookup key. + + :param vrl: A VRL expression that resolves to the lookup key value. + :type vrl: str + """ + super().__init__(kwargs) + + self_.vrl = vrl diff --git a/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_file_key_item_field.py b/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_file_key_item_field.py new file mode 100644 index 0000000000..23076e594a --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_file_key_item_field.py @@ -0,0 +1,56 @@ +# 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 ( + ModelComposed, + cached_property, +) + + +class ObservabilityPipelineEnrichmentTableFileKeyItemField(ModelComposed): + def __init__(self, **kwargs): + """ + Specifies the source of the key value used for enrichment table lookups. + Can be a plain field path string, or an object specifying the lookup type ( ``event`` , ``vrl`` , or ``secret`` ). + + :param event: Path to the field in the log event. + :type event: str + + :param vrl: A VRL expression that resolves to the lookup key value. + :type vrl: str + + :param secret: The name of the secret whose value is used as the lookup key. + :type secret: str + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_event_lookup import ( + ObservabilityPipelineEnrichmentTableFieldEventLookup, + ) + from datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_vrl_lookup import ( + ObservabilityPipelineEnrichmentTableFieldVrlLookup, + ) + from datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_secret_lookup import ( + ObservabilityPipelineEnrichmentTableFieldSecretLookup, + ) + + return { + "oneOf": [ + str, + ObservabilityPipelineEnrichmentTableFieldEventLookup, + ObservabilityPipelineEnrichmentTableFieldVrlLookup, + ObservabilityPipelineEnrichmentTableFieldSecretLookup, + ], + } diff --git a/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_file_key_items.py b/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_file_key_items.py index 7b57fc97a8..91d33bcba5 100644 --- a/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_file_key_items.py +++ b/src/datadog_api_client/v2/model/observability_pipeline_enrichment_table_file_key_items.py @@ -3,7 +3,7 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import TYPE_CHECKING +from typing import Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, @@ -15,6 +15,18 @@ from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_key_items_comparison import ( ObservabilityPipelineEnrichmentTableFileKeyItemsComparison, ) + from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_key_item_field import ( + ObservabilityPipelineEnrichmentTableFileKeyItemField, + ) + from datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_event_lookup import ( + ObservabilityPipelineEnrichmentTableFieldEventLookup, + ) + from datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_vrl_lookup import ( + ObservabilityPipelineEnrichmentTableFieldVrlLookup, + ) + from datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_secret_lookup import ( + ObservabilityPipelineEnrichmentTableFieldSecretLookup, + ) class ObservabilityPipelineEnrichmentTableFileKeyItems(ModelNormal): @@ -23,11 +35,14 @@ def openapi_types(_): from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_key_items_comparison import ( ObservabilityPipelineEnrichmentTableFileKeyItemsComparison, ) + from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_key_item_field import ( + ObservabilityPipelineEnrichmentTableFileKeyItemField, + ) return { "column": (str,), "comparison": (ObservabilityPipelineEnrichmentTableFileKeyItemsComparison,), - "field": (str,), + "field": (ObservabilityPipelineEnrichmentTableFileKeyItemField,), } attribute_map = { @@ -37,7 +52,17 @@ def openapi_types(_): } def __init__( - self_, column: str, comparison: ObservabilityPipelineEnrichmentTableFileKeyItemsComparison, field: str, **kwargs + self_, + column: str, + comparison: ObservabilityPipelineEnrichmentTableFileKeyItemsComparison, + field: Union[ + ObservabilityPipelineEnrichmentTableFileKeyItemField, + str, + ObservabilityPipelineEnrichmentTableFieldEventLookup, + ObservabilityPipelineEnrichmentTableFieldVrlLookup, + ObservabilityPipelineEnrichmentTableFieldSecretLookup, + ], + **kwargs, ): """ Defines how to map log fields to enrichment table columns during lookups. @@ -48,8 +73,9 @@ def __init__( :param comparison: Defines how to compare key fields for enrichment table lookups. :type comparison: ObservabilityPipelineEnrichmentTableFileKeyItemsComparison - :param field: The ``items`` ``field``. - :type field: str + :param field: Specifies the source of the key value used for enrichment table lookups. + Can be a plain field path string, or an object specifying the lookup type ( ``event`` , ``vrl`` , or ``secret`` ). + :type field: ObservabilityPipelineEnrichmentTableFileKeyItemField """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/observability_pipeline_splunk_hec_destination.py b/src/datadog_api_client/v2/model/observability_pipeline_splunk_hec_destination.py index bde81cfef4..9583812376 100644 --- a/src/datadog_api_client/v2/model/observability_pipeline_splunk_hec_destination.py +++ b/src/datadog_api_client/v2/model/observability_pipeline_splunk_hec_destination.py @@ -18,6 +18,9 @@ from datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination_encoding import ( ObservabilityPipelineSplunkHecDestinationEncoding, ) + from datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination_token_strategy import ( + ObservabilityPipelineSplunkHecDestinationTokenStrategy, + ) from datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination_type import ( ObservabilityPipelineSplunkHecDestinationType, ) @@ -39,6 +42,9 @@ def openapi_types(_): from datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination_encoding import ( ObservabilityPipelineSplunkHecDestinationEncoding, ) + from datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination_token_strategy import ( + ObservabilityPipelineSplunkHecDestinationTokenStrategy, + ) from datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination_type import ( ObservabilityPipelineSplunkHecDestinationType, ) @@ -54,6 +60,7 @@ def openapi_types(_): "inputs": ([str],), "sourcetype": (str,), "token_key": (str,), + "token_strategy": (ObservabilityPipelineSplunkHecDestinationTokenStrategy,), "type": (ObservabilityPipelineSplunkHecDestinationType,), } @@ -68,6 +75,7 @@ def openapi_types(_): "inputs": "inputs", "sourcetype": "sourcetype", "token_key": "token_key", + "token_strategy": "token_strategy", "type": "type", } @@ -90,6 +98,7 @@ def __init__( indexed_fields: Union[List[str], UnsetType] = unset, sourcetype: Union[str, UnsetType] = unset, token_key: Union[str, UnsetType] = unset, + token_strategy: Union[ObservabilityPipelineSplunkHecDestinationTokenStrategy, UnsetType] = unset, **kwargs, ): """ @@ -128,6 +137,9 @@ def __init__( :param token_key: Name of the environment variable or secret that holds the Splunk HEC token. :type token_key: str, optional + :param token_strategy: Controls how the Splunk HEC token is supplied. Use ``custom`` to provide a token with ``token_key`` , or ``from_source`` to forward the token received from an upstream Splunk HEC source. + :type token_strategy: ObservabilityPipelineSplunkHecDestinationTokenStrategy, optional + :param type: The destination type. Always ``splunk_hec``. :type type: ObservabilityPipelineSplunkHecDestinationType """ @@ -147,6 +159,8 @@ def __init__( kwargs["sourcetype"] = sourcetype if token_key is not unset: kwargs["token_key"] = token_key + if token_strategy is not unset: + kwargs["token_strategy"] = token_strategy super().__init__(kwargs) self_.id = id diff --git a/src/datadog_api_client/v2/model/observability_pipeline_splunk_hec_destination_token_strategy.py b/src/datadog_api_client/v2/model/observability_pipeline_splunk_hec_destination_token_strategy.py new file mode 100644 index 0000000000..9ca5de040e --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_splunk_hec_destination_token_strategy.py @@ -0,0 +1,42 @@ +# 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 ObservabilityPipelineSplunkHecDestinationTokenStrategy(ModelSimple): + """ + Controls how the Splunk HEC token is supplied. Use `custom` to provide a token with `token_key`, or `from_source` to forward the token received from an upstream Splunk HEC source. + + :param value: Must be one of ["custom", "from_source"]. + :type value: str + """ + + allowed_values = { + "custom", + "from_source", + } + CUSTOM: ClassVar["ObservabilityPipelineSplunkHecDestinationTokenStrategy"] + FROM_SOURCE: ClassVar["ObservabilityPipelineSplunkHecDestinationTokenStrategy"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ObservabilityPipelineSplunkHecDestinationTokenStrategy.CUSTOM = ObservabilityPipelineSplunkHecDestinationTokenStrategy( + "custom" +) +ObservabilityPipelineSplunkHecDestinationTokenStrategy.FROM_SOURCE = ( + ObservabilityPipelineSplunkHecDestinationTokenStrategy("from_source") +) diff --git a/src/datadog_api_client/v2/model/observability_pipeline_splunk_hec_source.py b/src/datadog_api_client/v2/model/observability_pipeline_splunk_hec_source.py index dfb3bbad61..5415e4879d 100644 --- a/src/datadog_api_client/v2/model/observability_pipeline_splunk_hec_source.py +++ b/src/datadog_api_client/v2/model/observability_pipeline_splunk_hec_source.py @@ -31,6 +31,7 @@ def openapi_types(_): return { "address_key": (str,), "id": (str,), + "store_hec_token": (bool,), "tls": (ObservabilityPipelineTls,), "type": (ObservabilityPipelineSplunkHecSourceType,), } @@ -38,6 +39,7 @@ def openapi_types(_): attribute_map = { "address_key": "address_key", "id": "id", + "store_hec_token": "store_hec_token", "tls": "tls", "type": "type", } @@ -47,6 +49,7 @@ def __init__( id: str, type: ObservabilityPipelineSplunkHecSourceType, address_key: Union[str, UnsetType] = unset, + store_hec_token: Union[bool, UnsetType] = unset, tls: Union[ObservabilityPipelineTls, UnsetType] = unset, **kwargs, ): @@ -61,6 +64,10 @@ def __init__( :param id: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the ``input`` to downstream components). :type id: str + :param store_hec_token: When ``true`` , the Splunk HEC token from the incoming request is stored in the event metadata. + This allows downstream components to forward the token to other Splunk HEC destinations. + :type store_hec_token: bool, optional + :param tls: Configuration for enabling TLS encryption between the pipeline component and external services. :type tls: ObservabilityPipelineTls, optional @@ -69,6 +76,8 @@ def __init__( """ if address_key is not unset: kwargs["address_key"] = address_key + if store_hec_token is not unset: + kwargs["store_hec_token"] = store_hec_token if tls is not unset: kwargs["tls"] = tls super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index b3a7bf728c..6afcf88029 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -3804,6 +3804,15 @@ from datadog_api_client.v2.model.observability_pipeline_elasticsearch_destination_type import ( ObservabilityPipelineElasticsearchDestinationType, ) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_event_lookup import ( + ObservabilityPipelineEnrichmentTableFieldEventLookup, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_secret_lookup import ( + ObservabilityPipelineEnrichmentTableFieldSecretLookup, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_field_vrl_lookup import ( + ObservabilityPipelineEnrichmentTableFieldVrlLookup, +) from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file import ( ObservabilityPipelineEnrichmentTableFile, ) @@ -3813,6 +3822,9 @@ from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_encoding_type import ( ObservabilityPipelineEnrichmentTableFileEncodingType, ) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_key_item_field import ( + ObservabilityPipelineEnrichmentTableFileKeyItemField, +) from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_key_items import ( ObservabilityPipelineEnrichmentTableFileKeyItems, ) @@ -4303,6 +4315,9 @@ from datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination_encoding import ( ObservabilityPipelineSplunkHecDestinationEncoding, ) +from datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination_token_strategy import ( + ObservabilityPipelineSplunkHecDestinationTokenStrategy, +) from datadog_api_client.v2.model.observability_pipeline_splunk_hec_destination_type import ( ObservabilityPipelineSplunkHecDestinationType, ) @@ -9635,9 +9650,13 @@ "ObservabilityPipelineElasticsearchDestinationAuth", "ObservabilityPipelineElasticsearchDestinationDataStream", "ObservabilityPipelineElasticsearchDestinationType", + "ObservabilityPipelineEnrichmentTableFieldEventLookup", + "ObservabilityPipelineEnrichmentTableFieldSecretLookup", + "ObservabilityPipelineEnrichmentTableFieldVrlLookup", "ObservabilityPipelineEnrichmentTableFile", "ObservabilityPipelineEnrichmentTableFileEncoding", "ObservabilityPipelineEnrichmentTableFileEncodingType", + "ObservabilityPipelineEnrichmentTableFileKeyItemField", "ObservabilityPipelineEnrichmentTableFileKeyItems", "ObservabilityPipelineEnrichmentTableFileKeyItemsComparison", "ObservabilityPipelineEnrichmentTableFileSchemaItems", @@ -9818,6 +9837,7 @@ "ObservabilityPipelineSplitArrayProcessorType", "ObservabilityPipelineSplunkHecDestination", "ObservabilityPipelineSplunkHecDestinationEncoding", + "ObservabilityPipelineSplunkHecDestinationTokenStrategy", "ObservabilityPipelineSplunkHecDestinationType", "ObservabilityPipelineSplunkHecSource", "ObservabilityPipelineSplunkHecSourceType", diff --git a/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_enrichment_table_secret_field_lookup_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_enrichment_table_secret_field_lookup_returns_ok_response.frozen new file mode 100644 index 0000000000..bae1bd1b60 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_enrichment_table_secret_field_lookup_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-04-08T15:12:00.140Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_enrichment_table_secret_field_lookup_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_enrichment_table_secret_field_lookup_returns_ok_response.yaml new file mode 100644 index 0000000000..8083d99528 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_enrichment_table_secret_field_lookup_returns_ok_response.yaml @@ -0,0 +1,23 @@ +interactions: +- request: + body: '{"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["my-processor-group"],"type":"datadog_logs"}],"processor_groups":[{"enabled":true,"id":"my-processor-group","include":"service:my-service","inputs":["datadog-agent-source"],"processors":[{"enabled":true,"file":{"encoding":{"delimiter":",","includes_headers":true,"type":"csv"},"key":[{"column":"user_id","comparison":"equals","field":{"secret":"LOOKUP_KEY_SECRET"}}],"path":"/etc/enrichment/lookup.csv","schema":[{"column":"user_id","type":"string"}]},"id":"enrichment-processor","include":"*","target":"enriched","type":"enrichment_table"}]}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Pipeline + with Enrichment Table Secret Field"},"type":"pipelines"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/obs-pipelines/pipelines/validate + response: + body: + string: '{"errors":[]} + + ' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_destination_token_strategy_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_destination_token_strategy_returns_ok_response.frozen new file mode 100644 index 0000000000..8aa26c0186 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_destination_token_strategy_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-04-08T15:11:59.762Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_destination_token_strategy_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_destination_token_strategy_returns_ok_response.yaml new file mode 100644 index 0000000000..f087141e5b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_destination_token_strategy_returns_ok_response.yaml @@ -0,0 +1,23 @@ +interactions: +- request: + body: '{"data":{"attributes":{"config":{"destinations":[{"id":"splunk-hec-destination","inputs":["my-processor-group"],"token_key":"SPLUNK_HEC_TOKEN","token_strategy":"custom","type":"splunk_hec"}],"processor_groups":[{"enabled":true,"id":"my-processor-group","include":"service:my-service","inputs":["datadog-agent-source"],"processors":[{"enabled":true,"id":"filter-processor","include":"status:error","type":"filter"}]}],"sources":[{"id":"datadog-agent-source","type":"datadog_agent"}]},"name":"Pipeline + with Splunk HEC token_strategy"},"type":"pipelines"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/obs-pipelines/pipelines/validate + response: + body: + string: '{"errors":[]} + + ' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_source_store_hec_token_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_source_store_hec_token_returns_ok_response.frozen new file mode 100644 index 0000000000..9f348b438c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_source_store_hec_token_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-04-08T15:11:59.370Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_source_store_hec_token_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_source_store_hec_token_returns_ok_response.yaml new file mode 100644 index 0000000000..32aaf544bd --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_validate_an_observability_pipeline_with_splunk_hec_source_store_hec_token_returns_ok_response.yaml @@ -0,0 +1,23 @@ +interactions: +- request: + body: '{"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["my-processor-group"],"type":"datadog_logs"}],"processor_groups":[{"enabled":true,"id":"my-processor-group","include":"service:my-service","inputs":["splunk-hec-source"],"processors":[{"enabled":true,"id":"filter-processor","include":"status:error","type":"filter"}]}],"sources":[{"id":"splunk-hec-source","store_hec_token":true,"type":"splunk_hec"}]},"name":"Pipeline + with Splunk HEC store_hec_token"},"type":"pipelines"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/obs-pipelines/pipelines/validate + response: + body: + string: '{"errors":[]} + + ' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/features/observability_pipelines.feature b/tests/v2/features/observability_pipelines.feature index 96a0bbc6cb..dee9b458ae 100644 --- a/tests/v2/features/observability_pipelines.feature +++ b/tests/v2/features/observability_pipelines.feature @@ -207,6 +207,22 @@ Feature: Observability Pipelines Then the response status is 200 OK And the response "errors" has length 0 + @team:DataDog/observability-pipelines + Scenario: Validate an observability pipeline with Splunk HEC destination token_strategy returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "splunk-hec-destination", "inputs": ["my-processor-group"], "type": "splunk_hec", "token_key": "SPLUNK_HEC_TOKEN", "token_strategy": "custom"}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}]}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Pipeline with Splunk HEC token_strategy"}, "type": "pipelines"}} + When the request is sent + Then the response status is 200 OK + And the response "errors" has length 0 + + @team:DataDog/observability-pipelines + Scenario: Validate an observability pipeline with Splunk HEC source store_hec_token returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["splunk-hec-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}]}], "sources": [{"id": "splunk-hec-source", "type": "splunk_hec", "store_hec_token": true}]}, "name": "Pipeline with Splunk HEC store_hec_token"}, "type": "pipelines"}} + When the request is sent + Then the response status is 200 OK + And the response "errors" has length 0 + @team:DataDog/observability-pipelines Scenario: Validate an observability pipeline with amazon S3 source compression returns "OK" response Given new "ValidatePipeline" request @@ -223,10 +239,18 @@ Feature: Observability Pipelines Then the response status is 200 OK And the response "errors" has length 0 + @team:DataDog/observability-pipelines + Scenario: Validate an observability pipeline with enrichment table secret field lookup returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "enrichment-processor", "include": "*", "target": "enriched", "type": "enrichment_table", "file": {"encoding": {"delimiter": ",", "type": "csv", "includes_headers": true}, "key": [{"column": "user_id", "comparison": "equals", "field": {"secret": "LOOKUP_KEY_SECRET"}}], "path": "/etc/enrichment/lookup.csv", "schema": [{"column": "user_id", "type": "string"}]}}]}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Pipeline with Enrichment Table Secret Field"}, "type": "pipelines"}} + When the request is sent + Then the response status is 200 OK + And the response "errors" has length 0 + And the response "errors" has length 0 + @team:DataDog/observability-pipelines Scenario: Validate an observability pipeline with source secret key returns "OK" response Given new "ValidatePipeline" request And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["http-client-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}]}], "sources": [{"id": "http-client-source", "type": "http_client", "decoding": "bytes", "scrape_interval_secs": 15, "scrape_timeout_secs": 5, "auth_strategy": "bearer", "token_key": "HTTP_CLIENT_TOKEN"}]}, "name": "Pipeline with Source Secret"}, "type": "pipelines"}} When the request is sent Then the response status is 200 OK - And the response "errors" has length 0