Skip to content

Commit 7a91dfd

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit fbdc69c of spec repo
1 parent 3ed6a6b commit 7a91dfd

5 files changed

Lines changed: 73 additions & 1 deletion

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33708,10 +33708,27 @@ components:
3370833708
example: 3600
3370933709
format: int64
3371033710
type: integer
33711+
fail_on_no_data:
33712+
default: true
33713+
description: Whether the rule should fail if a matching monitor group is in a NO DATA state.
33714+
example: false
33715+
type: boolean
33716+
fail_on_no_groups_found:
33717+
default: false
33718+
description: Whether the rule should fail if no monitor groups are found for the query.
33719+
example: false
33720+
type: boolean
3371133721
query:
3371233722
description: Monitors that match this query are evaluated.
3371333723
example: "service:my-service env:prod"
3371433724
type: string
33725+
warmup:
33726+
default: 0
33727+
description: Seconds to wait after a deployment starts before evaluating the monitor's status.
33728+
example: 0
33729+
format: int64
33730+
minimum: 0
33731+
type: integer
3371533732
required:
3371633733
- query
3371733734
type: object

src/datadog_api_client/api_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ def __init__(self, configuration: Configuration):
5454
self.default_headers = {}
5555
if self.configuration.compress:
5656
self.default_headers["Accept-Encoding"] = "gzip"
57+
if self.configuration.is_iac:
58+
self.default_headers["X-Datadog-Managed-By"] = "iac"
5759
# Set default User-Agent.
5860
self.user_agent = user_agent()
5961

src/datadog_api_client/configuration.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ class Configuration:
150150
:type delegated_auth_provider: str
151151
:param delegated_auth_org_uuid: The organization UUID for delegated authentication.
152152
:type delegated_auth_org_uuid: str
153+
:param is_iac: Set to True to indicate that requests made through this client originate from
154+
infrastructure-as-code or other automation tooling. When set, the client sends the
155+
``X-Datadog-Managed-By: iac`` header on every request.
156+
:type is_iac: bool
153157
"""
154158

155159
def __init__(
@@ -180,6 +184,7 @@ def __init__(
180184
retry_policy=None,
181185
delegated_auth_provider=None,
182186
delegated_auth_org_uuid=None,
187+
is_iac=False,
183188
):
184189
"""Constructor."""
185190
self._base_path = "https://api.datadoghq.com" if host is None else host
@@ -231,6 +236,10 @@ def __init__(
231236
# Will translate to a Accept-Encoding header
232237
self.compress = compress
233238

239+
# Set to True to indicate that requests are made from infrastructure-as-code tooling.
240+
# Will translate to a X-Datadog-Managed-By header.
241+
self.is_iac = is_iac
242+
234243
self.return_http_data_only = return_http_data_only
235244
self.preload_content = preload_content
236245
self.request_timeout = request_timeout

src/datadog_api_client/v2/model/deployment_rule_options_monitor.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414

1515

1616
class DeploymentRuleOptionsMonitor(ModelNormal):
17+
validations = {
18+
"warmup": {
19+
"inclusive_minimum": 0,
20+
},
21+
}
22+
1723
@cached_property
1824
def additional_properties_type(_):
1925
return None
@@ -22,26 +28,55 @@ def additional_properties_type(_):
2228
def openapi_types(_):
2329
return {
2430
"duration": (int,),
31+
"fail_on_no_data": (bool,),
32+
"fail_on_no_groups_found": (bool,),
2533
"query": (str,),
34+
"warmup": (int,),
2635
}
2736

2837
attribute_map = {
2938
"duration": "duration",
39+
"fail_on_no_data": "fail_on_no_data",
40+
"fail_on_no_groups_found": "fail_on_no_groups_found",
3041
"query": "query",
42+
"warmup": "warmup",
3143
}
3244

33-
def __init__(self_, query: str, duration: Union[int, UnsetType] = unset, **kwargs):
45+
def __init__(
46+
self_,
47+
query: str,
48+
duration: Union[int, UnsetType] = unset,
49+
fail_on_no_data: Union[bool, UnsetType] = unset,
50+
fail_on_no_groups_found: Union[bool, UnsetType] = unset,
51+
warmup: Union[int, UnsetType] = unset,
52+
**kwargs,
53+
):
3454
"""
3555
Monitor options for deployment rules.
3656
3757
:param duration: Seconds the monitor needs to stay in OK status for the rule to pass.
3858
:type duration: int, optional
3959
60+
:param fail_on_no_data: Whether the rule should fail if a matching monitor group is in a NO DATA state.
61+
:type fail_on_no_data: bool, optional
62+
63+
:param fail_on_no_groups_found: Whether the rule should fail if no monitor groups are found for the query.
64+
:type fail_on_no_groups_found: bool, optional
65+
4066
:param query: Monitors that match this query are evaluated.
4167
:type query: str
68+
69+
:param warmup: Seconds to wait after a deployment starts before evaluating the monitor's status.
70+
:type warmup: int, optional
4271
"""
4372
if duration is not unset:
4473
kwargs["duration"] = duration
74+
if fail_on_no_data is not unset:
75+
kwargs["fail_on_no_data"] = fail_on_no_data
76+
if fail_on_no_groups_found is not unset:
77+
kwargs["fail_on_no_groups_found"] = fail_on_no_groups_found
78+
if warmup is not unset:
79+
kwargs["warmup"] = warmup
4580
super().__init__(kwargs)
4681

4782
self_.query = query

src/datadog_api_client/v2/model/deployment_rules_options.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,17 @@ def __init__(self, **kwargs):
2424
:param excluded_resources: Resources to exclude from faulty deployment detection.
2525
:type excluded_resources: [str], optional
2626
27+
:param fail_on_no_data: Whether the rule should fail if a matching monitor group is in a NO DATA state.
28+
:type fail_on_no_data: bool, optional
29+
30+
:param fail_on_no_groups_found: Whether the rule should fail if no monitor groups are found for the query.
31+
:type fail_on_no_groups_found: bool, optional
32+
2733
:param query: Monitors that match this query are evaluated.
2834
:type query: str
35+
36+
:param warmup: Seconds to wait after a deployment starts before evaluating the monitor's status.
37+
:type warmup: int, optional
2938
"""
3039
super().__init__(kwargs)
3140

0 commit comments

Comments
 (0)