Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63949,6 +63949,7 @@ components:
- $ref: "#/components/schemas/ObservabilityPipelineSplunkTcpSource"
- $ref: "#/components/schemas/ObservabilityPipelineSumoLogicSource"
- $ref: "#/components/schemas/ObservabilityPipelineSyslogNgSource"
- $ref: "#/components/schemas/ObservabilityPipelineWebsocketSource"
- $ref: "#/components/schemas/ObservabilityPipelineOpentelemetrySource"
ObservabilityPipelineCrowdStrikeNextGenSiemDestination:
description: |-
Expand Down Expand Up @@ -68605,6 +68606,128 @@ components:
required:
- crt_file
type: object
ObservabilityPipelineWebsocketSource:
description: |-
The `websocket` source ingests logs from a WebSocket server using the `ws://` or `wss://` protocol.

**Supported pipeline types:** logs.
properties:
auth_strategy:
$ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceAuthStrategy"
custom_key:
description: Name of the environment variable or secret that holds the custom authorization header value. Used when `auth_strategy` is `custom`.
example: WS_AUTH_CUSTOM_HEADER
type: string
decoding:
$ref: "#/components/schemas/ObservabilityPipelineDecoding"
id:
description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components).
example: websocket-source
type: string
password_key:
description: Name of the environment variable or secret that holds the password. Used when `auth_strategy` is `basic`.
example: WS_AUTH_PASSWORD
type: string
tls:
$ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceTls"
token_key:
description: Name of the environment variable or secret that holds the bearer token. Used when `auth_strategy` is `bearer`.
example: WS_BEARER_TOKEN
type: string
type:
$ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceType"
uri_key:
description: Name of the environment variable or secret that holds the WebSocket server URI (`ws://` or `wss://`).
example: WS_URI
type: string
username_key:
description: Name of the environment variable or secret that holds the username. Used when `auth_strategy` is `basic`.
example: WS_AUTH_USERNAME
type: string
required:
- id
- type
- decoding
- auth_strategy
type: object
x-pipeline-types: [logs]
ObservabilityPipelineWebsocketSourceAuthStrategy:
description: Authentication strategy for the WebSocket source connection.
enum:
- none
- basic
- bearer
- custom
example: bearer
type: string
x-enum-varnames:
- NONE
- BASIC
- BEARER
- CUSTOM
ObservabilityPipelineWebsocketSourceTls:
description: TLS configuration for the WebSocket source. Use `enabled` for standard `wss://` connections, or `with_client_cert` to present a client certificate for mutual TLS.
oneOf:
- $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceTlsEnabled"
- $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceTlsWithClientCert"
ObservabilityPipelineWebsocketSourceTlsEnabled:
description: TLS configuration that enables encryption without a client certificate. Use this for standard `wss://` connections that do not require mutual TLS.
properties:
mode:
$ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceTlsEnabledMode"
required:
- mode
type: object
ObservabilityPipelineWebsocketSourceTlsEnabledMode:
description: TLS mode. Must be `enabled`.
enum:
- enabled
example: enabled
type: string
x-enum-varnames:
- ENABLED
ObservabilityPipelineWebsocketSourceTlsWithClientCert:
description: TLS configuration that enables encryption and presents a client certificate for mutual TLS authentication.
properties:
ca_file:
description: Path to the Certificate Authority (CA) file used to validate the remote server's TLS certificate.
example: /path/to/ca.crt
type: string
crt_file:
description: Path to the TLS client certificate file used to identify this source to the remote server.
example: /path/to/client.crt
type: string
key_file:
description: Path to the private key file associated with the client certificate.
example: /path/to/client.key
type: string
key_pass_key:
description: Name of the environment variable or secret that holds the passphrase for the private key file.
example: WS_TLS_KEY_PASSPHRASE
type: string
mode:
$ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceTlsWithClientCertMode"
required:
- mode
- crt_file
type: object
ObservabilityPipelineWebsocketSourceTlsWithClientCertMode:
description: TLS mode. Must be `with_client_cert`.
enum:
- with_client_cert
example: with_client_cert
type: string
x-enum-varnames:
- WITH_CLIENT_CERT
ObservabilityPipelineWebsocketSourceType:
default: websocket
description: The source type. The value should always be `websocket`.
enum:
- websocket
example: websocket
type: string
x-enum-varnames:
- WEBSOCKET
OktaAPIToken:
description: The definition of the `OktaAPIToken` object.
properties:
Expand Down
56 changes: 56 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28501,6 +28501,62 @@ datadog\_api\_client.v2.model.observability\_pipeline\_tls module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_websocket\_source module
-------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.observability_pipeline_websocket_source
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_websocket\_source\_auth\_strategy module
-----------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.observability_pipeline_websocket_source_auth_strategy
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_websocket\_source\_tls module
------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.observability_pipeline_websocket_source_tls
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_websocket\_source\_tls\_enabled module
---------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.observability_pipeline_websocket_source_tls_enabled
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_websocket\_source\_tls\_enabled\_mode module
---------------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.observability_pipeline_websocket_source_tls_enabled_mode
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_websocket\_source\_tls\_with\_client\_cert module
--------------------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.observability_pipeline_websocket_source_tls_with_client_cert
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_websocket\_source\_tls\_with\_client\_cert\_mode module
--------------------------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.observability_pipeline_websocket_source_tls_with_client_cert_mode
:members:
:show-inheritance:

datadog\_api\_client.v2.model.observability\_pipeline\_websocket\_source\_type module
-------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.observability_pipeline_websocket_source_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.oci\_config module
------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
"""
Validate an observability pipeline with websocket source bearer auth returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi
from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig
from datadog_api_client.v2.model.observability_pipeline_config_processor_group import (
ObservabilityPipelineConfigProcessorGroup,
)
from datadog_api_client.v2.model.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes
from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination import (
ObservabilityPipelineDatadogLogsDestination,
)
from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination_type import (
ObservabilityPipelineDatadogLogsDestinationType,
)
from datadog_api_client.v2.model.observability_pipeline_decoding import ObservabilityPipelineDecoding
from datadog_api_client.v2.model.observability_pipeline_filter_processor import ObservabilityPipelineFilterProcessor
from datadog_api_client.v2.model.observability_pipeline_filter_processor_type import (
ObservabilityPipelineFilterProcessorType,
)
from datadog_api_client.v2.model.observability_pipeline_spec import ObservabilityPipelineSpec
from datadog_api_client.v2.model.observability_pipeline_spec_data import ObservabilityPipelineSpecData
from datadog_api_client.v2.model.observability_pipeline_websocket_source import ObservabilityPipelineWebsocketSource
from datadog_api_client.v2.model.observability_pipeline_websocket_source_auth_strategy import (
ObservabilityPipelineWebsocketSourceAuthStrategy,
)
from datadog_api_client.v2.model.observability_pipeline_websocket_source_tls_enabled import (
ObservabilityPipelineWebsocketSourceTlsEnabled,
)
from datadog_api_client.v2.model.observability_pipeline_websocket_source_tls_enabled_mode import (
ObservabilityPipelineWebsocketSourceTlsEnabledMode,
)
from datadog_api_client.v2.model.observability_pipeline_websocket_source_type import (
ObservabilityPipelineWebsocketSourceType,
)

body = ObservabilityPipelineSpec(
data=ObservabilityPipelineSpecData(
attributes=ObservabilityPipelineDataAttributes(
config=ObservabilityPipelineConfig(
destinations=[
ObservabilityPipelineDatadogLogsDestination(
id="datadog-logs-destination",
inputs=[
"my-processor-group",
],
type=ObservabilityPipelineDatadogLogsDestinationType.DATADOG_LOGS,
),
],
processor_groups=[
ObservabilityPipelineConfigProcessorGroup(
enabled=True,
id="my-processor-group",
include="service:my-service",
inputs=[
"websocket-source",
],
processors=[
ObservabilityPipelineFilterProcessor(
enabled=True,
id="filter-processor",
include="status:error",
type=ObservabilityPipelineFilterProcessorType.FILTER,
),
],
),
],
sources=[
ObservabilityPipelineWebsocketSource(
id="websocket-source",
type=ObservabilityPipelineWebsocketSourceType.WEBSOCKET,
decoding=ObservabilityPipelineDecoding.DECODE_JSON,
auth_strategy=ObservabilityPipelineWebsocketSourceAuthStrategy.BEARER,
token_key="WS_BEARER_TOKEN",
uri_key="WS_URI",
tls=ObservabilityPipelineWebsocketSourceTlsEnabled(
mode=ObservabilityPipelineWebsocketSourceTlsEnabledMode.ENABLED,
),
),
],
),
name="Pipeline with WebSocket Source",
),
type="pipelines",
),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = ObservabilityPipelinesApi(api_client)
response = api_instance.validate_pipeline(body=body)

print(response)
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
ObservabilityPipelineSumoLogicSource,
)
from datadog_api_client.v2.model.observability_pipeline_syslog_ng_source import ObservabilityPipelineSyslogNgSource
from datadog_api_client.v2.model.observability_pipeline_websocket_source import ObservabilityPipelineWebsocketSource
from datadog_api_client.v2.model.observability_pipeline_opentelemetry_source import (
ObservabilityPipelineOpentelemetrySource,
)
Expand Down Expand Up @@ -225,6 +226,7 @@ def __init__(
ObservabilityPipelineSplunkTcpSource,
ObservabilityPipelineSumoLogicSource,
ObservabilityPipelineSyslogNgSource,
ObservabilityPipelineWebsocketSource,
ObservabilityPipelineOpentelemetrySource,
]
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ def __init__(self, **kwargs):
This allows downstream components to forward the token to other Splunk HEC destinations.
:type store_hec_token: bool, optional

:param uri_key: Name of the environment variable or secret that holds the WebSocket server URI (`ws://` or `wss://`).
:type uri_key: str, optional

:param grpc_address_key: Environment variable name containing the gRPC server address for receiving OTLP data. Must be a valid environment variable name (alphanumeric characters and underscores only).
:type grpc_address_key: str, optional

Expand Down Expand Up @@ -160,6 +163,9 @@ def _composed_schemas(_):
from datadog_api_client.v2.model.observability_pipeline_syslog_ng_source import (
ObservabilityPipelineSyslogNgSource,
)
from datadog_api_client.v2.model.observability_pipeline_websocket_source import (
ObservabilityPipelineWebsocketSource,
)
from datadog_api_client.v2.model.observability_pipeline_opentelemetry_source import (
ObservabilityPipelineOpentelemetrySource,
)
Expand All @@ -182,6 +188,7 @@ def _composed_schemas(_):
ObservabilityPipelineSplunkTcpSource,
ObservabilityPipelineSumoLogicSource,
ObservabilityPipelineSyslogNgSource,
ObservabilityPipelineWebsocketSource,
ObservabilityPipelineOpentelemetrySource,
],
}
Loading
Loading