Skip to content

Commit ef2faa9

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add MatchingDowntime to monitor schema and with_downtimes parameter to GetMonitor (#1152)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 95f5d43 commit ef2faa9

File tree

16 files changed

+490
-29
lines changed

16 files changed

+490
-29
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": "2023-05-23 13:54:22.835080",
8-
"spec_repo_commit": "2ccd9d0a"
7+
"regenerated": "2023-05-23 19:09:30.579731",
8+
"spec_repo_commit": "d1e6ae92"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2023-05-23 13:54:22.848999",
13-
"spec_repo_commit": "2ccd9d0a"
12+
"regenerated": "2023-05-23 19:09:30.600610",
13+
"spec_repo_commit": "d1e6ae92"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5829,6 +5829,43 @@ components:
58295829
type: string
58305830
x-enum-varnames:
58315831
- USER_AGENT_PARSER
5832+
MatchingDowntime:
5833+
description: Object describing a downtime that matches this monitor.
5834+
properties:
5835+
end:
5836+
description: POSIX timestamp to end the downtime.
5837+
example: 1412792983
5838+
format: int64
5839+
nullable: true
5840+
type: integer
5841+
id:
5842+
description: The downtime ID.
5843+
example: 1625
5844+
format: int64
5845+
readOnly: true
5846+
type: integer
5847+
scope:
5848+
description: 'The scope(s) to which the downtime applies. Must be in `key:value`
5849+
format. For example, `host:app2`.
5850+
5851+
Provide multiple scopes as a comma-separated list like `env:dev,env:prod`.
5852+
5853+
The resulting downtime applies to sources that matches ALL provided scopes
5854+
(`env:dev` **AND** `env:prod`).'
5855+
example:
5856+
- env:staging
5857+
items:
5858+
description: A scope. For example, `"env:staging"`.
5859+
type: string
5860+
type: array
5861+
start:
5862+
description: POSIX timestamp to start the downtime.
5863+
example: 1412792983
5864+
format: int64
5865+
type: integer
5866+
required:
5867+
- id
5868+
type: object
58325869
MetricContentEncoding:
58335870
default: deflate
58345871
description: HTTP header used to compress the media-type.
@@ -6109,6 +6146,11 @@ components:
61096146
format: int64
61106147
readOnly: true
61116148
type: integer
6149+
matching_downtimes:
6150+
description: A list of active downtimes that match this monitor.
6151+
items:
6152+
$ref: '#/components/schemas/MatchingDowntime'
6153+
type: array
61126154
message:
61136155
description: A message to include with notifications for this monitor.
61146156
type: string
@@ -25354,6 +25396,13 @@ paths:
2535425396
required: false
2535525397
schema:
2535625398
type: string
25399+
- description: If this argument is set to true, then the returned data includes
25400+
all current active downtimes for the monitor.
25401+
in: query
25402+
name: with_downtimes
25403+
required: false
25404+
schema:
25405+
type: boolean
2535725406
responses:
2535825407
'200':
2535925408
content:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2023-01-18T18:37:19.697Z"
1+
"2023-05-22T17:02:26.784Z"

cassettes/v1/Monitors_4022238206/Get-a-monitor-s-details-returns-OK-response_3416600972/recording.har

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"entries": [
1010
{
11-
"_id": "6fbf40411708208e3520487160b77c03",
11+
"_id": "89558550211e3f22f6fd9315d5d89876",
1212
"_order": 0,
1313
"cache": {},
1414
"request": {
@@ -26,13 +26,13 @@
2626
"value": "application/json"
2727
}
2828
],
29-
"headersSize": 555,
29+
"headersSize": 553,
3030
"httpVersion": "HTTP/1.1",
3131
"method": "POST",
3232
"postData": {
3333
"mimeType": "application/json",
3434
"params": [],
35-
"text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Get_a_monitor_s_details_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:testgetamonitorsdetailsreturnsokresponse1674067039\",\"env:ci\"],\"type\":\"log alert\"}"
35+
"text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Get_a_monitor_s_details_returns_OK_response-1684774946\",\"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:testgetamonitorsdetailsreturnsokresponse1684774946\",\"env:ci\"],\"type\":\"log alert\"}"
3636
},
3737
"queryString": [],
3838
"url": "https://api.datadoghq.com/api/v1/monitor"
@@ -42,7 +42,7 @@
4242
"content": {
4343
"mimeType": "application/json",
4444
"size": 1171,
45-
"text": "{\"id\":108260305,\"org_id\":321813,\"type\":\"log alert\",\"name\":\"Test-Get_a_monitor_s_details_returns_OK_response-1674067039\",\"message\":\"some message Notify: @hipchat-channel\",\"tags\":[\"test:testgetamonitorsdetailsreturnsokresponse1674067039\",\"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.812019+00:00\",\"modified\":\"2023-01-18T18:37:19.812019+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"
45+
"text": "{\"id\":119735290,\"org_id\":321813,\"type\":\"log alert\",\"name\":\"Test-Get_a_monitor_s_details_returns_OK_response-1684774946\",\"message\":\"some message Notify: @hipchat-channel\",\"tags\":[\"test:testgetamonitorsdetailsreturnsokresponse1684774946\",\"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\":1684774946000,\"created\":\"2023-05-22T17:02:26.996650+00:00\",\"modified\":\"2023-05-22T17:02:26.996650+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"
4646
},
4747
"cookies": [],
4848
"headers": [
@@ -51,17 +51,17 @@
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.700Z",
61-
"time": 138
60+
"startedDateTime": "2023-05-22T17:02:26.795Z",
61+
"time": 249
6262
},
6363
{
64-
"_id": "2832aef55c52bab87b61f12eb73d1586",
64+
"_id": "26af356943861afad31f838b381a4cbe",
6565
"_order": 0,
6666
"cache": {},
6767
"request": {
@@ -74,18 +74,23 @@
7474
"value": "application/json"
7575
}
7676
],
77-
"headersSize": 508,
77+
"headersSize": 526,
7878
"httpVersion": "HTTP/1.1",
7979
"method": "GET",
80-
"queryString": [],
81-
"url": "https://api.datadoghq.com/api/v1/monitor/108260305"
80+
"queryString": [
81+
{
82+
"name": "with_downtimes",
83+
"value": "true"
84+
}
85+
],
86+
"url": "https://api.datadoghq.com/api/v1/monitor/119735290?with_downtimes=true"
8287
},
8388
"response": {
84-
"bodySize": 1171,
89+
"bodySize": 1195,
8590
"content": {
8691
"mimeType": "application/json",
87-
"size": 1171,
88-
"text": "{\"id\":108260305,\"org_id\":321813,\"type\":\"log alert\",\"name\":\"Test-Get_a_monitor_s_details_returns_OK_response-1674067039\",\"message\":\"some message Notify: @hipchat-channel\",\"tags\":[\"test:testgetamonitorsdetailsreturnsokresponse1674067039\",\"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.812019+00:00\",\"modified\":\"2023-01-18T18:37:19.812019+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"
92+
"size": 1195,
93+
"text": "{\"id\":119735290,\"org_id\":321813,\"type\":\"log alert\",\"name\":\"Test-Get_a_monitor_s_details_returns_OK_response-1684774946\",\"message\":\"some message Notify: @hipchat-channel\",\"tags\":[\"test:testgetamonitorsdetailsreturnsokresponse1684774946\",\"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\":1684774946000,\"created\":\"2023-05-22T17:02:26.996650+00:00\",\"modified\":\"2023-05-22T17:02:26.996650+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},\"matching_downtimes\":[]}\n"
8994
},
9095
"cookies": [],
9196
"headers": [
@@ -94,17 +99,17 @@
9499
"value": "application/json"
95100
}
96101
],
97-
"headersSize": 623,
102+
"headersSize": 650,
98103
"httpVersion": "HTTP/1.1",
99104
"redirectURL": "",
100105
"status": 200,
101106
"statusText": "OK"
102107
},
103-
"startedDateTime": "2023-01-18T18:37:19.845Z",
104-
"time": 101
108+
"startedDateTime": "2023-05-22T17:02:27.066Z",
109+
"time": 180
105110
},
106111
{
107-
"_id": "d99fd48f4b670de45f64f09a5daf9ce4",
112+
"_id": "375ae2d712d7d1bd8b219f3e77e88b61",
108113
"_order": 0,
109114
"cache": {},
110115
"request": {
@@ -117,18 +122,18 @@
117122
"value": "application/json"
118123
}
119124
],
120-
"headersSize": 514,
125+
"headersSize": 512,
121126
"httpVersion": "HTTP/1.1",
122127
"method": "DELETE",
123128
"queryString": [],
124-
"url": "https://api.datadoghq.com/api/v1/monitor/108260305"
129+
"url": "https://api.datadoghq.com/api/v1/monitor/119735290"
125130
},
126131
"response": {
127132
"bodySize": 33,
128133
"content": {
129134
"mimeType": "application/json",
130135
"size": 33,
131-
"text": "{\"deleted_monitor_id\":108260305}\n"
136+
"text": "{\"deleted_monitor_id\":119735290}\n"
132137
},
133138
"cookies": [],
134139
"headers": [
@@ -137,14 +142,14 @@
137142
"value": "application/json"
138143
}
139144
],
140-
"headersSize": 489,
145+
"headersSize": 516,
141146
"httpVersion": "HTTP/1.1",
142147
"redirectURL": "",
143148
"status": 200,
144149
"statusText": "OK"
145150
},
146-
"startedDateTime": "2023-01-18T18:37:19.952Z",
147-
"time": 123
151+
"startedDateTime": "2023-05-22T17:02:27.263Z",
152+
"time": 182
148153
}
149154
],
150155
"pages": [],
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2023-05-22T21:15:19.763Z"

0 commit comments

Comments
 (0)