Skip to content

Commit 8845e6e

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit fde9d6e of spec repo
1 parent 31baab0 commit 8845e6e

22 files changed

Lines changed: 745 additions & 0 deletions

.generator/schemas/v1/openapi.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6182,6 +6182,76 @@ components:
61826182
type: string
61836183
x-enum-varnames:
61846184
- ARITHMETIC_PROCESSOR
6185+
LogsArrayMapProcessor:
6186+
description: |-
6187+
The array-map processor transforms each element of a source array by running
6188+
sub-processors against it and writing results to a target array.
6189+
Sub-processors reference the current element via `$sourceElem` (read) and
6190+
`$targetElem` (write). Parent log attributes are read via plain paths as usual.
6191+
Supported sub-processor types: `attribute-remapper`, `string-builder-processor`,
6192+
`arithmetic-processor`, `category-processor`.
6193+
`is_enabled` on sub-processors is ignored; sub-processor execution is gated
6194+
entirely by the parent array-map's `is_enabled` flag.
6195+
properties:
6196+
is_enabled:
6197+
default: false
6198+
description: Whether or not the processor is enabled.
6199+
type: boolean
6200+
name:
6201+
description: Name of the processor.
6202+
type: string
6203+
preserve_source:
6204+
default: true
6205+
description: |-
6206+
When `false` and `source != target`, the source attribute is removed after
6207+
processing. Cannot be `false` when `source == target`.
6208+
type: boolean
6209+
processors:
6210+
description: |-
6211+
Sub-processors applied to each element. Allowed types: `attribute-remapper`,
6212+
`string-builder-processor`, `arithmetic-processor`, `category-processor`.
6213+
items:
6214+
$ref: "#/components/schemas/LogsArrayMapSubProcessor"
6215+
type: array
6216+
source:
6217+
description: |-
6218+
Attribute path of the source array. Elements are read-only via `$sourceElem`
6219+
inside sub-processors.
6220+
example: detail.resource.s3BucketDetails
6221+
type: string
6222+
target:
6223+
description: |-
6224+
Attribute path of the output array. Sub-processors write to `$targetElem`
6225+
(or `$targetElem.<field>`) to build each output element.
6226+
example: ocsf.resources
6227+
type: string
6228+
type:
6229+
$ref: "#/components/schemas/LogsArrayMapProcessorType"
6230+
required:
6231+
- source
6232+
- target
6233+
- processors
6234+
- type
6235+
type: object
6236+
LogsArrayMapProcessorType:
6237+
default: array-map-processor
6238+
description: Type of logs array-map processor.
6239+
enum:
6240+
- array-map-processor
6241+
example: array-map-processor
6242+
type: string
6243+
x-enum-varnames:
6244+
- ARRAY_MAP_PROCESSOR
6245+
LogsArrayMapSubProcessor:
6246+
description: |-
6247+
A sub-processor used inside an array-map processor.
6248+
Allowed types: `attribute-remapper`, `string-builder-processor`,
6249+
`arithmetic-processor`, `category-processor`.
6250+
oneOf:
6251+
- $ref: "#/components/schemas/LogsAttributeRemapper"
6252+
- $ref: "#/components/schemas/LogsStringBuilderProcessor"
6253+
- $ref: "#/components/schemas/LogsArithmeticProcessor"
6254+
- $ref: "#/components/schemas/LogsCategoryProcessor"
61856255
LogsArrayProcessor:
61866256
description: |-
61876257
A processor for extracting, aggregating, or transforming values from JSON arrays within your logs.
@@ -7237,6 +7307,7 @@ components:
72377307
- $ref: "#/components/schemas/LogsDecoderProcessor"
72387308
- $ref: "#/components/schemas/LogsSchemaProcessor"
72397309
- $ref: "#/components/schemas/LogsExcludeAttributeProcessor"
7310+
- $ref: "#/components/schemas/LogsArrayMapProcessor"
72407311
LogsQueryCompute:
72417312
description: Define computation for a log query.
72427313
properties:

docs/datadog_api_client.v1.model.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,6 +1957,27 @@ datadog\_api\_client.v1.model.logs\_arithmetic\_processor\_type module
19571957
:members:
19581958
:show-inheritance:
19591959

1960+
datadog\_api\_client.v1.model.logs\_array\_map\_processor module
1961+
----------------------------------------------------------------
1962+
1963+
.. automodule:: datadog_api_client.v1.model.logs_array_map_processor
1964+
:members:
1965+
:show-inheritance:
1966+
1967+
datadog\_api\_client.v1.model.logs\_array\_map\_processor\_type module
1968+
----------------------------------------------------------------------
1969+
1970+
.. automodule:: datadog_api_client.v1.model.logs_array_map_processor_type
1971+
:members:
1972+
:show-inheritance:
1973+
1974+
datadog\_api\_client.v1.model.logs\_array\_map\_sub\_processor module
1975+
---------------------------------------------------------------------
1976+
1977+
.. automodule:: datadog_api_client.v1.model.logs_array_map_sub_processor
1978+
:members:
1979+
:show-inheritance:
1980+
19601981
datadog\_api\_client.v1.model.logs\_array\_processor module
19611982
-----------------------------------------------------------
19621983

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
"""
2+
Create a pipeline with Array Map Processor with preserve_source false returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v1.api.logs_pipelines_api import LogsPipelinesApi
7+
from datadog_api_client.v1.model.logs_array_map_processor import LogsArrayMapProcessor
8+
from datadog_api_client.v1.model.logs_array_map_processor_type import LogsArrayMapProcessorType
9+
from datadog_api_client.v1.model.logs_attribute_remapper import LogsAttributeRemapper
10+
from datadog_api_client.v1.model.logs_attribute_remapper_type import LogsAttributeRemapperType
11+
from datadog_api_client.v1.model.logs_filter import LogsFilter
12+
from datadog_api_client.v1.model.logs_pipeline import LogsPipeline
13+
14+
body = LogsPipeline(
15+
filter=LogsFilter(
16+
query="source:python",
17+
),
18+
name="testPipelineArrayMapNoPreserve",
19+
processors=[
20+
LogsArrayMapProcessor(
21+
type=LogsArrayMapProcessorType.ARRAY_MAP_PROCESSOR,
22+
is_enabled=True,
23+
name="map and remove source",
24+
source="items",
25+
target="out",
26+
preserve_source=False,
27+
processors=[
28+
LogsAttributeRemapper(
29+
type=LogsAttributeRemapperType.ATTRIBUTE_REMAPPER,
30+
sources=[
31+
"$sourceElem.id",
32+
],
33+
target="$targetElem.uid",
34+
),
35+
],
36+
),
37+
],
38+
tags=[],
39+
)
40+
41+
configuration = Configuration()
42+
with ApiClient(configuration) as api_client:
43+
api_instance = LogsPipelinesApi(api_client)
44+
response = api_instance.create_logs_pipeline(body=body)
45+
46+
print(response)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
"""
2+
Create a pipeline with Array Map Processor using category sub-processor returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v1.api.logs_pipelines_api import LogsPipelinesApi
7+
from datadog_api_client.v1.model.logs_array_map_processor import LogsArrayMapProcessor
8+
from datadog_api_client.v1.model.logs_array_map_processor_type import LogsArrayMapProcessorType
9+
from datadog_api_client.v1.model.logs_category_processor import LogsCategoryProcessor
10+
from datadog_api_client.v1.model.logs_category_processor_category import LogsCategoryProcessorCategory
11+
from datadog_api_client.v1.model.logs_category_processor_type import LogsCategoryProcessorType
12+
from datadog_api_client.v1.model.logs_filter import LogsFilter
13+
from datadog_api_client.v1.model.logs_pipeline import LogsPipeline
14+
15+
body = LogsPipeline(
16+
filter=LogsFilter(
17+
query="source:python",
18+
),
19+
name="testPipelineArrayMapCategory",
20+
processors=[
21+
LogsArrayMapProcessor(
22+
type=LogsArrayMapProcessorType.ARRAY_MAP_PROCESSOR,
23+
is_enabled=True,
24+
name="categorize items",
25+
source="items",
26+
target="out",
27+
processors=[
28+
LogsCategoryProcessor(
29+
type=LogsCategoryProcessorType.CATEGORY_PROCESSOR,
30+
target="$targetElem.level",
31+
categories=[
32+
LogsCategoryProcessorCategory(
33+
filter=LogsFilter(
34+
query="@$sourceElem.status:error",
35+
),
36+
name="error",
37+
),
38+
LogsCategoryProcessorCategory(
39+
filter=LogsFilter(
40+
query="*",
41+
),
42+
name="info",
43+
),
44+
],
45+
),
46+
],
47+
),
48+
],
49+
tags=[],
50+
)
51+
52+
configuration = Configuration()
53+
with ApiClient(configuration) as api_client:
54+
api_instance = LogsPipelinesApi(api_client)
55+
response = api_instance.create_logs_pipeline(body=body)
56+
57+
print(response)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
"""
2+
Create a pipeline with Array Map Processor using arithmetic sub-processor returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v1.api.logs_pipelines_api import LogsPipelinesApi
7+
from datadog_api_client.v1.model.logs_arithmetic_processor import LogsArithmeticProcessor
8+
from datadog_api_client.v1.model.logs_arithmetic_processor_type import LogsArithmeticProcessorType
9+
from datadog_api_client.v1.model.logs_array_map_processor import LogsArrayMapProcessor
10+
from datadog_api_client.v1.model.logs_array_map_processor_type import LogsArrayMapProcessorType
11+
from datadog_api_client.v1.model.logs_filter import LogsFilter
12+
from datadog_api_client.v1.model.logs_pipeline import LogsPipeline
13+
14+
body = LogsPipeline(
15+
filter=LogsFilter(
16+
query="source:python",
17+
),
18+
name="testPipelineArrayMapArithmetic",
19+
processors=[
20+
LogsArrayMapProcessor(
21+
type=LogsArrayMapProcessorType.ARRAY_MAP_PROCESSOR,
22+
is_enabled=True,
23+
name="double counts",
24+
source="items",
25+
target="out",
26+
processors=[
27+
LogsArithmeticProcessor(
28+
type=LogsArithmeticProcessorType.ARITHMETIC_PROCESSOR,
29+
expression="$sourceElem.count * 2",
30+
target="$targetElem.doubled",
31+
),
32+
],
33+
),
34+
],
35+
tags=[],
36+
)
37+
38+
configuration = Configuration()
39+
with ApiClient(configuration) as api_client:
40+
api_instance = LogsPipelinesApi(api_client)
41+
response = api_instance.create_logs_pipeline(body=body)
42+
43+
print(response)
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
"""
2+
Create a pipeline with Array Map Processor returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v1.api.logs_pipelines_api import LogsPipelinesApi
7+
from datadog_api_client.v1.model.logs_array_map_processor import LogsArrayMapProcessor
8+
from datadog_api_client.v1.model.logs_array_map_processor_type import LogsArrayMapProcessorType
9+
from datadog_api_client.v1.model.logs_attribute_remapper import LogsAttributeRemapper
10+
from datadog_api_client.v1.model.logs_attribute_remapper_type import LogsAttributeRemapperType
11+
from datadog_api_client.v1.model.logs_filter import LogsFilter
12+
from datadog_api_client.v1.model.logs_pipeline import LogsPipeline
13+
from datadog_api_client.v1.model.logs_string_builder_processor import LogsStringBuilderProcessor
14+
from datadog_api_client.v1.model.logs_string_builder_processor_type import LogsStringBuilderProcessorType
15+
16+
body = LogsPipeline(
17+
filter=LogsFilter(
18+
query="source:python",
19+
),
20+
name="testPipelineArrayMap",
21+
processors=[
22+
LogsArrayMapProcessor(
23+
type=LogsArrayMapProcessorType.ARRAY_MAP_PROCESSOR,
24+
is_enabled=True,
25+
name="map items",
26+
source="items",
27+
target="out",
28+
preserve_source=True,
29+
processors=[
30+
LogsAttributeRemapper(
31+
type=LogsAttributeRemapperType.ATTRIBUTE_REMAPPER,
32+
sources=[
33+
"$sourceElem.id",
34+
],
35+
target="$targetElem.uid",
36+
preserve_source=True,
37+
),
38+
LogsStringBuilderProcessor(
39+
type=LogsStringBuilderProcessorType.STRING_BUILDER_PROCESSOR,
40+
template="item-%{$sourceElem.id}",
41+
target="$targetElem.label",
42+
),
43+
],
44+
),
45+
],
46+
tags=[],
47+
)
48+
49+
configuration = Configuration()
50+
with ApiClient(configuration) as api_client:
51+
api_instance = LogsPipelinesApi(api_client)
52+
response = api_instance.create_logs_pipeline(body=body)
53+
54+
print(response)

0 commit comments

Comments
 (0)