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
17 changes: 17 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33708,10 +33708,27 @@ components:
example: 3600
format: int64
type: integer
fail_on_no_data:
default: true
description: Whether the rule should fail if a matching monitor group is in a NO DATA state.
example: false
type: boolean
fail_on_no_groups_found:
default: false
description: Whether the rule should fail if no monitor groups are found for the query.
example: false
type: boolean
query:
description: Monitors that match this query are evaluated.
example: "service:my-service env:prod"
type: string
warmup:
default: 0
description: Seconds to wait after a deployment starts before evaluating the monitor's status.
example: 0
format: int64
minimum: 0
type: integer
required:
- query
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@


class DeploymentRuleOptionsMonitor(ModelNormal):
validations = {
"warmup": {
"inclusive_minimum": 0,
},
}

@cached_property
def additional_properties_type(_):
return None
Expand All @@ -22,26 +28,55 @@ def additional_properties_type(_):
def openapi_types(_):
return {
"duration": (int,),
"fail_on_no_data": (bool,),
"fail_on_no_groups_found": (bool,),
"query": (str,),
"warmup": (int,),
}

attribute_map = {
"duration": "duration",
"fail_on_no_data": "fail_on_no_data",
"fail_on_no_groups_found": "fail_on_no_groups_found",
"query": "query",
"warmup": "warmup",
}

def __init__(self_, query: str, duration: Union[int, UnsetType] = unset, **kwargs):
def __init__(
self_,
query: str,
duration: Union[int, UnsetType] = unset,
fail_on_no_data: Union[bool, UnsetType] = unset,
fail_on_no_groups_found: Union[bool, UnsetType] = unset,
warmup: Union[int, UnsetType] = unset,
**kwargs,
):
"""
Monitor options for deployment rules.

:param duration: Seconds the monitor needs to stay in OK status for the rule to pass.
:type duration: int, optional

:param fail_on_no_data: Whether the rule should fail if a matching monitor group is in a NO DATA state.
:type fail_on_no_data: bool, optional

:param fail_on_no_groups_found: Whether the rule should fail if no monitor groups are found for the query.
:type fail_on_no_groups_found: bool, optional

:param query: Monitors that match this query are evaluated.
:type query: str

:param warmup: Seconds to wait after a deployment starts before evaluating the monitor's status.
:type warmup: int, optional
"""
if duration is not unset:
kwargs["duration"] = duration
if fail_on_no_data is not unset:
kwargs["fail_on_no_data"] = fail_on_no_data
if fail_on_no_groups_found is not unset:
kwargs["fail_on_no_groups_found"] = fail_on_no_groups_found
if warmup is not unset:
kwargs["warmup"] = warmup
super().__init__(kwargs)

self_.query = query
9 changes: 9 additions & 0 deletions src/datadog_api_client/v2/model/deployment_rules_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,17 @@ def __init__(self, **kwargs):
:param excluded_resources: Resources to exclude from faulty deployment detection.
:type excluded_resources: [str], optional

:param fail_on_no_data: Whether the rule should fail if a matching monitor group is in a NO DATA state.
:type fail_on_no_data: bool, optional

:param fail_on_no_groups_found: Whether the rule should fail if no monitor groups are found for the query.
:type fail_on_no_groups_found: bool, optional

:param query: Monitors that match this query are evaluated.
:type query: str

:param warmup: Seconds to wait after a deployment starts before evaluating the monitor's status.
:type warmup: int, optional
"""
super().__init__(kwargs)

Expand Down
Loading