Skip to content

Commit 2c4fdd7

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 465019e of spec repo
1 parent 8fd87ff commit 2c4fdd7

19 files changed

Lines changed: 833 additions & 2 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50870,6 +50870,16 @@ components:
5087050870
description: Name of the environment variable or secret that holds the username (used when `auth_strategy` is `plain`).
5087150871
example: HTTP_AUTH_USERNAME
5087250872
type: string
50873+
valid_tokens:
50874+
description: |-
50875+
A list of tokens that are accepted for authenticating incoming HTTP requests. When set,
50876+
the source rejects any request whose token does not match an enabled entry in this list.
50877+
Cannot be combined with the `plain` auth strategy.
50878+
items:
50879+
$ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidToken"
50880+
maxItems: 1000
50881+
minItems: 1
50882+
type: array
5087350883
required:
5087450884
- id
5087550885
- type
@@ -50895,6 +50905,55 @@ components:
5089550905
type: string
5089650906
x-enum-varnames:
5089750907
- HTTP_SERVER
50908+
ObservabilityPipelineHttpServerSourceValidToken:
50909+
description: An accepted token used to authenticate incoming HTTP server requests.
50910+
properties:
50911+
enabled:
50912+
default: true
50913+
description: |-
50914+
Indicates whether this token is currently accepted. Disabled tokens are rejected without
50915+
being removed from the configuration.
50916+
example: true
50917+
type: boolean
50918+
field_to_add:
50919+
$ref: "#/components/schemas/ObservabilityPipelineSourceValidTokenFieldToAdd"
50920+
path_to_token:
50921+
$ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToToken"
50922+
token_key:
50923+
description: Name of the environment variable or secret that holds the expected token value.
50924+
example: HTTP_SERVER_TOKEN
50925+
pattern: "^[A-Za-z0-9_]+$"
50926+
type: string
50927+
required:
50928+
- token_key
50929+
type: object
50930+
ObservabilityPipelineHttpServerSourceValidTokenPathToToken:
50931+
description: |-
50932+
Specifies where the worker extracts the token from in the incoming HTTP request.
50933+
This can be either a built-in location (`path` or `address`) or an HTTP header object.
50934+
oneOf:
50935+
- $ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation"
50936+
- $ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader"
50937+
ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader:
50938+
description: Extract the token from a specific HTTP request header.
50939+
properties:
50940+
header:
50941+
description: The name of the HTTP header that carries the token.
50942+
example: X-Token
50943+
type: string
50944+
required:
50945+
- header
50946+
type: object
50947+
ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation:
50948+
description: Built-in token location on the incoming HTTP request.
50949+
enum:
50950+
- path
50951+
- address
50952+
example: path
50953+
type: string
50954+
x-enum-varnames:
50955+
- PATH
50956+
- ADDRESS
5089850957
ObservabilityPipelineKafkaDestination:
5089950958
description: |-
5090050959
The `kafka` destination sends logs to Apache Kafka topics.
@@ -52918,6 +52977,27 @@ components:
5291852977
type: string
5291952978
x-enum-varnames:
5292052979
- SOCKET
52980+
ObservabilityPipelineSourceValidTokenFieldToAdd:
52981+
description: |-
52982+
An optional metadata field that is attached to every event authenticated by the
52983+
associated token. Both `key` and `value` must match `^[A-Za-z0-9_]+$`.
52984+
properties:
52985+
key:
52986+
description: The metadata field name to add to incoming events.
52987+
example: token_name
52988+
maxLength: 256
52989+
pattern: "^[A-Za-z0-9_]+$"
52990+
type: string
52991+
value:
52992+
description: The metadata field value to add to incoming events.
52993+
example: my_token
52994+
maxLength: 1024
52995+
pattern: "^[A-Za-z0-9_]+$"
52996+
type: string
52997+
required:
52998+
- key
52999+
- value
53000+
type: object
5292153001
ObservabilityPipelineSpec:
5292253002
description: Input schema representing an observability pipeline configuration. Used in create and validate requests.
5292353003
properties:
@@ -53114,6 +53194,15 @@ components:
5311453194
$ref: "#/components/schemas/ObservabilityPipelineTls"
5311553195
type:
5311653196
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecSourceType"
53197+
valid_tokens:
53198+
description: |-
53199+
A list of tokens that are accepted for authenticating incoming HEC requests. When set, the source
53200+
rejects any request whose HEC token does not match an enabled entry in this list.
53201+
items:
53202+
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecSourceValidToken"
53203+
maxItems: 1000
53204+
minItems: 1
53205+
type: array
5311753206
required:
5311853207
- id
5311953208
- type
@@ -53128,6 +53217,26 @@ components:
5312853217
type: string
5312953218
x-enum-varnames:
5313053219
- SPLUNK_HEC
53220+
ObservabilityPipelineSplunkHecSourceValidToken:
53221+
description: An accepted HEC token used to authenticate incoming Splunk HEC requests.
53222+
properties:
53223+
enabled:
53224+
default: true
53225+
description: |-
53226+
Indicates whether this token is currently accepted. Disabled tokens are rejected without
53227+
being removed from the configuration.
53228+
example: true
53229+
type: boolean
53230+
field_to_add:
53231+
$ref: "#/components/schemas/ObservabilityPipelineSourceValidTokenFieldToAdd"
53232+
token_key:
53233+
description: Name of the environment variable or secret that holds the expected HEC token value.
53234+
example: SPLUNK_HEC_TOKEN
53235+
pattern: "^[A-Za-z0-9_]+$"
53236+
type: string
53237+
required:
53238+
- token_key
53239+
type: object
5313153240
ObservabilityPipelineSplunkTcpSource:
5313253241
description: |-
5313353242
The `splunk_tcp` source receives logs from a Splunk Universal Forwarder over TCP.

docs/datadog_api_client.v2.model.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21844,6 +21844,34 @@ datadog\_api\_client.v2.model.observability\_pipeline\_http\_server\_source\_typ
2184421844
:members:
2184521845
:show-inheritance:
2184621846

21847+
datadog\_api\_client.v2.model.observability\_pipeline\_http\_server\_source\_valid\_token module
21848+
------------------------------------------------------------------------------------------------
21849+
21850+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_http_server_source_valid_token
21851+
:members:
21852+
:show-inheritance:
21853+
21854+
datadog\_api\_client.v2.model.observability\_pipeline\_http\_server\_source\_valid\_token\_path\_to\_token module
21855+
-----------------------------------------------------------------------------------------------------------------
21856+
21857+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_http_server_source_valid_token_path_to_token
21858+
:members:
21859+
:show-inheritance:
21860+
21861+
datadog\_api\_client.v2.model.observability\_pipeline\_http\_server\_source\_valid\_token\_path\_to\_token\_header module
21862+
-------------------------------------------------------------------------------------------------------------------------
21863+
21864+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_http_server_source_valid_token_path_to_token_header
21865+
:members:
21866+
:show-inheritance:
21867+
21868+
datadog\_api\_client.v2.model.observability\_pipeline\_http\_server\_source\_valid\_token\_path\_to\_token\_location module
21869+
---------------------------------------------------------------------------------------------------------------------------
21870+
21871+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_http_server_source_valid_token_path_to_token_location
21872+
:members:
21873+
:show-inheritance:
21874+
2184721875
datadog\_api\_client.v2.model.observability\_pipeline\_kafka\_destination module
2184821876
--------------------------------------------------------------------------------
2184921877

@@ -22719,6 +22747,13 @@ datadog\_api\_client.v2.model.observability\_pipeline\_socket\_source\_type modu
2271922747
:members:
2272022748
:show-inheritance:
2272122749

22750+
datadog\_api\_client.v2.model.observability\_pipeline\_source\_valid\_token\_field\_to\_add module
22751+
--------------------------------------------------------------------------------------------------
22752+
22753+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_source_valid_token_field_to_add
22754+
:members:
22755+
:show-inheritance:
22756+
2272222757
datadog\_api\_client.v2.model.observability\_pipeline\_spec module
2272322758
------------------------------------------------------------------
2272422759

@@ -22796,6 +22831,13 @@ datadog\_api\_client.v2.model.observability\_pipeline\_splunk\_hec\_source\_type
2279622831
:members:
2279722832
:show-inheritance:
2279822833

22834+
datadog\_api\_client.v2.model.observability\_pipeline\_splunk\_hec\_source\_valid\_token module
22835+
-----------------------------------------------------------------------------------------------
22836+
22837+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_splunk_hec_source_valid_token
22838+
:members:
22839+
:show-inheritance:
22840+
2279922841
datadog\_api\_client.v2.model.observability\_pipeline\_splunk\_tcp\_source module
2280022842
---------------------------------------------------------------------------------
2280122843

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
"""
2+
Validate an observability pipeline with Splunk HEC source valid_tokens returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi
7+
from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig
8+
from datadog_api_client.v2.model.observability_pipeline_config_processor_group import (
9+
ObservabilityPipelineConfigProcessorGroup,
10+
)
11+
from datadog_api_client.v2.model.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes
12+
from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination import (
13+
ObservabilityPipelineDatadogLogsDestination,
14+
)
15+
from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination_type import (
16+
ObservabilityPipelineDatadogLogsDestinationType,
17+
)
18+
from datadog_api_client.v2.model.observability_pipeline_filter_processor import ObservabilityPipelineFilterProcessor
19+
from datadog_api_client.v2.model.observability_pipeline_filter_processor_type import (
20+
ObservabilityPipelineFilterProcessorType,
21+
)
22+
from datadog_api_client.v2.model.observability_pipeline_source_valid_token_field_to_add import (
23+
ObservabilityPipelineSourceValidTokenFieldToAdd,
24+
)
25+
from datadog_api_client.v2.model.observability_pipeline_spec import ObservabilityPipelineSpec
26+
from datadog_api_client.v2.model.observability_pipeline_spec_data import ObservabilityPipelineSpecData
27+
from datadog_api_client.v2.model.observability_pipeline_splunk_hec_source import ObservabilityPipelineSplunkHecSource
28+
from datadog_api_client.v2.model.observability_pipeline_splunk_hec_source_type import (
29+
ObservabilityPipelineSplunkHecSourceType,
30+
)
31+
from datadog_api_client.v2.model.observability_pipeline_splunk_hec_source_valid_token import (
32+
ObservabilityPipelineSplunkHecSourceValidToken,
33+
)
34+
35+
body = ObservabilityPipelineSpec(
36+
data=ObservabilityPipelineSpecData(
37+
attributes=ObservabilityPipelineDataAttributes(
38+
config=ObservabilityPipelineConfig(
39+
destinations=[
40+
ObservabilityPipelineDatadogLogsDestination(
41+
id="datadog-logs-destination",
42+
inputs=[
43+
"my-processor-group",
44+
],
45+
type=ObservabilityPipelineDatadogLogsDestinationType.DATADOG_LOGS,
46+
),
47+
],
48+
processor_groups=[
49+
ObservabilityPipelineConfigProcessorGroup(
50+
enabled=True,
51+
id="my-processor-group",
52+
include="service:my-service",
53+
inputs=[
54+
"splunk-hec-source",
55+
],
56+
processors=[
57+
ObservabilityPipelineFilterProcessor(
58+
enabled=True,
59+
id="filter-processor",
60+
include="status:error",
61+
type=ObservabilityPipelineFilterProcessorType.FILTER,
62+
),
63+
],
64+
),
65+
],
66+
sources=[
67+
ObservabilityPipelineSplunkHecSource(
68+
id="splunk-hec-source",
69+
type=ObservabilityPipelineSplunkHecSourceType.SPLUNK_HEC,
70+
valid_tokens=[
71+
ObservabilityPipelineSplunkHecSourceValidToken(
72+
token_key="SPLUNK_HEC_TOKEN",
73+
enabled=True,
74+
field_to_add=ObservabilityPipelineSourceValidTokenFieldToAdd(
75+
key="token_name",
76+
value="primary_token",
77+
),
78+
),
79+
ObservabilityPipelineSplunkHecSourceValidToken(
80+
token_key="SPLUNK_HEC_TOKEN_BACKUP",
81+
enabled=False,
82+
),
83+
],
84+
),
85+
],
86+
),
87+
name="Pipeline with Splunk HEC valid_tokens",
88+
),
89+
type="pipelines",
90+
),
91+
)
92+
93+
configuration = Configuration()
94+
with ApiClient(configuration) as api_client:
95+
api_instance = ObservabilityPipelinesApi(api_client)
96+
response = api_instance.validate_pipeline(body=body)
97+
98+
print(response)

0 commit comments

Comments
 (0)