Skip to content

Commit a9dd805

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 534cb46 of spec repo (#3604)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent aeccebc commit a9dd805

15 files changed

Lines changed: 443 additions & 5 deletions

.generator/schemas/v1/openapi.yaml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6611,6 +6611,7 @@ components:
66116611
- Select value from matching element
66126612
- Compute array length
66136613
- Append a value to an array
6614+
- Extract key-value pairs from an array
66146615
properties:
66156616
is_enabled:
66166617
default: false
@@ -6633,6 +6634,7 @@ components:
66336634
- $ref: "#/components/schemas/LogsArrayProcessorOperationAppend"
66346635
- $ref: "#/components/schemas/LogsArrayProcessorOperationLength"
66356636
- $ref: "#/components/schemas/LogsArrayProcessorOperationSelect"
6637+
- $ref: "#/components/schemas/LogsArrayProcessorOperationExtractKeyValue"
66366638
LogsArrayProcessorOperationAppend:
66376639
description: Operation that appends a value to a target array attribute.
66386640
properties:
@@ -6662,6 +6664,44 @@ components:
66626664
type: string
66636665
x-enum-varnames:
66646666
- APPEND
6667+
LogsArrayProcessorOperationExtractKeyValue:
6668+
description: Operation that extracts key-value pairs from a `source` array and stores the result in the `target` attribute.
6669+
properties:
6670+
key_to_extract:
6671+
description: Key of the attribute in each array element that holds the name to use for the extracted attribute.
6672+
example: name
6673+
type: string
6674+
override_on_conflict:
6675+
default: false
6676+
description: Whether to override the target element if it's already set.
6677+
type: boolean
6678+
source:
6679+
description: Attribute path of the array to extract key-value pairs from.
6680+
example: tags
6681+
type: string
6682+
target:
6683+
description: Attribute that receives the extracted key-value pairs. If not specified, the extracted attributes are added at the root level of the log.
6684+
example: extracted
6685+
type: string
6686+
type:
6687+
$ref: "#/components/schemas/LogsArrayProcessorOperationExtractKeyValueType"
6688+
value_to_extract:
6689+
description: Key of the attribute in each array element that holds the value to use for the extracted attribute.
6690+
example: value
6691+
type: string
6692+
required:
6693+
- type
6694+
- source
6695+
- key_to_extract
6696+
- value_to_extract
6697+
type: object
6698+
LogsArrayProcessorOperationExtractKeyValueType:
6699+
description: Operation type.
6700+
enum: [key-value]
6701+
example: key-value
6702+
type: string
6703+
x-enum-varnames:
6704+
- KEY_VALUE
66656705
LogsArrayProcessorOperationLength:
66666706
description: Operation that computes the length of a `source` array and stores the result in the `target` attribute.
66676707
properties:
@@ -6746,7 +6786,7 @@ components:
67466786
type: string
67476787
override_on_conflict:
67486788
default: false
6749-
description: Override or not the target element if already set,
6789+
description: Whether to override the target element if it's already set.
67506790
type: boolean
67516791
preserve_source:
67526792
default: false
@@ -7912,7 +7952,7 @@ components:
79127952
type: string
79137953
override_on_conflict:
79147954
default: false
7915-
description: Override or not the target element if already set.
7955+
description: Whether to override the target element if it's already set.
79167956
type: boolean
79177957
preserve_source:
79187958
default: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-07-22T18:27:14.576Z

cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.yml

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-07-22T18:27:15.202Z

cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.yml

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Create a pipeline with Array Processor Key Value Operation returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V1::LogsPipelinesAPI.new
5+
6+
body = DatadogAPIClient::V1::LogsPipeline.new({
7+
filter: DatadogAPIClient::V1::LogsFilter.new({
8+
query: "source:python",
9+
}),
10+
name: "testPipelineArrayKeyValue",
11+
processors: [
12+
DatadogAPIClient::V1::LogsArrayProcessor.new({
13+
type: DatadogAPIClient::V1::LogsArrayProcessorType::ARRAY_PROCESSOR,
14+
is_enabled: true,
15+
name: "extract_kv",
16+
operation: DatadogAPIClient::V1::LogsArrayProcessorOperationExtractKeyValue.new({
17+
type: DatadogAPIClient::V1::LogsArrayProcessorOperationExtractKeyValueType::KEY_VALUE,
18+
source: "tags",
19+
key_to_extract: "name",
20+
value_to_extract: "value",
21+
}),
22+
}),
23+
],
24+
tags: [],
25+
})
26+
p api_instance.create_logs_pipeline(body)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Create a pipeline with Array Processor Key Value Operation with target and override_on_conflict returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V1::LogsPipelinesAPI.new
5+
6+
body = DatadogAPIClient::V1::LogsPipeline.new({
7+
filter: DatadogAPIClient::V1::LogsFilter.new({
8+
query: "source:python",
9+
}),
10+
name: "testPipelineArrayKeyValueTarget",
11+
processors: [
12+
DatadogAPIClient::V1::LogsArrayProcessor.new({
13+
type: DatadogAPIClient::V1::LogsArrayProcessorType::ARRAY_PROCESSOR,
14+
is_enabled: true,
15+
name: "extract_kv_to_target",
16+
operation: DatadogAPIClient::V1::LogsArrayProcessorOperationExtractKeyValue.new({
17+
type: DatadogAPIClient::V1::LogsArrayProcessorOperationExtractKeyValueType::KEY_VALUE,
18+
source: "tags",
19+
key_to_extract: "name",
20+
value_to_extract: "value",
21+
target: "extracted",
22+
override_on_conflict: true,
23+
}),
24+
}),
25+
],
26+
tags: [],
27+
})
28+
p api_instance.create_logs_pipeline(body)

features/v1/logs_pipelines.feature

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,20 @@ Feature: Logs Pipelines
8484
When the request is sent
8585
Then the response status is 200 OK
8686

87+
@team:DataDog/logs-onboarding
88+
Scenario: Create a pipeline with Array Processor Key Value Operation returns "OK" response
89+
Given new "CreateLogsPipeline" request
90+
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": []}
91+
When the request is sent
92+
Then the response status is 200 OK
93+
94+
@team:DataDog/logs-onboarding
95+
Scenario: Create a pipeline with Array Processor Key Value Operation with target and override_on_conflict returns "OK" response
96+
Given new "CreateLogsPipeline" request
97+
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": []}
98+
When the request is sent
99+
Then the response status is 200 OK
100+
87101
@team:DataDog/logs-onboarding
88102
Scenario: Create a pipeline with Array Processor Length Operation returns "OK" response
89103
Given new "CreateLogsPipeline" request

lib/datadog_api_client/inflector.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ def overrides
307307
"v1.logs_array_processor_operation" => "LogsArrayProcessorOperation",
308308
"v1.logs_array_processor_operation_append" => "LogsArrayProcessorOperationAppend",
309309
"v1.logs_array_processor_operation_append_type" => "LogsArrayProcessorOperationAppendType",
310+
"v1.logs_array_processor_operation_extract_key_value" => "LogsArrayProcessorOperationExtractKeyValue",
311+
"v1.logs_array_processor_operation_extract_key_value_type" => "LogsArrayProcessorOperationExtractKeyValueType",
310312
"v1.logs_array_processor_operation_length" => "LogsArrayProcessorOperationLength",
311313
"v1.logs_array_processor_operation_length_type" => "LogsArrayProcessorOperationLengthType",
312314
"v1.logs_array_processor_operation_select" => "LogsArrayProcessorOperationSelect",

lib/datadog_api_client/v1/models/logs_array_processor.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module DatadogAPIClient::V1
2222
# - Select value from matching element
2323
# - Compute array length
2424
# - Append a value to an array
25+
# - Extract key-value pairs from an array
2526
class LogsArrayProcessor
2627
include BaseGenericModel
2728

0 commit comments

Comments
 (0)