Skip to content

Commit b5811ab

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit fa7f8f4 of spec repo
1 parent 4d78432 commit b5811ab

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
@@ -54340,6 +54340,16 @@ components:
5434054340
description: Name of the environment variable or secret that holds the username (used when `auth_strategy` is `plain`).
5434154341
example: HTTP_AUTH_USERNAME
5434254342
type: string
54343+
valid_tokens:
54344+
description: |-
54345+
A list of tokens that are accepted for authenticating incoming HTTP requests. When set,
54346+
the source rejects any request whose token does not match an enabled entry in this list.
54347+
Cannot be combined with the `plain` auth strategy.
54348+
items:
54349+
$ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidToken"
54350+
maxItems: 1000
54351+
minItems: 1
54352+
type: array
5434354353
required:
5434454354
- id
5434554355
- type
@@ -54365,6 +54375,55 @@ components:
5436554375
type: string
5436654376
x-enum-varnames:
5436754377
- HTTP_SERVER
54378+
ObservabilityPipelineHttpServerSourceValidToken:
54379+
description: An accepted token used to authenticate incoming HTTP server requests.
54380+
properties:
54381+
enabled:
54382+
default: true
54383+
description: |-
54384+
Indicates whether this token is currently accepted. Disabled tokens are rejected without
54385+
being removed from the configuration.
54386+
example: true
54387+
type: boolean
54388+
field_to_add:
54389+
$ref: "#/components/schemas/ObservabilityPipelineSourceValidTokenFieldToAdd"
54390+
path_to_token:
54391+
$ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToToken"
54392+
token_key:
54393+
description: Name of the environment variable or secret that holds the expected token value.
54394+
example: HTTP_SERVER_TOKEN
54395+
pattern: "^[A-Za-z0-9_]+$"
54396+
type: string
54397+
required:
54398+
- token_key
54399+
type: object
54400+
ObservabilityPipelineHttpServerSourceValidTokenPathToToken:
54401+
description: |-
54402+
Specifies where the worker extracts the token from in the incoming HTTP request.
54403+
This can be either a built-in location (`path` or `address`) or an HTTP header object.
54404+
oneOf:
54405+
- $ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation"
54406+
- $ref: "#/components/schemas/ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader"
54407+
ObservabilityPipelineHttpServerSourceValidTokenPathToTokenHeader:
54408+
description: Extract the token from a specific HTTP request header.
54409+
properties:
54410+
header:
54411+
description: The name of the HTTP header that carries the token.
54412+
example: X-Token
54413+
type: string
54414+
required:
54415+
- header
54416+
type: object
54417+
ObservabilityPipelineHttpServerSourceValidTokenPathToTokenLocation:
54418+
description: Built-in token location on the incoming HTTP request.
54419+
enum:
54420+
- path
54421+
- address
54422+
example: path
54423+
type: string
54424+
x-enum-varnames:
54425+
- PATH
54426+
- ADDRESS
5436854427
ObservabilityPipelineKafkaDestination:
5436954428
description: |-
5437054429
The `kafka` destination sends logs to Apache Kafka topics.
@@ -56388,6 +56447,27 @@ components:
5638856447
type: string
5638956448
x-enum-varnames:
5639056449
- SOCKET
56450+
ObservabilityPipelineSourceValidTokenFieldToAdd:
56451+
description: |-
56452+
An optional metadata field that is attached to every event authenticated by the
56453+
associated token. Both `key` and `value` must match `^[A-Za-z0-9_]+$`.
56454+
properties:
56455+
key:
56456+
description: The metadata field name to add to incoming events.
56457+
example: token_name
56458+
maxLength: 256
56459+
pattern: "^[A-Za-z0-9_]+$"
56460+
type: string
56461+
value:
56462+
description: The metadata field value to add to incoming events.
56463+
example: my_token
56464+
maxLength: 1024
56465+
pattern: "^[A-Za-z0-9_]+$"
56466+
type: string
56467+
required:
56468+
- key
56469+
- value
56470+
type: object
5639156471
ObservabilityPipelineSpec:
5639256472
description: Input schema representing an observability pipeline configuration. Used in create and validate requests.
5639356473
properties:
@@ -56584,6 +56664,15 @@ components:
5658456664
$ref: "#/components/schemas/ObservabilityPipelineTls"
5658556665
type:
5658656666
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecSourceType"
56667+
valid_tokens:
56668+
description: |-
56669+
A list of tokens that are accepted for authenticating incoming HEC requests. When set, the source
56670+
rejects any request whose HEC token does not match an enabled entry in this list.
56671+
items:
56672+
$ref: "#/components/schemas/ObservabilityPipelineSplunkHecSourceValidToken"
56673+
maxItems: 1000
56674+
minItems: 1
56675+
type: array
5658756676
required:
5658856677
- id
5658956678
- type
@@ -56598,6 +56687,26 @@ components:
5659856687
type: string
5659956688
x-enum-varnames:
5660056689
- SPLUNK_HEC
56690+
ObservabilityPipelineSplunkHecSourceValidToken:
56691+
description: An accepted HEC token used to authenticate incoming Splunk HEC requests.
56692+
properties:
56693+
enabled:
56694+
default: true
56695+
description: |-
56696+
Indicates whether this token is currently accepted. Disabled tokens are rejected without
56697+
being removed from the configuration.
56698+
example: true
56699+
type: boolean
56700+
field_to_add:
56701+
$ref: "#/components/schemas/ObservabilityPipelineSourceValidTokenFieldToAdd"
56702+
token_key:
56703+
description: Name of the environment variable or secret that holds the expected HEC token value.
56704+
example: SPLUNK_HEC_TOKEN
56705+
pattern: "^[A-Za-z0-9_]+$"
56706+
type: string
56707+
required:
56708+
- token_key
56709+
type: object
5660156710
ObservabilityPipelineSplunkTcpSource:
5660256711
description: |-
5660356712
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
@@ -23321,6 +23321,34 @@ datadog\_api\_client.v2.model.observability\_pipeline\_http\_server\_source\_typ
2332123321
:members:
2332223322
:show-inheritance:
2332323323

23324+
datadog\_api\_client.v2.model.observability\_pipeline\_http\_server\_source\_valid\_token module
23325+
------------------------------------------------------------------------------------------------
23326+
23327+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_http_server_source_valid_token
23328+
:members:
23329+
:show-inheritance:
23330+
23331+
datadog\_api\_client.v2.model.observability\_pipeline\_http\_server\_source\_valid\_token\_path\_to\_token module
23332+
-----------------------------------------------------------------------------------------------------------------
23333+
23334+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_http_server_source_valid_token_path_to_token
23335+
:members:
23336+
:show-inheritance:
23337+
23338+
datadog\_api\_client.v2.model.observability\_pipeline\_http\_server\_source\_valid\_token\_path\_to\_token\_header module
23339+
-------------------------------------------------------------------------------------------------------------------------
23340+
23341+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_http_server_source_valid_token_path_to_token_header
23342+
:members:
23343+
:show-inheritance:
23344+
23345+
datadog\_api\_client.v2.model.observability\_pipeline\_http\_server\_source\_valid\_token\_path\_to\_token\_location module
23346+
---------------------------------------------------------------------------------------------------------------------------
23347+
23348+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_http_server_source_valid_token_path_to_token_location
23349+
:members:
23350+
:show-inheritance:
23351+
2332423352
datadog\_api\_client.v2.model.observability\_pipeline\_kafka\_destination module
2332523353
--------------------------------------------------------------------------------
2332623354

@@ -24196,6 +24224,13 @@ datadog\_api\_client.v2.model.observability\_pipeline\_socket\_source\_type modu
2419624224
:members:
2419724225
:show-inheritance:
2419824226

24227+
datadog\_api\_client.v2.model.observability\_pipeline\_source\_valid\_token\_field\_to\_add module
24228+
--------------------------------------------------------------------------------------------------
24229+
24230+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_source_valid_token_field_to_add
24231+
:members:
24232+
:show-inheritance:
24233+
2419924234
datadog\_api\_client.v2.model.observability\_pipeline\_spec module
2420024235
------------------------------------------------------------------
2420124236

@@ -24273,6 +24308,13 @@ datadog\_api\_client.v2.model.observability\_pipeline\_splunk\_hec\_source\_type
2427324308
:members:
2427424309
:show-inheritance:
2427524310

24311+
datadog\_api\_client.v2.model.observability\_pipeline\_splunk\_hec\_source\_valid\_token module
24312+
-----------------------------------------------------------------------------------------------
24313+
24314+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_splunk_hec_source_valid_token
24315+
:members:
24316+
:show-inheritance:
24317+
2427624318
datadog\_api\_client.v2.model.observability\_pipeline\_splunk\_tcp\_source module
2427724319
---------------------------------------------------------------------------------
2427824320

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)