Skip to content

Commit 21cbf2c

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 0a72619 of spec repo
1 parent 286ba55 commit 21cbf2c

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
@@ -53818,6 +53818,16 @@ components:
5381853818
description: Name of the environment variable or secret that holds the username (used when `auth_strategy` is `plain`).
5381953819
example: HTTP_AUTH_USERNAME
5382053820
type: string
53821+
valid_tokens:
53822+
description: |-
53823+
A list of tokens that are accepted for authenticating incoming HTTP requests. When set,
53824+
the source rejects any request whose token does not match an enabled entry in this list.
53825+
Cannot be combined with the `plain` auth strategy.
53826+
items:
53827+
$ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidToken"
53828+
maxItems: 1000
53829+
minItems: 1
53830+
type: array
5382153831
required:
5382253832
- id
5382353833
- type
@@ -53843,6 +53853,55 @@ components:
5384353853
type: string
5384453854
x-enum-varnames:
5384553855
- HTTP_SERVER
53856+
ObservabilityPipelineHttpServerSourceValidToken:
53857+
description: An accepted token used to authenticate incoming HTTP server requests.
53858+
properties:
53859+
enabled:
53860+
default: true
53861+
description: |-
53862+
Indicates whether this token is currently accepted. Disabled tokens are rejected without
53863+
being removed from the configuration.
53864+
example: true
53865+
type: boolean
53866+
field_to_add:
53867+
$ref: "#/components/schemas/ObservabilityPipelineSourceValidTokenFieldToAdd"
53868+
path_to_token:
53869+
$ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToToken"
53870+
token_key:
53871+
description: Name of the environment variable or secret that holds the expected token value.
53872+
example: HTTP_SERVER_TOKEN
53873+
pattern: "^[A-Za-z0-9_]+$"
53874+
type: string
53875+
required:
53876+
- token_key
53877+
type: object
53878+
ObservabilityPipelineHttpServerSourceValidTokenPathToToken:
53879+
description: |-
53880+
Specifies where the worker extracts the token from in the incoming HTTP request.
53881+
This can be either a built-in location (`path` or `address`) or an HTTP header object.
53882+
oneOf:
53883+
- $ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation"
53884+
- $ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader"
53885+
ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader:
53886+
description: Extract the token from a specific HTTP request header.
53887+
properties:
53888+
header:
53889+
description: The name of the HTTP header that carries the token.
53890+
example: X-Token
53891+
type: string
53892+
required:
53893+
- header
53894+
type: object
53895+
ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation:
53896+
description: Built-in token location on the incoming HTTP request.
53897+
enum:
53898+
- path
53899+
- address
53900+
example: path
53901+
type: string
53902+
x-enum-varnames:
53903+
- PATH
53904+
- ADDRESS
5384653905
ObservabilityPipelineKafkaDestination:
5384753906
description: |-
5384853907
The `kafka` destination sends logs to Apache Kafka topics.
@@ -55866,6 +55925,27 @@ components:
5586655925
type: string
5586755926
x-enum-varnames:
5586855927
- SOCKET
55928+
ObservabilityPipelineSourceValidTokenFieldToAdd:
55929+
description: |-
55930+
An optional metadata field that is attached to every event authenticated by the
55931+
associated token. Both `key` and `value` must match `^[A-Za-z0-9_]+$`.
55932+
properties:
55933+
key:
55934+
description: The metadata field name to add to incoming events.
55935+
example: token_name
55936+
maxLength: 256
55937+
pattern: "^[A-Za-z0-9_]+$"
55938+
type: string
55939+
value:
55940+
description: The metadata field value to add to incoming events.
55941+
example: my_token
55942+
maxLength: 1024
55943+
pattern: "^[A-Za-z0-9_]+$"
55944+
type: string
55945+
required:
55946+
- key
55947+
- value
55948+
type: object
5586955949
ObservabilityPipelineSpec:
5587055950
description: Input schema representing an observability pipeline configuration. Used in create and validate requests.
5587155951
properties:
@@ -56062,6 +56142,15 @@ components:
5606256142
$ref: "#/components/schemas/ObservabilityPipelineTls"
5606356143
type:
5606456144
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecSourceType"
56145+
valid_tokens:
56146+
description: |-
56147+
A list of tokens that are accepted for authenticating incoming HEC requests. When set, the source
56148+
rejects any request whose HEC token does not match an enabled entry in this list.
56149+
items:
56150+
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecSourceValidToken"
56151+
maxItems: 1000
56152+
minItems: 1
56153+
type: array
5606556154
required:
5606656155
- id
5606756156
- type
@@ -56076,6 +56165,26 @@ components:
5607656165
type: string
5607756166
x-enum-varnames:
5607856167
- SPLUNK_HEC
56168+
ObservabilityPipelineSplunkHecSourceValidToken:
56169+
description: An accepted HEC token used to authenticate incoming Splunk HEC requests.
56170+
properties:
56171+
enabled:
56172+
default: true
56173+
description: |-
56174+
Indicates whether this token is currently accepted. Disabled tokens are rejected without
56175+
being removed from the configuration.
56176+
example: true
56177+
type: boolean
56178+
field_to_add:
56179+
$ref: "#/components/schemas/ObservabilityPipelineSourceValidTokenFieldToAdd"
56180+
token_key:
56181+
description: Name of the environment variable or secret that holds the expected HEC token value.
56182+
example: SPLUNK_HEC_TOKEN
56183+
pattern: "^[A-Za-z0-9_]+$"
56184+
type: string
56185+
required:
56186+
- token_key
56187+
type: object
5607956188
ObservabilityPipelineSplunkTcpSource:
5608056189
description: |-
5608156190
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
@@ -23125,6 +23125,34 @@ datadog\_api\_client.v2.model.observability\_pipeline\_http\_server\_source\_typ
2312523125
:members:
2312623126
:show-inheritance:
2312723127

23128+
datadog\_api\_client.v2.model.observability\_pipeline\_http\_server\_source\_valid\_token module
23129+
------------------------------------------------------------------------------------------------
23130+
23131+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_http_server_source_valid_token
23132+
:members:
23133+
:show-inheritance:
23134+
23135+
datadog\_api\_client.v2.model.observability\_pipeline\_http\_server\_source\_valid\_token\_path\_to\_token module
23136+
-----------------------------------------------------------------------------------------------------------------
23137+
23138+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_http_server_source_valid_token_path_to_token
23139+
:members:
23140+
:show-inheritance:
23141+
23142+
datadog\_api\_client.v2.model.observability\_pipeline\_http\_server\_source\_valid\_token\_path\_to\_token\_header module
23143+
-------------------------------------------------------------------------------------------------------------------------
23144+
23145+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_http_server_source_valid_token_path_to_token_header
23146+
:members:
23147+
:show-inheritance:
23148+
23149+
datadog\_api\_client.v2.model.observability\_pipeline\_http\_server\_source\_valid\_token\_path\_to\_token\_location module
23150+
---------------------------------------------------------------------------------------------------------------------------
23151+
23152+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_http_server_source_valid_token_path_to_token_location
23153+
:members:
23154+
:show-inheritance:
23155+
2312823156
datadog\_api\_client.v2.model.observability\_pipeline\_kafka\_destination module
2312923157
--------------------------------------------------------------------------------
2313023158

@@ -24000,6 +24028,13 @@ datadog\_api\_client.v2.model.observability\_pipeline\_socket\_source\_type modu
2400024028
:members:
2400124029
:show-inheritance:
2400224030

24031+
datadog\_api\_client.v2.model.observability\_pipeline\_source\_valid\_token\_field\_to\_add module
24032+
--------------------------------------------------------------------------------------------------
24033+
24034+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_source_valid_token_field_to_add
24035+
:members:
24036+
:show-inheritance:
24037+
2400324038
datadog\_api\_client.v2.model.observability\_pipeline\_spec module
2400424039
------------------------------------------------------------------
2400524040

@@ -24077,6 +24112,13 @@ datadog\_api\_client.v2.model.observability\_pipeline\_splunk\_hec\_source\_type
2407724112
:members:
2407824113
:show-inheritance:
2407924114

24115+
datadog\_api\_client.v2.model.observability\_pipeline\_splunk\_hec\_source\_valid\_token module
24116+
-----------------------------------------------------------------------------------------------
24117+
24118+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_splunk_hec_source_valid_token
24119+
:members:
24120+
:show-inheritance:
24121+
2408024122
datadog\_api\_client.v2.model.observability\_pipeline\_splunk\_tcp\_source module
2408124123
---------------------------------------------------------------------------------
2408224124

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)