Skip to content

Commit 5a8db46

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Adding Observability Pipelines Secret Management feature support (#3210)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 10622dc commit 5a8db46

File tree

50 files changed

+1131
-23
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1131
-23
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 281 additions & 5 deletions
Large diffs are not rendered by default.

docs/datadog_api_client.v2.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17847,6 +17847,13 @@ datadog\_api\_client.v2.model.observability\_pipeline\_elasticsearch\_destinatio
1784717847
:members:
1784817848
:show-inheritance:
1784917849

17850+
datadog\_api\_client.v2.model.observability\_pipeline\_elasticsearch\_destination\_auth module
17851+
----------------------------------------------------------------------------------------------
17852+
17853+
.. automodule:: datadog_api_client.v2.model.observability_pipeline_elasticsearch_destination_auth
17854+
:members:
17855+
:show-inheritance:
17856+
1785017857
datadog\_api\_client.v2.model.observability\_pipeline\_elasticsearch\_destination\_data\_stream module
1785117858
------------------------------------------------------------------------------------------------------
1785217859

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
"""
2+
Validate an observability pipeline with destination secret key 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_agent_source import (
13+
ObservabilityPipelineDatadogAgentSource,
14+
)
15+
from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source_type import (
16+
ObservabilityPipelineDatadogAgentSourceType,
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_spec import ObservabilityPipelineSpec
23+
from datadog_api_client.v2.model.observability_pipeline_spec_data import ObservabilityPipelineSpecData
24+
from datadog_api_client.v2.model.observability_pipeline_sumo_logic_destination import (
25+
ObservabilityPipelineSumoLogicDestination,
26+
)
27+
from datadog_api_client.v2.model.observability_pipeline_sumo_logic_destination_type import (
28+
ObservabilityPipelineSumoLogicDestinationType,
29+
)
30+
31+
body = ObservabilityPipelineSpec(
32+
data=ObservabilityPipelineSpecData(
33+
attributes=ObservabilityPipelineDataAttributes(
34+
config=ObservabilityPipelineConfig(
35+
destinations=[
36+
ObservabilityPipelineSumoLogicDestination(
37+
id="sumo-logic-destination",
38+
inputs=[
39+
"my-processor-group",
40+
],
41+
type=ObservabilityPipelineSumoLogicDestinationType.SUMO_LOGIC,
42+
endpoint_url_key="SUMO_LOGIC_ENDPOINT_URL",
43+
),
44+
],
45+
processor_groups=[
46+
ObservabilityPipelineConfigProcessorGroup(
47+
enabled=True,
48+
id="my-processor-group",
49+
include="service:my-service",
50+
inputs=[
51+
"datadog-agent-source",
52+
],
53+
processors=[
54+
ObservabilityPipelineFilterProcessor(
55+
enabled=True,
56+
id="filter-processor",
57+
include="status:error",
58+
type=ObservabilityPipelineFilterProcessorType.FILTER,
59+
),
60+
],
61+
),
62+
],
63+
sources=[
64+
ObservabilityPipelineDatadogAgentSource(
65+
id="datadog-agent-source",
66+
type=ObservabilityPipelineDatadogAgentSourceType.DATADOG_AGENT,
67+
),
68+
],
69+
),
70+
name="Pipeline with Secret Key",
71+
),
72+
type="pipelines",
73+
),
74+
)
75+
76+
configuration = Configuration()
77+
with ApiClient(configuration) as api_client:
78+
api_instance = ObservabilityPipelinesApi(api_client)
79+
response = api_instance.validate_pipeline(body=body)
80+
81+
print(response)
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
"""
2+
Validate an observability pipeline with source secret key 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_decoding import ObservabilityPipelineDecoding
19+
from datadog_api_client.v2.model.observability_pipeline_filter_processor import ObservabilityPipelineFilterProcessor
20+
from datadog_api_client.v2.model.observability_pipeline_filter_processor_type import (
21+
ObservabilityPipelineFilterProcessorType,
22+
)
23+
from datadog_api_client.v2.model.observability_pipeline_http_client_source import ObservabilityPipelineHttpClientSource
24+
from datadog_api_client.v2.model.observability_pipeline_http_client_source_auth_strategy import (
25+
ObservabilityPipelineHttpClientSourceAuthStrategy,
26+
)
27+
from datadog_api_client.v2.model.observability_pipeline_http_client_source_type import (
28+
ObservabilityPipelineHttpClientSourceType,
29+
)
30+
from datadog_api_client.v2.model.observability_pipeline_spec import ObservabilityPipelineSpec
31+
from datadog_api_client.v2.model.observability_pipeline_spec_data import ObservabilityPipelineSpecData
32+
33+
body = ObservabilityPipelineSpec(
34+
data=ObservabilityPipelineSpecData(
35+
attributes=ObservabilityPipelineDataAttributes(
36+
config=ObservabilityPipelineConfig(
37+
destinations=[
38+
ObservabilityPipelineDatadogLogsDestination(
39+
id="datadog-logs-destination",
40+
inputs=[
41+
"my-processor-group",
42+
],
43+
type=ObservabilityPipelineDatadogLogsDestinationType.DATADOG_LOGS,
44+
),
45+
],
46+
processor_groups=[
47+
ObservabilityPipelineConfigProcessorGroup(
48+
enabled=True,
49+
id="my-processor-group",
50+
include="service:my-service",
51+
inputs=[
52+
"http-client-source",
53+
],
54+
processors=[
55+
ObservabilityPipelineFilterProcessor(
56+
enabled=True,
57+
id="filter-processor",
58+
include="status:error",
59+
type=ObservabilityPipelineFilterProcessorType.FILTER,
60+
),
61+
],
62+
),
63+
],
64+
sources=[
65+
ObservabilityPipelineHttpClientSource(
66+
id="http-client-source",
67+
type=ObservabilityPipelineHttpClientSourceType.HTTP_CLIENT,
68+
decoding=ObservabilityPipelineDecoding.DECODE_BYTES,
69+
scrape_interval_secs=15,
70+
scrape_timeout_secs=5,
71+
auth_strategy=ObservabilityPipelineHttpClientSourceAuthStrategy.BEARER,
72+
token_key="HTTP_CLIENT_TOKEN",
73+
),
74+
],
75+
),
76+
name="Pipeline with Source Secret",
77+
),
78+
type="pipelines",
79+
),
80+
)
81+
82+
configuration = Configuration()
83+
with ApiClient(configuration) as api_client:
84+
api_instance = ObservabilityPipelinesApi(api_client)
85+
response = api_instance.validate_pipeline(body=body)
86+
87+
print(response)

src/datadog_api_client/v2/model/azure_storage_destination.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def openapi_types(_):
3636
return {
3737
"blob_prefix": (str,),
3838
"buffer": (ObservabilityPipelineBufferOptions,),
39+
"connection_string_key": (str,),
3940
"container_name": (str,),
4041
"id": (str,),
4142
"inputs": ([str],),
@@ -45,6 +46,7 @@ def openapi_types(_):
4546
attribute_map = {
4647
"blob_prefix": "blob_prefix",
4748
"buffer": "buffer",
49+
"connection_string_key": "connection_string_key",
4850
"container_name": "container_name",
4951
"id": "id",
5052
"inputs": "inputs",
@@ -65,6 +67,7 @@ def __init__(
6567
ObservabilityPipelineMemoryBufferSizeOptions,
6668
UnsetType,
6769
] = unset,
70+
connection_string_key: Union[str, UnsetType] = unset,
6871
**kwargs,
6972
):
7073
"""
@@ -78,6 +81,9 @@ def __init__(
7881
:param buffer: Configuration for buffer settings on destination components.
7982
:type buffer: ObservabilityPipelineBufferOptions, optional
8083
84+
:param connection_string_key: Name of the environment variable or secret that holds the Azure Storage connection string.
85+
:type connection_string_key: str, optional
86+
8187
:param container_name: The name of the Azure Blob Storage container to store logs in.
8288
:type container_name: str
8389
@@ -94,6 +100,8 @@ def __init__(
94100
kwargs["blob_prefix"] = blob_prefix
95101
if buffer is not unset:
96102
kwargs["buffer"] = buffer
103+
if connection_string_key is not unset:
104+
kwargs["connection_string_key"] = connection_string_key
97105
super().__init__(kwargs)
98106

99107
self_.container_name = container_name

src/datadog_api_client/v2/model/microsoft_sentinel_destination.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def openapi_types(_):
3636
return {
3737
"buffer": (ObservabilityPipelineBufferOptions,),
3838
"client_id": (str,),
39+
"client_secret_key": (str,),
40+
"dce_uri_key": (str,),
3941
"dcr_immutable_id": (str,),
4042
"id": (str,),
4143
"inputs": ([str],),
@@ -47,6 +49,8 @@ def openapi_types(_):
4749
attribute_map = {
4850
"buffer": "buffer",
4951
"client_id": "client_id",
52+
"client_secret_key": "client_secret_key",
53+
"dce_uri_key": "dce_uri_key",
5054
"dcr_immutable_id": "dcr_immutable_id",
5155
"id": "id",
5256
"inputs": "inputs",
@@ -71,6 +75,8 @@ def __init__(
7175
ObservabilityPipelineMemoryBufferSizeOptions,
7276
UnsetType,
7377
] = unset,
78+
client_secret_key: Union[str, UnsetType] = unset,
79+
dce_uri_key: Union[str, UnsetType] = unset,
7480
**kwargs,
7581
):
7682
"""
@@ -84,6 +90,12 @@ def __init__(
8490
:param client_id: Azure AD client ID used for authentication.
8591
:type client_id: str
8692
93+
:param client_secret_key: Name of the environment variable or secret that holds the Azure AD client secret.
94+
:type client_secret_key: str, optional
95+
96+
:param dce_uri_key: Name of the environment variable or secret that holds the Data Collection Endpoint (DCE) URI.
97+
:type dce_uri_key: str, optional
98+
8799
:param dcr_immutable_id: The immutable ID of the Data Collection Rule (DCR).
88100
:type dcr_immutable_id: str
89101
@@ -104,6 +116,10 @@ def __init__(
104116
"""
105117
if buffer is not unset:
106118
kwargs["buffer"] = buffer
119+
if client_secret_key is not unset:
120+
kwargs["client_secret_key"] = client_secret_key
121+
if dce_uri_key is not unset:
122+
kwargs["dce_uri_key"] = dce_uri_key
107123
super().__init__(kwargs)
108124

109125
self_.client_id = client_id

src/datadog_api_client/v2/model/observability_pipeline_amazon_data_firehose_source.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ def openapi_types(_):
3131
)
3232

3333
return {
34+
"address_key": (str,),
3435
"auth": (ObservabilityPipelineAwsAuth,),
3536
"id": (str,),
3637
"tls": (ObservabilityPipelineTls,),
3738
"type": (ObservabilityPipelineAmazonDataFirehoseSourceType,),
3839
}
3940

4041
attribute_map = {
42+
"address_key": "address_key",
4143
"auth": "auth",
4244
"id": "id",
4345
"tls": "tls",
@@ -48,6 +50,7 @@ def __init__(
4850
self_,
4951
id: str,
5052
type: ObservabilityPipelineAmazonDataFirehoseSourceType,
53+
address_key: Union[str, UnsetType] = unset,
5154
auth: Union[ObservabilityPipelineAwsAuth, UnsetType] = unset,
5255
tls: Union[ObservabilityPipelineTls, UnsetType] = unset,
5356
**kwargs,
@@ -57,6 +60,9 @@ def __init__(
5760
5861
**Supported pipeline types:** logs
5962
63+
:param address_key: Name of the environment variable or secret that holds the Firehose delivery stream address.
64+
:type address_key: str, optional
65+
6066
:param auth: AWS authentication credentials used for accessing AWS services such as S3.
6167
If omitted, the system’s default credentials are used (for example, the IAM role and environment variables).
6268
:type auth: ObservabilityPipelineAwsAuth, optional
@@ -70,6 +76,8 @@ def __init__(
7076
:param type: The source type. The value should always be ``amazon_data_firehose``.
7177
:type type: ObservabilityPipelineAmazonDataFirehoseSourceType
7278
"""
79+
if address_key is not unset:
80+
kwargs["address_key"] = address_key
7381
if auth is not unset:
7482
kwargs["auth"] = auth
7583
if tls is not unset:

src/datadog_api_client/v2/model/observability_pipeline_amazon_s3_source.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def openapi_types(_):
3636
"region": (str,),
3737
"tls": (ObservabilityPipelineTls,),
3838
"type": (ObservabilityPipelineAmazonS3SourceType,),
39+
"url_key": (str,),
3940
}
4041

4142
attribute_map = {
@@ -44,6 +45,7 @@ def openapi_types(_):
4445
"region": "region",
4546
"tls": "tls",
4647
"type": "type",
48+
"url_key": "url_key",
4749
}
4850

4951
def __init__(
@@ -53,6 +55,7 @@ def __init__(
5355
type: ObservabilityPipelineAmazonS3SourceType,
5456
auth: Union[ObservabilityPipelineAwsAuth, UnsetType] = unset,
5557
tls: Union[ObservabilityPipelineTls, UnsetType] = unset,
58+
url_key: Union[str, UnsetType] = unset,
5659
**kwargs,
5760
):
5861
"""
@@ -76,11 +79,16 @@ def __init__(
7679
7780
:param type: The source type. Always ``amazon_s3``.
7881
:type type: ObservabilityPipelineAmazonS3SourceType
82+
83+
:param url_key: Name of the environment variable or secret that holds the S3 bucket URL.
84+
:type url_key: str, optional
7985
"""
8086
if auth is not unset:
8187
kwargs["auth"] = auth
8288
if tls is not unset:
8389
kwargs["tls"] = tls
90+
if url_key is not unset:
91+
kwargs["url_key"] = url_key
8492
super().__init__(kwargs)
8593

8694
self_.id = id

0 commit comments

Comments
 (0)