From a05ed008325a7569afb6f84d8537695f2f78d935 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 23 Jul 2026 13:34:12 +0000 Subject: [PATCH] Regenerate client from commit 715b041 of spec repo --- .generator/schemas/v1/openapi.yaml | 44 ++++- ...pipelines_CreateLogsPipeline_2595757342.rs | 41 ++++ ...pipelines_CreateLogsPipeline_4041812833.rs | 44 +++++ src/datadogV1/model/mod.rs | 4 + .../model/model_logs_array_processor.rs | 1 + .../model_logs_array_processor_operation.rs | 13 ++ ...y_processor_operation_extract_key_value.rs | 176 ++++++++++++++++++ ...cessor_operation_extract_key_value_type.rs | 48 +++++ .../model/model_logs_attribute_remapper.rs | 2 +- .../model/model_logs_schema_remapper.rs | 2 +- ...Value-Operation-returns-OK-response.frozen | 1 + ...y-Value-Operation-returns-OK-response.json | 67 +++++++ ...ide-on-conflict-returns-OK-response.frozen | 1 + ...rride-on-conflict-returns-OK-response.json | 67 +++++++ .../features/v1/logs_pipelines.feature | 14 ++ 15 files changed, 521 insertions(+), 4 deletions(-) create mode 100644 examples/v1_logs-pipelines_CreateLogsPipeline_2595757342.rs create mode 100644 examples/v1_logs-pipelines_CreateLogsPipeline_4041812833.rs create mode 100644 src/datadogV1/model/model_logs_array_processor_operation_extract_key_value.rs create mode 100644 src/datadogV1/model/model_logs_array_processor_operation_extract_key_value_type.rs create mode 100644 tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.frozen create mode 100644 tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.json create mode 100644 tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.frozen create mode 100644 tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.json diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index b043de0e64..13b137f25f 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -6611,6 +6611,7 @@ components: - Select value from matching element - Compute array length - Append a value to an array + - Extract key-value pairs from an array properties: is_enabled: default: false @@ -6633,6 +6634,7 @@ components: - $ref: "#/components/schemas/LogsArrayProcessorOperationAppend" - $ref: "#/components/schemas/LogsArrayProcessorOperationLength" - $ref: "#/components/schemas/LogsArrayProcessorOperationSelect" + - $ref: "#/components/schemas/LogsArrayProcessorOperationExtractKeyValue" LogsArrayProcessorOperationAppend: description: Operation that appends a value to a target array attribute. properties: @@ -6662,6 +6664,44 @@ components: type: string x-enum-varnames: - APPEND + LogsArrayProcessorOperationExtractKeyValue: + description: Operation that extracts key-value pairs from a `source` array and stores the result in the `target` attribute. + properties: + key_to_extract: + description: Key of the attribute in each array element that holds the name to use for the extracted attribute. + example: name + type: string + override_on_conflict: + default: false + description: Whether to override the target element if it's already set. + type: boolean + source: + description: Attribute path of the array to extract key-value pairs from. + example: tags + type: string + target: + description: Attribute that receives the extracted key-value pairs. If not specified, the extracted attributes are added at the root level of the log. + example: extracted + type: string + type: + $ref: "#/components/schemas/LogsArrayProcessorOperationExtractKeyValueType" + value_to_extract: + description: Key of the attribute in each array element that holds the value to use for the extracted attribute. + example: value + type: string + required: + - type + - source + - key_to_extract + - value_to_extract + type: object + LogsArrayProcessorOperationExtractKeyValueType: + description: Operation type. + enum: [key-value] + example: key-value + type: string + x-enum-varnames: + - KEY_VALUE LogsArrayProcessorOperationLength: description: Operation that computes the length of a `source` array and stores the result in the `target` attribute. properties: @@ -6746,7 +6786,7 @@ components: type: string override_on_conflict: default: false - description: Override or not the target element if already set, + description: Whether to override the target element if it's already set. type: boolean preserve_source: default: false @@ -7912,7 +7952,7 @@ components: type: string override_on_conflict: default: false - description: Override or not the target element if already set. + description: Whether to override the target element if it's already set. type: boolean preserve_source: default: false diff --git a/examples/v1_logs-pipelines_CreateLogsPipeline_2595757342.rs b/examples/v1_logs-pipelines_CreateLogsPipeline_2595757342.rs new file mode 100644 index 0000000000..605bca0cab --- /dev/null +++ b/examples/v1_logs-pipelines_CreateLogsPipeline_2595757342.rs @@ -0,0 +1,41 @@ +// Create a pipeline with Array Processor Key Value Operation returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs_pipelines::LogsPipelinesAPI; +use datadog_api_client::datadogV1::model::LogsArrayProcessor; +use datadog_api_client::datadogV1::model::LogsArrayProcessorOperation; +use datadog_api_client::datadogV1::model::LogsArrayProcessorOperationExtractKeyValue; +use datadog_api_client::datadogV1::model::LogsArrayProcessorOperationExtractKeyValueType; +use datadog_api_client::datadogV1::model::LogsArrayProcessorType; +use datadog_api_client::datadogV1::model::LogsFilter; +use datadog_api_client::datadogV1::model::LogsPipeline; +use datadog_api_client::datadogV1::model::LogsProcessor; + +#[tokio::main] +async fn main() { + let body = LogsPipeline::new("testPipelineArrayKeyValue".to_string()) + .filter(LogsFilter::new().query("source:python".to_string())) + .processors(vec![LogsProcessor::LogsArrayProcessor(Box::new( + LogsArrayProcessor::new( + LogsArrayProcessorOperation::LogsArrayProcessorOperationExtractKeyValue(Box::new( + LogsArrayProcessorOperationExtractKeyValue::new( + "name".to_string(), + "tags".to_string(), + LogsArrayProcessorOperationExtractKeyValueType::KEY_VALUE, + "value".to_string(), + ), + )), + LogsArrayProcessorType::ARRAY_PROCESSOR, + ) + .is_enabled(true) + .name("extract_kv".to_string()), + ))]) + .tags(vec![]); + let configuration = datadog::Configuration::new(); + let api = LogsPipelinesAPI::with_config(configuration); + let resp = api.create_logs_pipeline(body).await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v1_logs-pipelines_CreateLogsPipeline_4041812833.rs b/examples/v1_logs-pipelines_CreateLogsPipeline_4041812833.rs new file mode 100644 index 0000000000..43efe09424 --- /dev/null +++ b/examples/v1_logs-pipelines_CreateLogsPipeline_4041812833.rs @@ -0,0 +1,44 @@ +// Create a pipeline with Array Processor Key Value Operation with target and +// override_on_conflict returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV1::api_logs_pipelines::LogsPipelinesAPI; +use datadog_api_client::datadogV1::model::LogsArrayProcessor; +use datadog_api_client::datadogV1::model::LogsArrayProcessorOperation; +use datadog_api_client::datadogV1::model::LogsArrayProcessorOperationExtractKeyValue; +use datadog_api_client::datadogV1::model::LogsArrayProcessorOperationExtractKeyValueType; +use datadog_api_client::datadogV1::model::LogsArrayProcessorType; +use datadog_api_client::datadogV1::model::LogsFilter; +use datadog_api_client::datadogV1::model::LogsPipeline; +use datadog_api_client::datadogV1::model::LogsProcessor; + +#[tokio::main] +async fn main() { + let body = LogsPipeline::new("testPipelineArrayKeyValueTarget".to_string()) + .filter(LogsFilter::new().query("source:python".to_string())) + .processors(vec![LogsProcessor::LogsArrayProcessor(Box::new( + LogsArrayProcessor::new( + LogsArrayProcessorOperation::LogsArrayProcessorOperationExtractKeyValue(Box::new( + LogsArrayProcessorOperationExtractKeyValue::new( + "name".to_string(), + "tags".to_string(), + LogsArrayProcessorOperationExtractKeyValueType::KEY_VALUE, + "value".to_string(), + ) + .override_on_conflict(true) + .target("extracted".to_string()), + )), + LogsArrayProcessorType::ARRAY_PROCESSOR, + ) + .is_enabled(true) + .name("extract_kv_to_target".to_string()), + ))]) + .tags(vec![]); + let configuration = datadog::Configuration::new(); + let api = LogsPipelinesAPI::with_config(configuration); + let resp = api.create_logs_pipeline(body).await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/src/datadogV1/model/mod.rs b/src/datadogV1/model/mod.rs index 2e88d6bb40..128b2dc6e1 100644 --- a/src/datadogV1/model/mod.rs +++ b/src/datadogV1/model/mod.rs @@ -1242,6 +1242,10 @@ pub mod model_logs_array_processor_operation_select; pub use self::model_logs_array_processor_operation_select::LogsArrayProcessorOperationSelect; pub mod model_logs_array_processor_operation_select_type; pub use self::model_logs_array_processor_operation_select_type::LogsArrayProcessorOperationSelectType; +pub mod model_logs_array_processor_operation_extract_key_value; +pub use self::model_logs_array_processor_operation_extract_key_value::LogsArrayProcessorOperationExtractKeyValue; +pub mod model_logs_array_processor_operation_extract_key_value_type; +pub use self::model_logs_array_processor_operation_extract_key_value_type::LogsArrayProcessorOperationExtractKeyValueType; pub mod model_logs_array_processor_operation; pub use self::model_logs_array_processor_operation::LogsArrayProcessorOperation; pub mod model_logs_array_processor_type; diff --git a/src/datadogV1/model/model_logs_array_processor.rs b/src/datadogV1/model/model_logs_array_processor.rs index ee6642671a..cbe2d94707 100644 --- a/src/datadogV1/model/model_logs_array_processor.rs +++ b/src/datadogV1/model/model_logs_array_processor.rs @@ -11,6 +11,7 @@ use std::fmt::{self, Formatter}; /// - Select value from matching element /// - Compute array length /// - Append a value to an array +/// - Extract key-value pairs from an array #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] diff --git a/src/datadogV1/model/model_logs_array_processor_operation.rs b/src/datadogV1/model/model_logs_array_processor_operation.rs index 9b89174d8b..a12509c2a1 100644 --- a/src/datadogV1/model/model_logs_array_processor_operation.rs +++ b/src/datadogV1/model/model_logs_array_processor_operation.rs @@ -17,6 +17,9 @@ pub enum LogsArrayProcessorOperation { LogsArrayProcessorOperationSelect( Box, ), + LogsArrayProcessorOperationExtractKeyValue( + Box, + ), UnparsedObject(crate::datadog::UnparsedObject), } @@ -50,6 +53,16 @@ impl<'de> Deserialize<'de> for LogsArrayProcessorOperation { return Ok(LogsArrayProcessorOperation::LogsArrayProcessorOperationSelect(_v)); } } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok( + LogsArrayProcessorOperation::LogsArrayProcessorOperationExtractKeyValue(_v), + ); + } + } return Ok(LogsArrayProcessorOperation::UnparsedObject( crate::datadog::UnparsedObject { value }, diff --git a/src/datadogV1/model/model_logs_array_processor_operation_extract_key_value.rs b/src/datadogV1/model/model_logs_array_processor_operation_extract_key_value.rs new file mode 100644 index 0000000000..b6d2a3e57e --- /dev/null +++ b/src/datadogV1/model/model_logs_array_processor_operation_extract_key_value.rs @@ -0,0 +1,176 @@ +// 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. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Operation that extracts key-value pairs from a `source` array and stores the result in the `target` attribute. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LogsArrayProcessorOperationExtractKeyValue { + /// Key of the attribute in each array element that holds the name to use for the extracted attribute. + #[serde(rename = "key_to_extract")] + pub key_to_extract: String, + /// Whether to override the target element if it's already set. + #[serde(rename = "override_on_conflict")] + pub override_on_conflict: Option, + /// Attribute path of the array to extract key-value pairs from. + #[serde(rename = "source")] + pub source: String, + /// Attribute that receives the extracted key-value pairs. If not specified, the extracted attributes are added at the root level of the log. + #[serde(rename = "target")] + pub target: Option, + /// Operation type. + #[serde(rename = "type")] + pub type_: crate::datadogV1::model::LogsArrayProcessorOperationExtractKeyValueType, + /// Key of the attribute in each array element that holds the value to use for the extracted attribute. + #[serde(rename = "value_to_extract")] + pub value_to_extract: String, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LogsArrayProcessorOperationExtractKeyValue { + pub fn new( + key_to_extract: String, + source: String, + type_: crate::datadogV1::model::LogsArrayProcessorOperationExtractKeyValueType, + value_to_extract: String, + ) -> LogsArrayProcessorOperationExtractKeyValue { + LogsArrayProcessorOperationExtractKeyValue { + key_to_extract, + override_on_conflict: None, + source, + target: None, + type_, + value_to_extract, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn override_on_conflict(mut self, value: bool) -> Self { + self.override_on_conflict = Some(value); + self + } + + pub fn target(mut self, value: String) -> Self { + self.target = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LogsArrayProcessorOperationExtractKeyValue { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LogsArrayProcessorOperationExtractKeyValueVisitor; + impl<'a> Visitor<'a> for LogsArrayProcessorOperationExtractKeyValueVisitor { + type Value = LogsArrayProcessorOperationExtractKeyValue; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut key_to_extract: Option = None; + let mut override_on_conflict: Option = None; + let mut source: Option = None; + let mut target: Option = None; + let mut type_: Option< + crate::datadogV1::model::LogsArrayProcessorOperationExtractKeyValueType, + > = None; + let mut value_to_extract: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "key_to_extract" => { + key_to_extract = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "override_on_conflict" => { + if v.is_null() { + continue; + } + override_on_conflict = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "source" => { + source = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "target" => { + if v.is_null() { + continue; + } + target = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV1::model::LogsArrayProcessorOperationExtractKeyValueType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + "value_to_extract" => { + value_to_extract = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let key_to_extract = + key_to_extract.ok_or_else(|| M::Error::missing_field("key_to_extract"))?; + let source = source.ok_or_else(|| M::Error::missing_field("source"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + let value_to_extract = + value_to_extract.ok_or_else(|| M::Error::missing_field("value_to_extract"))?; + + let content = LogsArrayProcessorOperationExtractKeyValue { + key_to_extract, + override_on_conflict, + source, + target, + type_, + value_to_extract, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LogsArrayProcessorOperationExtractKeyValueVisitor) + } +} diff --git a/src/datadogV1/model/model_logs_array_processor_operation_extract_key_value_type.rs b/src/datadogV1/model/model_logs_array_processor_operation_extract_key_value_type.rs new file mode 100644 index 0000000000..7bb0919e2d --- /dev/null +++ b/src/datadogV1/model/model_logs_array_processor_operation_extract_key_value_type.rs @@ -0,0 +1,48 @@ +// 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. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum LogsArrayProcessorOperationExtractKeyValueType { + KEY_VALUE, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for LogsArrayProcessorOperationExtractKeyValueType { + fn to_string(&self) -> String { + match self { + Self::KEY_VALUE => String::from("key-value"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for LogsArrayProcessorOperationExtractKeyValueType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for LogsArrayProcessorOperationExtractKeyValueType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "key-value" => Self::KEY_VALUE, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV1/model/model_logs_attribute_remapper.rs b/src/datadogV1/model/model_logs_attribute_remapper.rs index af197e5a33..8d42a138dc 100644 --- a/src/datadogV1/model/model_logs_attribute_remapper.rs +++ b/src/datadogV1/model/model_logs_attribute_remapper.rs @@ -19,7 +19,7 @@ pub struct LogsAttributeRemapper { /// Name of the processor. #[serde(rename = "name")] pub name: Option, - /// Override or not the target element if already set, + /// Whether to override the target element if it's already set. #[serde(rename = "override_on_conflict")] pub override_on_conflict: Option, /// Remove or preserve the remapped source element. diff --git a/src/datadogV1/model/model_logs_schema_remapper.rs b/src/datadogV1/model/model_logs_schema_remapper.rs index 353a6240ed..77315c5f2a 100644 --- a/src/datadogV1/model/model_logs_schema_remapper.rs +++ b/src/datadogV1/model/model_logs_schema_remapper.rs @@ -14,7 +14,7 @@ pub struct LogsSchemaRemapper { /// Name of the logs schema remapper. #[serde(rename = "name")] pub name: String, - /// Override or not the target element if already set. + /// Whether to override the target element if it's already set. #[serde(rename = "override_on_conflict")] pub override_on_conflict: Option, /// Remove or preserve the remapped source element. diff --git a/tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.frozen b/tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.frozen new file mode 100644 index 0000000000..79a90597f7 --- /dev/null +++ b/tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-22T18:27:14.576Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.json b/tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.json new file mode 100644 index 0000000000..f591fe5c2e --- /dev/null +++ b/tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.json @@ -0,0 +1,67 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "string": "{\"filter\":{\"query\":\"source:python\"},\"name\":\"testPipelineArrayKeyValue\",\"processors\":[{\"is_enabled\":true,\"name\":\"extract_kv\",\"operation\":{\"key_to_extract\":\"name\",\"source\":\"tags\",\"type\":\"key-value\",\"value_to_extract\":\"value\"},\"type\":\"array-processor\"}],\"tags\":[]}", + "encoding": null + }, + "headers": { + "Accept": [ + "application/json" + ], + "Content-Type": [ + "application/json" + ] + }, + "method": "post", + "uri": "https://api.datadoghq.com/api/v1/logs/config/pipelines" + }, + "response": { + "body": { + "string": "{\"id\":\"KLmRE95XSCKQcsktzgs9eQ\",\"type\":\"pipeline\",\"name\":\"testPipelineArrayKeyValue\",\"is_enabled\":false,\"is_read_only\":false,\"filter\":{\"query\":\"source:python\"},\"processors\":[{\"name\":\"extract_kv\",\"is_enabled\":true,\"operation\":{\"source\":\"tags\",\"key_to_extract\":\"name\",\"value_to_extract\":\"value\",\"override_on_conflict\":false,\"type\":\"key-value\"},\"type\":\"array-processor\"}],\"tags\":[]}\n", + "encoding": null + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "status": { + "code": 200, + "message": "OK" + } + }, + "recorded_at": "Wed, 22 Jul 2026 18:27:14 GMT" + }, + { + "request": { + "body": "", + "headers": { + "Accept": [ + "*/*" + ] + }, + "method": "delete", + "uri": "https://api.datadoghq.com/api/v1/logs/config/pipelines/KLmRE95XSCKQcsktzgs9eQ" + }, + "response": { + "body": { + "string": "{}\n", + "encoding": null + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "status": { + "code": 200, + "message": "OK" + } + }, + "recorded_at": "Wed, 22 Jul 2026 18:27:14 GMT" + } + ], + "recorded_with": "VCR 6.0.0" +} \ No newline at end of file diff --git a/tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.frozen b/tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.frozen new file mode 100644 index 0000000000..fe1037276a --- /dev/null +++ b/tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-22T18:27:15.202Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.json b/tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.json new file mode 100644 index 0000000000..46ef810b16 --- /dev/null +++ b/tests/scenarios/cassettes/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.json @@ -0,0 +1,67 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "string": "{\"filter\":{\"query\":\"source:python\"},\"name\":\"testPipelineArrayKeyValueTarget\",\"processors\":[{\"is_enabled\":true,\"name\":\"extract_kv_to_target\",\"operation\":{\"key_to_extract\":\"name\",\"override_on_conflict\":true,\"source\":\"tags\",\"target\":\"extracted\",\"type\":\"key-value\",\"value_to_extract\":\"value\"},\"type\":\"array-processor\"}],\"tags\":[]}", + "encoding": null + }, + "headers": { + "Accept": [ + "application/json" + ], + "Content-Type": [ + "application/json" + ] + }, + "method": "post", + "uri": "https://api.datadoghq.com/api/v1/logs/config/pipelines" + }, + "response": { + "body": { + "string": "{\"id\":\"LsxyDpcbTL6KztluS2oBYA\",\"type\":\"pipeline\",\"name\":\"testPipelineArrayKeyValueTarget\",\"is_enabled\":false,\"is_read_only\":false,\"filter\":{\"query\":\"source:python\"},\"processors\":[{\"name\":\"extract_kv_to_target\",\"is_enabled\":true,\"operation\":{\"source\":\"tags\",\"target\":\"extracted\",\"key_to_extract\":\"name\",\"value_to_extract\":\"value\",\"override_on_conflict\":true,\"type\":\"key-value\"},\"type\":\"array-processor\"}],\"tags\":[]}\n", + "encoding": null + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "status": { + "code": 200, + "message": "OK" + } + }, + "recorded_at": "Wed, 22 Jul 2026 18:27:15 GMT" + }, + { + "request": { + "body": "", + "headers": { + "Accept": [ + "*/*" + ] + }, + "method": "delete", + "uri": "https://api.datadoghq.com/api/v1/logs/config/pipelines/LsxyDpcbTL6KztluS2oBYA" + }, + "response": { + "body": { + "string": "{}\n", + "encoding": null + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "status": { + "code": 200, + "message": "OK" + } + }, + "recorded_at": "Wed, 22 Jul 2026 18:27:15 GMT" + } + ], + "recorded_with": "VCR 6.0.0" +} \ No newline at end of file diff --git a/tests/scenarios/features/v1/logs_pipelines.feature b/tests/scenarios/features/v1/logs_pipelines.feature index ac28f05261..8b584949d9 100644 --- a/tests/scenarios/features/v1/logs_pipelines.feature +++ b/tests/scenarios/features/v1/logs_pipelines.feature @@ -84,6 +84,20 @@ Feature: Logs Pipelines When the request is sent Then the response status is 200 OK + @team:DataDog/logs-onboarding + Scenario: Create a pipeline with Array Processor Key Value Operation returns "OK" response + Given new "CreateLogsPipeline" request + And body with value {"filter": {"query": "source:python"}, "name": "testPipelineArrayKeyValue", "processors": [{"type": "array-processor", "is_enabled": true, "name": "extract_kv", "operation": {"type": "key-value", "source": "tags", "key_to_extract": "name", "value_to_extract": "value"}}], "tags": []} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/logs-onboarding + Scenario: Create a pipeline with Array Processor Key Value Operation with target and override_on_conflict returns "OK" response + Given new "CreateLogsPipeline" request + And body with value {"filter": {"query": "source:python"}, "name": "testPipelineArrayKeyValueTarget", "processors": [{"type": "array-processor", "is_enabled": true, "name": "extract_kv_to_target", "operation": {"type": "key-value", "source": "tags", "key_to_extract": "name", "value_to_extract": "value", "target": "extracted", "override_on_conflict": true}}], "tags": []} + When the request is sent + Then the response status is 200 OK + @team:DataDog/logs-onboarding Scenario: Create a pipeline with Array Processor Length Operation returns "OK" response Given new "CreateLogsPipeline" request