Skip to content

Commit 496257a

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 98a0c93 of spec repo
1 parent 5d69285 commit 496257a

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
@@ -50872,6 +50872,16 @@ components:
5087250872
description: Name of the environment variable or secret that holds the username (used when `auth_strategy` is `plain`).
5087350873
example: HTTP_AUTH_USERNAME
5087450874
type: string
50875+
valid_tokens:
50876+
description: |-
50877+
A list of tokens that are accepted for authenticating incoming HTTP requests. When set,
50878+
the source rejects any request whose token does not match an enabled entry in this list.
50879+
Cannot be combined with the `plain` auth strategy.
50880+
items:
50881+
$ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidToken"
50882+
maxItems: 1000
50883+
minItems: 1
50884+
type: array
5087550885
required:
5087650886
- id
5087750887
- type
@@ -50897,6 +50907,55 @@ components:
5089750907
type: string
5089850908
x-enum-varnames:
5089950909
- HTTP_SERVER
50910+
ObservabilityPipelineHttpServerSourceValidToken:
50911+
description: An accepted token used to authenticate incoming HTTP server requests.
50912+
properties:
50913+
enabled:
50914+
default: true
50915+
description: |-
50916+
Indicates whether this token is currently accepted. Disabled tokens are rejected without
50917+
being removed from the configuration.
50918+
example: true
50919+
type: boolean
50920+
field_to_add:
50921+
$ref: "#/components/schemas/ObservabilityPipelineSourceValidTokenFieldToAdd"
50922+
path_to_token:
50923+
$ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToToken"
50924+
token_key:
50925+
description: Name of the environment variable or secret that holds the expected token value.
50926+
example: HTTP_SERVER_TOKEN
50927+
pattern: "^[A-Za-z0-9_]+$"
50928+
type: string
50929+
required:
50930+
- token_key
50931+
type: object
50932+
ObservabilityPipelineHttpServerSourceValidTokenPathToToken:
50933+
description: |-
50934+
Specifies where the worker extracts the token from in the incoming HTTP request.
50935+
This can be either a built-in location (`path` or `address`) or an HTTP header object.
50936+
oneOf:
50937+
- $ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation"
50938+
- $ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader"
50939+
ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader:
50940+
description: Extract the token from a specific HTTP request header.
50941+
properties:
50942+
header:
50943+
description: The name of the HTTP header that carries the token.
50944+
example: X-Token
50945+
type: string
50946+
required:
50947+
- header
50948+
type: object
50949+
ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation:
50950+
description: Built-in token location on the incoming HTTP request.
50951+
enum:
50952+
- path
50953+
- address
50954+
example: path
50955+
type: string
50956+
x-enum-varnames:
50957+
- PATH
50958+
- ADDRESS
5090050959
ObservabilityPipelineKafkaDestination:
5090150960
description: |-
5090250961
The `kafka` destination sends logs to Apache Kafka topics.
@@ -52920,6 +52979,27 @@ components:
5292052979
type: string
5292152980
x-enum-varnames:
5292252981
- SOCKET
52982+
ObservabilityPipelineSourceValidTokenFieldToAdd:
52983+
description: |-
52984+
An optional metadata field that is attached to every event authenticated by the
52985+
associated token. Both `key` and `value` must match `^[A-Za-z0-9_]+$`.
52986+
properties:
52987+
key:
52988+
description: The metadata field name to add to incoming events.
52989+
example: token_name
52990+
maxLength: 256
52991+
pattern: "^[A-Za-z0-9_]+$"
52992+
type: string
52993+
value:
52994+
description: The metadata field value to add to incoming events.
52995+
example: my_token
52996+
maxLength: 1024
52997+
pattern: "^[A-Za-z0-9_]+$"
52998+
type: string
52999+
required:
53000+
- key
53001+
- value
53002+
type: object
5292353003
ObservabilityPipelineSpec:
5292453004
description: Input schema representing an observability pipeline configuration. Used in create and validate requests.
5292553005
properties:
@@ -53116,6 +53196,15 @@ components:
5311653196
$ref: "#/components/schemas/ObservabilityPipelineTls"
5311753197
type:
5311853198
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecSourceType"
53199+
valid_tokens:
53200+
description: |-
53201+
A list of tokens that are accepted for authenticating incoming HEC requests. When set, the source
53202+
rejects any request whose HEC token does not match an enabled entry in this list.
53203+
items:
53204+
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecSourceValidToken"
53205+
maxItems: 1000
53206+
minItems: 1
53207+
type: array
5311953208
required:
5312053209
- id
5312153210
- type
@@ -53130,6 +53219,26 @@ components:
5313053219
type: string
5313153220
x-enum-varnames:
5313253221
- SPLUNK_HEC
53222+
ObservabilityPipelineSplunkHecSourceValidToken:
53223+
description: An accepted HEC token used to authenticate incoming Splunk HEC requests.
53224+
properties:
53225+
enabled:
53226+
default: true
53227+
description: |-
53228+
Indicates whether this token is currently accepted. Disabled tokens are rejected without
53229+
being removed from the configuration.
53230+
example: true
53231+
type: boolean
53232+
field_to_add:
53233+
$ref: "#/components/schemas/ObservabilityPipelineSourceValidTokenFieldToAdd"
53234+
token_key:
53235+
description: Name of the environment variable or secret that holds the expected HEC token value.
53236+
example: SPLUNK_HEC_TOKEN
53237+
pattern: "^[A-Za-z0-9_]+$"
53238+
type: string
53239+
required:
53240+
- token_key
53241+
type: object
5313353242
ObservabilityPipelineSplunkTcpSource:
5313453243
description: |-
5313553244
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)