Skip to content

Commit d85e9b2

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Monitor priority can have custom ranges and be null (#1669)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent c09810e commit d85e9b2

File tree

6 files changed

+34
-35
lines changed

6 files changed

+34
-35
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-06-27 17:06:10.290866",
8-
"spec_repo_commit": "5ebef994"
7+
"regenerated": "2024-06-27 21:40:22.987614",
8+
"spec_repo_commit": "4ed44e4c"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-06-27 17:06:10.309309",
13-
"spec_repo_commit": "5ebef994"
12+
"regenerated": "2024-06-27 21:40:23.010714",
13+
"spec_repo_commit": "4ed44e4c"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -6615,8 +6615,6 @@ components:
66156615
priority:
66166616
description: Integer from 1 (high) to 5 (low) indicating alert severity.
66176617
format: int64
6618-
maximum: 5
6619-
minimum: 1
66206618
nullable: true
66216619
type: integer
66226620
query:
@@ -7705,8 +7703,7 @@ components:
77057703
priority:
77067704
description: Integer from 1 (high) to 5 (low) indicating alert severity.
77077705
format: int64
7708-
maximum: 5
7709-
minimum: 1
7706+
nullable: true
77107707
type: integer
77117708
query:
77127709
description: The monitor query.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2023-01-18T18:37:19.255Z"
1+
"2024-06-20T19:37:04.361Z"

cassettes/v1/Monitors_4022238206/Edit-a-monitor-returns-OK-response_829971522/recording.har

+24-24
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"entries": [
1010
{
11-
"_id": "73285012d34c365618463a54af58da7e",
11+
"_id": "b336d75fdb0f62fd49d8d4be46279997",
1212
"_order": 0,
1313
"cache": {},
1414
"request": {
@@ -32,17 +32,17 @@
3232
"postData": {
3333
"mimeType": "application/json",
3434
"params": [],
35-
"text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Edit_a_monitor_returns_OK_response-1674067039\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notification_preset_name\":\"hide_handles\",\"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 AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testeditamonitorreturnsokresponse1674067039\",\"env:ci\"],\"type\":\"log alert\"}"
35+
"text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Edit_a_monitor_returns_OK_response-1718912224\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notification_preset_name\":\"hide_handles\",\"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 AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testeditamonitorreturnsokresponse1718912224\",\"env:ci\"],\"type\":\"log alert\"}"
3636
},
3737
"queryString": [],
3838
"url": "https://api.datadoghq.com/api/v1/monitor"
3939
},
4040
"response": {
41-
"bodySize": 1155,
41+
"bodySize": 1213,
4242
"content": {
4343
"mimeType": "application/json",
44-
"size": 1155,
45-
"text": "{\"id\":108260304,\"org_id\":321813,\"type\":\"log alert\",\"name\":\"Test-Edit_a_monitor_returns_OK_response-1674067039\",\"message\":\"some message Notify: @hipchat-channel\",\"tags\":[\"test:testeditamonitorreturnsokresponse1674067039\",\"env:ci\"],\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notification_preset_name\":\"hide_handles\",\"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.0,\"warning\":1.0},\"timeout_h\":24,\"silenced\":{}},\"multi\":true,\"created_at\":1674067039000,\"created\":\"2023-01-18T18:37:19.356677+00:00\",\"modified\":\"2023-01-18T18:37:19.356677+00:00\",\"deleted\":null,\"restricted_roles\":null,\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"creator\":{\"name\":null,\"handle\":\"[email protected]\",\"email\":\"[email protected]\",\"id\":1445416}}\n"
44+
"size": 1213,
45+
"text": "{\"id\":147580793,\"org_id\":237503,\"type\":\"log alert\",\"name\":\"Test-Edit_a_monitor_returns_OK_response-1718912224\",\"message\":\"some message Notify: @hipchat-channel\",\"tags\":[\"test:testeditamonitorreturnsokresponse1718912224\",\"env:ci\"],\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"groupby_simple_monitor\":true,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notification_preset_name\":\"hide_handles\",\"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.0,\"warning\":1.0},\"timeout_h\":24,\"silenced\":{}},\"multi\":true,\"created_at\":1718912224000,\"created\":\"2024-06-20T19:37:04.686145+00:00\",\"modified\":\"2024-06-20T19:37:04.686145+00:00\",\"deleted\":null,\"restricted_roles\":null,\"priority\":3,\"restriction_policy\":null,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"creator\":{\"name\":\"Carl Martensen\",\"handle\":\"[email protected]\",\"email\":\"[email protected]\",\"id\":1078685}}\n"
4646
},
4747
"cookies": [],
4848
"headers": [
@@ -51,21 +51,21 @@
5151
"value": "application/json"
5252
}
5353
],
54-
"headersSize": 622,
54+
"headersSize": 649,
5555
"httpVersion": "HTTP/1.1",
5656
"redirectURL": "",
5757
"status": 200,
5858
"statusText": "OK"
5959
},
60-
"startedDateTime": "2023-01-18T18:37:19.257Z",
61-
"time": 123
60+
"startedDateTime": "2024-06-20T19:37:04.367Z",
61+
"time": 380
6262
},
6363
{
64-
"_id": "47bfb31fb7051a24f481d639c5b735aa",
64+
"_id": "ea4e388c9901c737a77152d71798dec3",
6565
"_order": 0,
6666
"cache": {},
6767
"request": {
68-
"bodySize": 234,
68+
"bodySize": 250,
6969
"cookies": [],
7070
"headers": [
7171
{
@@ -85,17 +85,17 @@
8585
"postData": {
8686
"mimeType": "application/json",
8787
"params": [],
88-
"text": "{\"name\":\"Test-Edit_a_monitor_returns_OK_response-1674067039-updated\",\"options\":{\"evaluation_delay\":null,\"new_group_delay\":600,\"new_host_delay\":null,\"renotify_interval\":null,\"thresholds\":{\"critical\":2,\"warning\":null},\"timeout_h\":null}}"
88+
"text": "{\"name\":\"Test-Edit_a_monitor_returns_OK_response-1718912224-updated\",\"options\":{\"evaluation_delay\":null,\"new_group_delay\":600,\"new_host_delay\":null,\"renotify_interval\":null,\"thresholds\":{\"critical\":2,\"warning\":null},\"timeout_h\":null},\"priority\":null}"
8989
},
9090
"queryString": [],
91-
"url": "https://api.datadoghq.com/api/v1/monitor/108260304"
91+
"url": "https://api.datadoghq.com/api/v1/monitor/147580793"
9292
},
9393
"response": {
94-
"bodySize": 852,
94+
"bodySize": 881,
9595
"content": {
9696
"mimeType": "application/json",
97-
"size": 852,
98-
"text": "{\"id\":108260304,\"org_id\":321813,\"type\":\"log alert\",\"name\":\"Test-Edit_a_monitor_returns_OK_response-1674067039-updated\",\"message\":\"some message Notify: @hipchat-channel\",\"tags\":[\"test:testeditamonitorreturnsokresponse1674067039\",\"env:ci\"],\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"options\":{\"evaluation_delay\":null,\"new_group_delay\":600,\"new_host_delay\":null,\"renotify_interval\":null,\"thresholds\":{\"critical\":2.0},\"timeout_h\":null,\"notify_no_data\":false,\"notify_audit\":false,\"include_tags\":true,\"groupby_simple_monitor\":false,\"silenced\":{}},\"multi\":true,\"created_at\":1674067039000,\"created\":\"2023-01-18T18:37:19.356677+00:00\",\"modified\":\"2023-01-18T18:37:19.511143+00:00\",\"deleted\":null,\"restricted_roles\":null,\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\"}\n"
97+
"size": 881,
98+
"text": "{\"id\":147580793,\"org_id\":237503,\"type\":\"log alert\",\"name\":\"Test-Edit_a_monitor_returns_OK_response-1718912224-updated\",\"message\":\"some message Notify: @hipchat-channel\",\"tags\":[\"test:testeditamonitorreturnsokresponse1718912224\",\"env:ci\"],\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"options\":{\"evaluation_delay\":null,\"new_group_delay\":600,\"new_host_delay\":null,\"renotify_interval\":null,\"thresholds\":{\"critical\":2.0},\"timeout_h\":null,\"notify_no_data\":false,\"notify_audit\":false,\"include_tags\":true,\"groupby_simple_monitor\":false,\"silenced\":{}},\"multi\":true,\"created_at\":1718912224000,\"created\":\"2024-06-20T19:37:04.686145+00:00\",\"modified\":\"2024-06-20T19:37:05.129654+00:00\",\"deleted\":null,\"restricted_roles\":null,\"priority\":null,\"restriction_policy\":null,\"overall_state_modified\":null,\"overall_state\":\"No Data\"}\n"
9999
},
100100
"cookies": [],
101101
"headers": [
@@ -104,17 +104,17 @@
104104
"value": "application/json"
105105
}
106106
],
107-
"headersSize": 620,
107+
"headersSize": 647,
108108
"httpVersion": "HTTP/1.1",
109109
"redirectURL": "",
110110
"status": 200,
111111
"statusText": "OK"
112112
},
113-
"startedDateTime": "2023-01-18T18:37:19.387Z",
114-
"time": 162
113+
"startedDateTime": "2024-06-20T19:37:04.756Z",
114+
"time": 447
115115
},
116116
{
117-
"_id": "13e62df801116d9348323dc160a16619",
117+
"_id": "081eb85912e8a2c603adfd660d688403",
118118
"_order": 0,
119119
"cache": {},
120120
"request": {
@@ -131,14 +131,14 @@
131131
"httpVersion": "HTTP/1.1",
132132
"method": "DELETE",
133133
"queryString": [],
134-
"url": "https://api.datadoghq.com/api/v1/monitor/108260304"
134+
"url": "https://api.datadoghq.com/api/v1/monitor/147580793"
135135
},
136136
"response": {
137137
"bodySize": 33,
138138
"content": {
139139
"mimeType": "application/json",
140140
"size": 33,
141-
"text": "{\"deleted_monitor_id\":108260304}\n"
141+
"text": "{\"deleted_monitor_id\":147580793}\n"
142142
},
143143
"cookies": [],
144144
"headers": [
@@ -147,14 +147,14 @@
147147
"value": "application/json"
148148
}
149149
],
150-
"headersSize": 489,
150+
"headersSize": 516,
151151
"httpVersion": "HTTP/1.1",
152152
"redirectURL": "",
153153
"status": 200,
154154
"statusText": "OK"
155155
},
156-
"startedDateTime": "2023-01-18T18:37:19.555Z",
157-
"time": 134
156+
"startedDateTime": "2024-06-20T19:37:05.210Z",
157+
"time": 367
158158
}
159159
],
160160
"pages": [],

examples/v1/monitors/UpdateMonitor.ts

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const MONITOR_ID = parseInt(process.env.MONITOR_ID as string);
1313
const params: v1.MonitorsApiUpdateMonitorRequest = {
1414
body: {
1515
name: "My monitor-updated",
16+
priority: undefined,
1617
options: {
1718
evaluationDelay: undefined,
1819
newGroupDelay: 600,

features/v1/monitors.feature

+3-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Feature: Monitors
157157
Scenario: Edit a monitor returns "Bad Request" response
158158
Given new "UpdateMonitor" request
159159
And request contains "monitor_id" parameter from "REPLACE.ME"
160-
And body with value {"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}}, "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"}
160+
And body with value {"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}}, "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"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"}
161161
When the request is sent
162162
Then the response status is 400 Bad Request
163163

@@ -174,10 +174,11 @@ Feature: Monitors
174174
Given there is a valid "monitor" in the system
175175
And new "UpdateMonitor" request
176176
And request contains "monitor_id" parameter from "monitor.id"
177-
And body with value {"name": "{{ monitor.name }}-updated", "options": {"evaluation_delay": null, "new_group_delay": 600, "new_host_delay":null, "renotify_interval":null, "thresholds": {"critical":2, "warning": null}, "timeout_h": null}}
177+
And body with value {"name": "{{ monitor.name }}-updated", "priority": null, "options": {"evaluation_delay": null, "new_group_delay": 600, "new_host_delay":null, "renotify_interval":null, "thresholds": {"critical":2, "warning": null}, "timeout_h": null}}
178178
When the request is sent
179179
Then the response status is 200 OK
180180
And the response "name" is equal to "{{ monitor.name }}-updated"
181+
And the response "priority" is equal to null
181182

182183
@generated @skip @team:DataDog/monitor-app
183184
Scenario: Get a monitor's details returns "Bad Request" response

0 commit comments

Comments
 (0)