Skip to content
Merged
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
2 changes: 2 additions & 0 deletions src/datadog_api_client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def __init__(self, configuration: Configuration):
self.default_headers = {}
if self.configuration.compress:
self.default_headers["Accept-Encoding"] = "gzip"
if self.configuration.is_iac:
self.default_headers["X-Datadog-Managed-By"] = "iac"
# Set default User-Agent.
self.user_agent = user_agent()

Expand Down
9 changes: 9 additions & 0 deletions src/datadog_api_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ class Configuration:
:type delegated_auth_provider: str
:param delegated_auth_org_uuid: The organization UUID for delegated authentication.
:type delegated_auth_org_uuid: str
:param is_iac: Set to True to indicate that requests made through this client originate from
infrastructure-as-code or other automation tooling. When set, the client sends the
``X-Datadog-Managed-By: iac`` header on every request.
:type is_iac: bool
"""

def __init__(
Expand Down Expand Up @@ -180,6 +184,7 @@ def __init__(
retry_policy=None,
delegated_auth_provider=None,
delegated_auth_org_uuid=None,
is_iac=False,
):
"""Constructor."""
self._base_path = "https://api.datadoghq.com" if host is None else host
Expand Down Expand Up @@ -231,6 +236,10 @@ def __init__(
# Will translate to a Accept-Encoding header
self.compress = compress

# Set to True to indicate that requests are made from infrastructure-as-code tooling.
# Will translate to a X-Datadog-Managed-By header.
self.is_iac = is_iac

self.return_http_data_only = return_http_data_only
self.preload_content = preload_content
self.request_timeout = request_timeout
Expand Down
63 changes: 0 additions & 63 deletions tests/generated-test/test-runner-data/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2142,20 +2142,6 @@
"scenario": "Get monthly usage attribution returns \"OK\" response",
"version": "v1"
},
{
"feature": "Usage Metering",
"feature_file": "../../v1/features/usage_metering.feature",
"file": "v1/usage-metering/get-specified-daily-custom-reports-returns-ok-response.json",
"scenario": "Get specified daily custom reports returns \"OK\" response",
"version": "v1"
},
{
"feature": "Usage Metering",
"feature_file": "../../v1/features/usage_metering.feature",
"file": "v1/usage-metering/get-specified-monthly-custom-reports-returns-ok-response.json",
"scenario": "Get specified monthly custom reports returns \"OK\" response",
"version": "v1"
},
{
"feature": "Users",
"feature_file": "../../v1/features/users.feature",
Expand Down Expand Up @@ -11522,13 +11508,6 @@
"scenario": "Get billing dimension mapping for usage endpoints returns \"Bad Request\" response",
"version": "v2"
},
{
"feature": "Usage Metering",
"feature_file": "../../v2/features/usage_metering.feature",
"file": "v2/usage-metering/get-cost-across-multi-org-account-returns-ok-response.json",
"scenario": "Get cost across multi-org account returns \"OK\" response",
"version": "v2"
},
{
"feature": "Usage Metering",
"feature_file": "../../v2/features/usage_metering.feature",
Expand All @@ -11550,48 +11529,6 @@
"scenario": "Get hourly usage by product family returns \"OK\" response",
"version": "v2"
},
{
"feature": "Usage Metering",
"feature_file": "../../v2/features/usage_metering.feature",
"file": "v2/usage-metering/get-hourly-usage-for-application-security-returns-bad-request-response.json",
"scenario": "Get hourly usage for Application Security returns \"Bad Request\" response",
"version": "v2"
},
{
"feature": "Usage Metering",
"feature_file": "../../v2/features/usage_metering.feature",
"file": "v2/usage-metering/get-hourly-usage-for-lambda-traced-invocations-returns-bad-request-response.json",
"scenario": "Get hourly usage for Lambda traced invocations returns \"Bad Request\" response",
"version": "v2"
},
{
"feature": "Usage Metering",
"feature_file": "../../v2/features/usage_metering.feature",
"file": "v2/usage-metering/get-hourly-usage-for-lambda-traced-invocations-returns-ok-response.json",
"scenario": "Get hourly usage for Lambda traced invocations returns \"OK\" response",
"version": "v2"
},
{
"feature": "Usage Metering",
"feature_file": "../../v2/features/usage_metering.feature",
"file": "v2/usage-metering/get-hourly-usage-for-observability-pipelines-returns-bad-request-response.json",
"scenario": "Get hourly usage for Observability Pipelines returns \"Bad Request\" response",
"version": "v2"
},
{
"feature": "Usage Metering",
"feature_file": "../../v2/features/usage_metering.feature",
"file": "v2/usage-metering/get-hourly-usage-for-application-security-returns-ok-response.json",
"scenario": "Get hourly usage for application security returns \"OK\" response",
"version": "v2"
},
{
"feature": "Usage Metering",
"feature_file": "../../v2/features/usage_metering.feature",
"file": "v2/usage-metering/get-hourly-usage-for-observability-pipelines-returns-ok-response.json",
"scenario": "Get hourly usage for observability pipelines returns \"OK\" response",
"version": "v2"
},
{
"feature": "Usage Metering",
"feature_file": "../../v2/features/usage_metering.feature",
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading