Skip to content

Commit 204618f

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Monitors Augmented Query Add Group By Source (#3551)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 8eb1a04 commit 204618f

4 files changed

Lines changed: 25 additions & 1 deletion

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8303,6 +8303,10 @@ components:
83038303
description: The name assigned to this aggregation, when multiple aggregations are defined for a query.
83048304
example: "compute_result"
83058305
type: string
8306+
source:
8307+
description: Source reference for composite query payloads.
8308+
example: "filter_query"
8309+
type: string
83068310
required:
83078311
- aggregation
83088312
type: object
@@ -8330,6 +8334,10 @@ components:
83308334
type: integer
83318335
sort:
83328336
$ref: "#/components/schemas/MonitorFormulaAndFunctionEventQueryGroupBySort"
8337+
source:
8338+
description: Source reference for composite query payloads.
8339+
example: "filter_query"
8340+
type: string
83338341
required:
83348342
- facet
83358343
type: object

src/datadog_api_client/v1/model/monitor_formula_and_function_event_query_definition_compute.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ def openapi_types(_):
3131
"interval": (int,),
3232
"metric": (str,),
3333
"name": (str,),
34+
"source": (str,),
3435
}
3536

3637
attribute_map = {
3738
"aggregation": "aggregation",
3839
"interval": "interval",
3940
"metric": "metric",
4041
"name": "name",
42+
"source": "source",
4143
}
4244

4345
def __init__(
@@ -46,6 +48,7 @@ def __init__(
4648
interval: Union[int, UnsetType] = unset,
4749
metric: Union[str, UnsetType] = unset,
4850
name: Union[str, UnsetType] = unset,
51+
source: Union[str, UnsetType] = unset,
4952
**kwargs,
5053
):
5154
"""
@@ -62,13 +65,18 @@ def __init__(
6265
6366
:param name: The name assigned to this aggregation, when multiple aggregations are defined for a query.
6467
:type name: str, optional
68+
69+
:param source: Source reference for composite query payloads.
70+
:type source: str, optional
6571
"""
6672
if interval is not unset:
6773
kwargs["interval"] = interval
6874
if metric is not unset:
6975
kwargs["metric"] = metric
7076
if name is not unset:
7177
kwargs["name"] = name
78+
if source is not unset:
79+
kwargs["source"] = source
7280
super().__init__(kwargs)
7381

7482
self_.aggregation = aggregation

src/datadog_api_client/v1/model/monitor_formula_and_function_event_query_group_by.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,22 @@ def openapi_types(_):
3030
"facet": (str,),
3131
"limit": (int,),
3232
"sort": (MonitorFormulaAndFunctionEventQueryGroupBySort,),
33+
"source": (str,),
3334
}
3435

3536
attribute_map = {
3637
"facet": "facet",
3738
"limit": "limit",
3839
"sort": "sort",
40+
"source": "source",
3941
}
4042

4143
def __init__(
4244
self_,
4345
facet: str,
4446
limit: Union[int, UnsetType] = unset,
4547
sort: Union[MonitorFormulaAndFunctionEventQueryGroupBySort, UnsetType] = unset,
48+
source: Union[str, UnsetType] = unset,
4649
**kwargs,
4750
):
4851
"""
@@ -56,11 +59,16 @@ def __init__(
5659
5760
:param sort: Options for sorting group by results.
5861
:type sort: MonitorFormulaAndFunctionEventQueryGroupBySort, optional
62+
63+
:param source: Source reference for composite query payloads.
64+
:type source: str, optional
5965
"""
6066
if limit is not unset:
6167
kwargs["limit"] = limit
6268
if sort is not unset:
6369
kwargs["sort"] = sort
70+
if source is not unset:
71+
kwargs["source"] = source
6472
super().__init__(kwargs)
6573

6674
self_.facet = facet

tests/v1/features/monitors.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Feature: Monitors
219219
Scenario: Edit a monitor returns "Bad Request" response
220220
Given new "UpdateMonitor" request
221221
And request contains "monitor_id" parameter from "REPLACE.ME"
222-
And body with value {"assets": [{"category": "runbook", "name": "Monitor Runbook", "resource_key": "12345", "resource_type": "notebook", "url": "/notebooks/12345"}], "draft_status": "published", "options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration", "name": "compute_result"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"}
222+
And body with value {"assets": [{"category": "runbook", "name": "Monitor Runbook", "resource_key": "12345", "resource_type": "notebook", "url": "/notebooks/12345"}], "draft_status": "published", "options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration", "name": "compute_result", "source": "filter_query"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}, "source": "filter_query"}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"}
223223
When the request is sent
224224
Then the response status is 400 Bad Request
225225

0 commit comments

Comments
 (0)