Skip to content

Commit 9431454

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 1358b465 of spec repo (#1189)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent e7cab6a commit 9431454

File tree

8 files changed

+46
-13
lines changed

8 files changed

+46
-13
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.4",
7-
"regenerated": "2022-09-30 11:29:17.434933",
8-
"spec_repo_commit": "e6eb3136"
7+
"regenerated": "2022-10-03 13:35:10.526110",
8+
"spec_repo_commit": "1358b465"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-09-30 11:29:17.447066",
13-
"spec_repo_commit": "e6eb3136"
12+
"regenerated": "2022-10-03 13:35:10.538496",
13+
"spec_repo_commit": "1358b465"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6278,6 +6278,24 @@ components:
62786278
description: A Boolean indicating whether tagged users is notified on changes
62796279
to this monitor.
62806280
type: boolean
6281+
notify_by:
6282+
description: 'Controls what granularity a monitor alerts on. Only available
6283+
for multi-alerts.
6284+
6285+
For instance, a monitor grouped by `cluster`, `namespace`, `pod` can be
6286+
configured to only notify on each
6287+
6288+
new `cluster` violating the alert conditions by setting `notify_by` to
6289+
`["cluster"]`. Tags mentioned
6290+
6291+
in `notify_by` have to be a subset of the grouping tags in the query.
6292+
6293+
For example, a query grouped by `cluster`, `namespace` cannot notify on
6294+
`region`.'
6295+
items:
6296+
description: A grouping tag.
6297+
type: string
6298+
type: array
62816299
notify_no_data:
62826300
default: false
62836301
description: A Boolean indicating whether this monitor notifies when data

examples/v1/monitors/ValidateMonitor_4247196452.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
body = Monitor(
1414
name="Example-Validate_a_multi_alert_monitor_returns_OK_response",
1515
type=MonitorType.LOG_ALERT,
16-
query='logs("service:foo AND type:error").index("main").rollup("count").by("source").last("5m") > 2',
16+
query='logs("service:foo AND type:error").index("main").rollup("count").by("source,status").last("5m") > 2',
1717
message="some message Notify: @hipchat-channel",
1818
tags=[
1919
"test:examplevalidateamultialertmonitorreturnsokresponse",
@@ -31,6 +31,9 @@
3131
new_host_delay=600,
3232
no_data_timeframe=None,
3333
notify_audit=False,
34+
notify_by=[
35+
"status",
36+
],
3437
notify_no_data=False,
3538
on_missing_data=OnMissingDataOption.SHOW_AND_NOTIFY_NO_DATA,
3639
renotify_interval=60,

src/datadog_api_client/v1/model/monitor_options.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def openapi_types(_):
4646
"new_host_delay": (int, none_type),
4747
"no_data_timeframe": (int, none_type),
4848
"notify_audit": (bool,),
49+
"notify_by": ([str],),
4950
"notify_no_data": (bool,),
5051
"on_missing_data": (OnMissingDataOption,),
5152
"renotify_interval": (int, none_type),
@@ -83,6 +84,7 @@ def openapi_types(_):
8384
"new_host_delay": "new_host_delay",
8485
"no_data_timeframe": "no_data_timeframe",
8586
"notify_audit": "notify_audit",
87+
"notify_by": "notify_by",
8688
"notify_no_data": "notify_no_data",
8789
"on_missing_data": "on_missing_data",
8890
"renotify_interval": "renotify_interval",
@@ -175,6 +177,13 @@ def __init__(self_, *args, **kwargs):
175177
:param notify_audit: A Boolean indicating whether tagged users is notified on changes to this monitor.
176178
:type notify_audit: bool, optional
177179
180+
:param notify_by: Controls what granularity a monitor alerts on. Only available for multi-alerts.
181+
For instance, a monitor grouped by ``cluster`` , ``namespace`` , ``pod`` can be configured to only notify on each
182+
new ``cluster`` violating the alert conditions by setting ``notify_by`` to ``["cluster"]``. Tags mentioned
183+
in ``notify_by`` have to be a subset of the grouping tags in the query.
184+
For example, a query grouped by ``cluster`` , ``namespace`` cannot notify on ``region``.
185+
:type notify_by: [str], optional
186+
178187
:param notify_no_data: A Boolean indicating whether this monitor notifies when data stops reporting.
179188
:type notify_no_data: bool, optional
180189
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-08-15T18:04:46.756Z
1+
2022-09-30T16:41:33.797Z

tests/v1/cassettes/test_scenarios/test_validate_a_multialert_monitor_returns_ok_response.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
interactions:
22
- request:
3-
body: '{"message":"some message Notify: @hipchat-channel","name":"Test-Validate_a_multi_alert_monitor_returns_OK_response-1660586686","options":{"enable_logs_sample":true,"escalation_message":"the
4-
situation has escalated","evaluation_delay":700,"group_retention_duration":"2d","groupby_simple_monitor":false,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo
5-
AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\")
6-
> 2","tags":["test:testvalidateamultialertmonitorreturnsokresponse1660586686","env:ci"],"type":"log
3+
body: '{"message":"some message Notify: @hipchat-channel","name":"Test-Validate_a_multi_alert_monitor_returns_OK_response-1664556093","options":{"enable_logs_sample":true,"escalation_message":"the
4+
situation has escalated","evaluation_delay":700,"group_retention_duration":"2d","groupby_simple_monitor":false,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notify_audit":false,"notify_by":["status"],"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo
5+
AND type:error\").index(\"main\").rollup(\"count\").by(\"source,status\").last(\"5m\")
6+
> 2","tags":["test:testvalidateamultialertmonitorreturnsokresponse1664556093","env:ci"],"type":"log
77
alert"}'
88
headers:
99
accept:
@@ -14,7 +14,9 @@ interactions:
1414
uri: https://api.datadoghq.com/api/v1/monitor/validate
1515
response:
1616
body:
17-
string: '{}'
17+
string: '{}
18+
19+
'
1820
headers:
1921
content-type:
2022
- application/json

tests/v1/features/monitors.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Feature: Monitors
115115
Scenario: Edit a monitor returns "Bad Request" response
116116
Given new "UpdateMonitor" request
117117
And request contains "monitor_id" parameter from "REPLACE.ME"
118-
And body with value {"options": {"escalation_message": "none", "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, "notify_audit": false, "notify_no_data": false, "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "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"}, "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"}}]}, "restricted_roles": [], "tags": [], "type": "query alert"}
118+
And body with value {"options": {"escalation_message": "none", "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, "notify_audit": false, "notify_by": [], "notify_no_data": false, "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "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"}, "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"}}]}, "restricted_roles": [], "tags": [], "type": "query alert"}
119119
When the request is sent
120120
Then the response status is 400 Bad Request
121121

tests/v1/features/multi_alert_monitor_payload.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "{{ unique }}",
33
"type": "log alert",
4-
"query": "logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") > 2",
4+
"query": "logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source,status\").last(\"5m\") > 2",
55
"message": "some message Notify: @hipchat-channel",
66
"tags": ["test:{{ unique_lower_alnum }}", "env:ci"],
77
"priority": 3,
@@ -16,6 +16,7 @@
1616
"new_host_delay": 600,
1717
"no_data_timeframe": null,
1818
"notify_audit": false,
19+
"notify_by": ["status"],
1920
"notify_no_data": false,
2021
"on_missing_data": "show_and_notify_no_data",
2122
"renotify_interval": 60,

0 commit comments

Comments
 (0)