Skip to content

Commit d1fcfcf

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Google PubSub destination to the Observability Pipelines API (#2844)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent d3f059d commit d1fcfcf

8 files changed

+295
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30324,6 +30324,7 @@ components:
3032430324
- $ref: '#/components/schemas/ObservabilityPipelineSocketDestination'
3032530325
- $ref: '#/components/schemas/ObservabilityPipelineAmazonSecurityLakeDestination'
3032630326
- $ref: '#/components/schemas/ObservabilityPipelineCrowdStrikeNextGenSiemDestination'
30327+
- $ref: '#/components/schemas/ObservabilityPipelineGooglePubSubDestination'
3032730328
ObservabilityPipelineConfigProcessorItem:
3032830329
description: A processor for the pipeline.
3032930330
oneOf:
@@ -31385,6 +31386,65 @@ components:
3138531386
type: string
3138631387
x-enum-varnames:
3138731388
- GOOGLE_CLOUD_STORAGE
31389+
ObservabilityPipelineGooglePubSubDestination:
31390+
description: The `google_pubsub` destination publishes logs to a Google Cloud
31391+
Pub/Sub topic.
31392+
properties:
31393+
auth:
31394+
$ref: '#/components/schemas/ObservabilityPipelineGcpAuth'
31395+
encoding:
31396+
$ref: '#/components/schemas/ObservabilityPipelineGooglePubSubDestinationEncoding'
31397+
id:
31398+
description: The unique identifier for this component.
31399+
example: google-pubsub-destination
31400+
type: string
31401+
inputs:
31402+
description: A list of component IDs whose output is used as the `input`
31403+
for this component.
31404+
example:
31405+
- filter-processor
31406+
items:
31407+
type: string
31408+
type: array
31409+
project:
31410+
description: The GCP project ID that owns the Pub/Sub topic.
31411+
example: my-gcp-project
31412+
type: string
31413+
tls:
31414+
$ref: '#/components/schemas/ObservabilityPipelineTls'
31415+
topic:
31416+
description: The Pub/Sub topic name to publish logs to.
31417+
example: logs-subscription
31418+
type: string
31419+
type:
31420+
$ref: '#/components/schemas/ObservabilityPipelineGooglePubSubDestinationType'
31421+
required:
31422+
- id
31423+
- type
31424+
- inputs
31425+
- encoding
31426+
- project
31427+
- topic
31428+
type: object
31429+
ObservabilityPipelineGooglePubSubDestinationEncoding:
31430+
description: Encoding format for log events.
31431+
enum:
31432+
- json
31433+
- raw_message
31434+
example: json
31435+
type: string
31436+
x-enum-varnames:
31437+
- JSON
31438+
- RAW_MESSAGE
31439+
ObservabilityPipelineGooglePubSubDestinationType:
31440+
default: google_pubsub
31441+
description: The destination type. The value should always be `google_pubsub`.
31442+
enum:
31443+
- google_pubsub
31444+
example: google_pubsub
31445+
type: string
31446+
x-enum-varnames:
31447+
- GOOGLE_PUBSUB
3138831448
ObservabilityPipelineGooglePubSubSource:
3138931449
description: The `google_pubsub` source ingests logs from a Google Cloud Pub/Sub
3139031450
subscription.

docs/datadog_api_client.v2.model.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13577,6 +13577,27 @@ datadog\_api\_client.v2.model.observability\_pipeline\_google\_cloud\_storage\_d
1357713577
:members:
1357813578
:show-inheritance:
1357913579

13580+
datadog\_api\_client.v2.model.observability\_pipeline\_google\_pub\_sub\_destination module
13581+
-------------------------------------------------------------------------------------------
13582+
13583+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_google_pub_sub_destination
13584+
:members:
13585+
:show-inheritance:
13586+
13587+
datadog\_api\_client.v2.model.observability\_pipeline\_google\_pub\_sub\_destination\_encoding module
13588+
-----------------------------------------------------------------------------------------------------
13589+
13590+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_google_pub_sub_destination_encoding
13591+
:members:
13592+
:show-inheritance:
13593+
13594+
datadog\_api\_client.v2.model.observability\_pipeline\_google\_pub\_sub\_destination\_type module
13595+
-------------------------------------------------------------------------------------------------
13596+
13597+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_google_pub_sub_destination_type
13598+
:members:
13599+
:show-inheritance:
13600+
1358013601
datadog\_api\_client.v2.model.observability\_pipeline\_google\_pub\_sub\_source module
1358113602
--------------------------------------------------------------------------------------
1358213603

src/datadog_api_client/v2/model/observability_pipeline_config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@
7373
from datadog_api_client.v2.model.observability_pipeline_crowd_strike_next_gen_siem_destination import (
7474
ObservabilityPipelineCrowdStrikeNextGenSiemDestination,
7575
)
76+
from datadog_api_client.v2.model.observability_pipeline_google_pub_sub_destination import (
77+
ObservabilityPipelineGooglePubSubDestination,
78+
)
7679
from datadog_api_client.v2.model.observability_pipeline_filter_processor import ObservabilityPipelineFilterProcessor
7780
from datadog_api_client.v2.model.observability_pipeline_parse_json_processor import (
7881
ObservabilityPipelineParseJSONProcessor,
@@ -199,6 +202,7 @@ def __init__(
199202
ObservabilityPipelineSocketDestination,
200203
ObservabilityPipelineAmazonSecurityLakeDestination,
201204
ObservabilityPipelineCrowdStrikeNextGenSiemDestination,
205+
ObservabilityPipelineGooglePubSubDestination,
202206
]
203207
],
204208
sources: List[

src/datadog_api_client/v2/model/observability_pipeline_config_destination_item.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ def __init__(self, **kwargs):
120120
121121
:param compression: Compression configuration for log events.
122122
:type compression: ObservabilityPipelineCrowdStrikeNextGenSiemDestinationCompression, optional
123+
124+
:param project: The GCP project ID that owns the Pub/Sub topic.
125+
:type project: str
126+
127+
:param topic: The Pub/Sub topic name to publish logs to.
128+
:type topic: str
123129
"""
124130
super().__init__(kwargs)
125131

@@ -182,6 +188,9 @@ def _composed_schemas(_):
182188
from datadog_api_client.v2.model.observability_pipeline_crowd_strike_next_gen_siem_destination import (
183189
ObservabilityPipelineCrowdStrikeNextGenSiemDestination,
184190
)
191+
from datadog_api_client.v2.model.observability_pipeline_google_pub_sub_destination import (
192+
ObservabilityPipelineGooglePubSubDestination,
193+
)
185194

186195
return {
187196
"oneOf": [
@@ -203,5 +212,6 @@ def _composed_schemas(_):
203212
ObservabilityPipelineSocketDestination,
204213
ObservabilityPipelineAmazonSecurityLakeDestination,
205214
ObservabilityPipelineCrowdStrikeNextGenSiemDestination,
215+
ObservabilityPipelineGooglePubSubDestination,
206216
],
207217
}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import List, Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.observability_pipeline_gcp_auth import ObservabilityPipelineGcpAuth
18+
from datadog_api_client.v2.model.observability_pipeline_google_pub_sub_destination_encoding import (
19+
ObservabilityPipelineGooglePubSubDestinationEncoding,
20+
)
21+
from datadog_api_client.v2.model.observability_pipeline_tls import ObservabilityPipelineTls
22+
from datadog_api_client.v2.model.observability_pipeline_google_pub_sub_destination_type import (
23+
ObservabilityPipelineGooglePubSubDestinationType,
24+
)
25+
26+
27+
class ObservabilityPipelineGooglePubSubDestination(ModelNormal):
28+
@cached_property
29+
def openapi_types(_):
30+
from datadog_api_client.v2.model.observability_pipeline_gcp_auth import ObservabilityPipelineGcpAuth
31+
from datadog_api_client.v2.model.observability_pipeline_google_pub_sub_destination_encoding import (
32+
ObservabilityPipelineGooglePubSubDestinationEncoding,
33+
)
34+
from datadog_api_client.v2.model.observability_pipeline_tls import ObservabilityPipelineTls
35+
from datadog_api_client.v2.model.observability_pipeline_google_pub_sub_destination_type import (
36+
ObservabilityPipelineGooglePubSubDestinationType,
37+
)
38+
39+
return {
40+
"auth": (ObservabilityPipelineGcpAuth,),
41+
"encoding": (ObservabilityPipelineGooglePubSubDestinationEncoding,),
42+
"id": (str,),
43+
"inputs": ([str],),
44+
"project": (str,),
45+
"tls": (ObservabilityPipelineTls,),
46+
"topic": (str,),
47+
"type": (ObservabilityPipelineGooglePubSubDestinationType,),
48+
}
49+
50+
attribute_map = {
51+
"auth": "auth",
52+
"encoding": "encoding",
53+
"id": "id",
54+
"inputs": "inputs",
55+
"project": "project",
56+
"tls": "tls",
57+
"topic": "topic",
58+
"type": "type",
59+
}
60+
61+
def __init__(
62+
self_,
63+
encoding: ObservabilityPipelineGooglePubSubDestinationEncoding,
64+
id: str,
65+
inputs: List[str],
66+
project: str,
67+
topic: str,
68+
type: ObservabilityPipelineGooglePubSubDestinationType,
69+
auth: Union[ObservabilityPipelineGcpAuth, UnsetType] = unset,
70+
tls: Union[ObservabilityPipelineTls, UnsetType] = unset,
71+
**kwargs,
72+
):
73+
"""
74+
The ``google_pubsub`` destination publishes logs to a Google Cloud Pub/Sub topic.
75+
76+
:param auth: GCP credentials used to authenticate with Google Cloud Storage.
77+
:type auth: ObservabilityPipelineGcpAuth, optional
78+
79+
:param encoding: Encoding format for log events.
80+
:type encoding: ObservabilityPipelineGooglePubSubDestinationEncoding
81+
82+
:param id: The unique identifier for this component.
83+
:type id: str
84+
85+
:param inputs: A list of component IDs whose output is used as the ``input`` for this component.
86+
:type inputs: [str]
87+
88+
:param project: The GCP project ID that owns the Pub/Sub topic.
89+
:type project: str
90+
91+
:param tls: Configuration for enabling TLS encryption between the pipeline component and external services.
92+
:type tls: ObservabilityPipelineTls, optional
93+
94+
:param topic: The Pub/Sub topic name to publish logs to.
95+
:type topic: str
96+
97+
:param type: The destination type. The value should always be ``google_pubsub``.
98+
:type type: ObservabilityPipelineGooglePubSubDestinationType
99+
"""
100+
if auth is not unset:
101+
kwargs["auth"] = auth
102+
if tls is not unset:
103+
kwargs["tls"] = tls
104+
super().__init__(kwargs)
105+
106+
self_.encoding = encoding
107+
self_.id = id
108+
self_.inputs = inputs
109+
self_.project = project
110+
self_.topic = topic
111+
self_.type = type
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class ObservabilityPipelineGooglePubSubDestinationEncoding(ModelSimple):
16+
"""
17+
Encoding format for log events.
18+
19+
:param value: Must be one of ["json", "raw_message"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"json",
25+
"raw_message",
26+
}
27+
JSON: ClassVar["ObservabilityPipelineGooglePubSubDestinationEncoding"]
28+
RAW_MESSAGE: ClassVar["ObservabilityPipelineGooglePubSubDestinationEncoding"]
29+
30+
@cached_property
31+
def openapi_types(_):
32+
return {
33+
"value": (str,),
34+
}
35+
36+
37+
ObservabilityPipelineGooglePubSubDestinationEncoding.JSON = ObservabilityPipelineGooglePubSubDestinationEncoding("json")
38+
ObservabilityPipelineGooglePubSubDestinationEncoding.RAW_MESSAGE = ObservabilityPipelineGooglePubSubDestinationEncoding(
39+
"raw_message"
40+
)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class ObservabilityPipelineGooglePubSubDestinationType(ModelSimple):
16+
"""
17+
The destination type. The value should always be `google_pubsub`.
18+
19+
:param value: If omitted defaults to "google_pubsub". Must be one of ["google_pubsub"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"google_pubsub",
25+
}
26+
GOOGLE_PUBSUB: ClassVar["ObservabilityPipelineGooglePubSubDestinationType"]
27+
28+
@cached_property
29+
def openapi_types(_):
30+
return {
31+
"value": (str,),
32+
}
33+
34+
35+
ObservabilityPipelineGooglePubSubDestinationType.GOOGLE_PUBSUB = ObservabilityPipelineGooglePubSubDestinationType(
36+
"google_pubsub"
37+
)

src/datadog_api_client/v2/models/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,6 +2617,15 @@
26172617
from datadog_api_client.v2.model.observability_pipeline_google_cloud_storage_destination_type import (
26182618
ObservabilityPipelineGoogleCloudStorageDestinationType,
26192619
)
2620+
from datadog_api_client.v2.model.observability_pipeline_google_pub_sub_destination import (
2621+
ObservabilityPipelineGooglePubSubDestination,
2622+
)
2623+
from datadog_api_client.v2.model.observability_pipeline_google_pub_sub_destination_encoding import (
2624+
ObservabilityPipelineGooglePubSubDestinationEncoding,
2625+
)
2626+
from datadog_api_client.v2.model.observability_pipeline_google_pub_sub_destination_type import (
2627+
ObservabilityPipelineGooglePubSubDestinationType,
2628+
)
26202629
from datadog_api_client.v2.model.observability_pipeline_google_pub_sub_source import (
26212630
ObservabilityPipelineGooglePubSubSource,
26222631
)
@@ -6299,6 +6308,9 @@
62996308
"ObservabilityPipelineGoogleCloudStorageDestinationAcl",
63006309
"ObservabilityPipelineGoogleCloudStorageDestinationStorageClass",
63016310
"ObservabilityPipelineGoogleCloudStorageDestinationType",
6311+
"ObservabilityPipelineGooglePubSubDestination",
6312+
"ObservabilityPipelineGooglePubSubDestinationEncoding",
6313+
"ObservabilityPipelineGooglePubSubDestinationType",
63026314
"ObservabilityPipelineGooglePubSubSource",
63036315
"ObservabilityPipelineGooglePubSubSourceType",
63046316
"ObservabilityPipelineHttpClientSource",

0 commit comments

Comments
 (0)