dogapi 1.11.0 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/CHANGELOG.md +4 -0
- data/lib/dogapi/event.rb +4 -2
- data/lib/dogapi/facade.rb +70 -1
- data/lib/dogapi/v1/event.rb +4 -2
- data/lib/dogapi/v1/monitor.rb +220 -0
- data/lib/dogapi/v1/service_check.rb +32 -0
- data/lib/dogapi/v1.rb +2 -0
- data/lib/dogapi/version.rb +1 -1
- data/spec/alerts_spec.rb +2 -2
- data/spec/facade_spec.rb +3 -3
- data/spec/support/cassettes/Alerts/create/returns_HTTP_code_200.yml +98 -0
- data/spec/support/cassettes/Alerts/create/returns_a_valid_event_ID.yml +84 -36
- data/spec/support/cassettes/Alerts/create/returns_the_same_query_as_sent.yml +84 -36
- data/spec/support/cassettes/Facade/Events/emits_aggregate_events.yml +161 -59
- data/spec/support/cassettes/Facade/Events/emits_events_and_retrieves_them.yml +85 -35
- data/spec/support/cassettes/Facade/Events/emits_events_with_specified_priority.yml +81 -30
- data/spec/support/cassettes/Facade/Tags/adds_updates_and_detaches_tags.yml +106 -90
- data/tests/test_alerts.rb +2 -2
- data/tests/test_monitors.rb +138 -0
- metadata +14 -9
@@ -8,7 +8,7 @@ http_interactions:
|
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
|
-
-
|
11
|
+
- '*/*'
|
12
12
|
User-Agent:
|
13
13
|
- Ruby
|
14
14
|
response:
|
@@ -36,7 +36,7 @@ http_interactions:
|
|
36
36
|
- keep-alive
|
37
37
|
body:
|
38
38
|
encoding: US-ASCII
|
39
|
-
string:
|
39
|
+
string: '{"notify_no_data": false, "event_object": "6bc5a22ffc9d267c3cd6eb3ad79623e0",
|
40
40
|
"state": "OK", "name": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
41
41
|
> 5", "silenced": false, "query": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
42
42
|
> 5", "message": null, "creator": 3658, "timeout_h": null}'
|
@@ -50,7 +50,7 @@ http_interactions:
|
|
50
50
|
string: ''
|
51
51
|
headers:
|
52
52
|
Accept:
|
53
|
-
-
|
53
|
+
- '*/*'
|
54
54
|
User-Agent:
|
55
55
|
- Ruby
|
56
56
|
response:
|
@@ -79,31 +79,28 @@ http_interactions:
|
|
79
79
|
- keep-alive
|
80
80
|
body:
|
81
81
|
encoding: US-ASCII
|
82
|
-
string:
|
83
|
-
|
82
|
+
string: '{"event_object": "6bc5a22ffc9d267c3cd6eb3ad79623e0", "timeout_h": null,
|
83
|
+
"silenced": false, "query": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
84
84
|
> 5", "message": null, "name": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
85
85
|
> 5", "silenced_timeout_ts": null, "creator": 3658, "notify_no_data": false,
|
86
86
|
"state": "OK"}'
|
87
87
|
http_version:
|
88
88
|
recorded_at: Thu, 08 May 2014 18:08:34 GMT
|
89
89
|
- request:
|
90
|
-
method:
|
91
|
-
uri: https://app.datadoghq.com/api/v1/alert?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
90
|
+
method: delete
|
91
|
+
uri: https://app.datadoghq.com/api/v1/alert/57370?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
92
92
|
body:
|
93
|
-
encoding:
|
94
|
-
string:
|
95
|
-
> 5"}'
|
93
|
+
encoding: US-ASCII
|
94
|
+
string: ''
|
96
95
|
headers:
|
97
96
|
Accept:
|
98
|
-
-
|
97
|
+
- '*/*'
|
99
98
|
User-Agent:
|
100
99
|
- Ruby
|
101
|
-
Content-Type:
|
102
|
-
- application/json
|
103
100
|
response:
|
104
101
|
status:
|
105
|
-
code:
|
106
|
-
message:
|
102
|
+
code: 200
|
103
|
+
message: OK
|
107
104
|
headers:
|
108
105
|
Cache-Control:
|
109
106
|
- no-cache
|
@@ -121,27 +118,78 @@ http_interactions:
|
|
121
118
|
X-Dd-Version:
|
122
119
|
- 31.1129.1362-0
|
123
120
|
Content-Length:
|
124
|
-
- '
|
121
|
+
- '366'
|
125
122
|
Connection:
|
126
123
|
- keep-alive
|
127
124
|
body:
|
128
125
|
encoding: US-ASCII
|
129
|
-
string:
|
126
|
+
string: '{"event_object": "6bc5a22ffc9d267c3cd6eb3ad79623e0", "notify_audit":
|
130
127
|
true, "timeout_h": null, "silenced": false, "query": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
131
|
-
> 5", "message": null, "
|
128
|
+
> 5", "message": null, "name": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
132
129
|
> 5", "silenced_timeout_ts": null, "creator": 3658, "notify_no_data": false,
|
133
130
|
"state": "OK"}'
|
134
131
|
http_version:
|
135
132
|
recorded_at: Tue, 13 May 2014 19:48:03 GMT
|
133
|
+
- request:
|
134
|
+
method: post
|
135
|
+
uri: https://app.datadoghq.com/api/v1/alert?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
136
|
+
body:
|
137
|
+
encoding: UTF-8
|
138
|
+
string: '{"query":"avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
139
|
+
> 5"}'
|
140
|
+
headers:
|
141
|
+
Accept-Encoding:
|
142
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
143
|
+
Accept:
|
144
|
+
- '*/*'
|
145
|
+
User-Agent:
|
146
|
+
- Ruby
|
147
|
+
Content-Type:
|
148
|
+
- application/json
|
149
|
+
response:
|
150
|
+
status:
|
151
|
+
code: 200
|
152
|
+
message: OK
|
153
|
+
headers:
|
154
|
+
Cache-Control:
|
155
|
+
- no-cache
|
156
|
+
Content-Type:
|
157
|
+
- application/json; charset=utf-8
|
158
|
+
Date:
|
159
|
+
- Mon, 17 Nov 2014 18:26:22 GMT
|
160
|
+
Pragma:
|
161
|
+
- no-cache
|
162
|
+
Server:
|
163
|
+
- gunicorn/19.1.0
|
164
|
+
Strict-Transport-Security:
|
165
|
+
- max-age=15724800;
|
166
|
+
Vary:
|
167
|
+
- Accept-Encoding
|
168
|
+
X-Dd-Version:
|
169
|
+
- 31.1883.245-0
|
170
|
+
Content-Length:
|
171
|
+
- '288'
|
172
|
+
Connection:
|
173
|
+
- keep-alive
|
174
|
+
body:
|
175
|
+
encoding: UTF-8
|
176
|
+
string: '{"event_object":"d709ad144fa2ddcc5daa4f866747a991","notify_audit":true,"timeout_h":null,"silenced":{},"query":"avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
177
|
+
> 5","message":"","id":103960,"name":"**test.metric.metric** over **host:test.metric.host**
|
178
|
+
was **> 5** on average during the **last 10m**.","no_data_timeframe":false,"creator":3658,"notify_no_data":false,"renotify_interval":null,"state":"No
|
179
|
+
Data","escalation_message":""}'
|
180
|
+
http_version:
|
181
|
+
recorded_at: Mon, 17 Nov 2014 18:26:22 GMT
|
136
182
|
- request:
|
137
183
|
method: delete
|
138
|
-
uri: https://app.datadoghq.com/api/v1/alert/
|
184
|
+
uri: https://app.datadoghq.com/api/v1/alert/103960?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
139
185
|
body:
|
140
186
|
encoding: US-ASCII
|
141
187
|
string: ''
|
142
188
|
headers:
|
189
|
+
Accept-Encoding:
|
190
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
143
191
|
Accept:
|
144
|
-
-
|
192
|
+
- '*/*'
|
145
193
|
User-Agent:
|
146
194
|
- Ruby
|
147
195
|
response:
|
@@ -152,29 +200,29 @@ http_interactions:
|
|
152
200
|
Cache-Control:
|
153
201
|
- no-cache
|
154
202
|
Content-Type:
|
155
|
-
- application/json
|
203
|
+
- application/json; charset=utf-8
|
156
204
|
Date:
|
157
|
-
-
|
205
|
+
- Mon, 17 Nov 2014 18:26:22 GMT
|
158
206
|
Pragma:
|
159
207
|
- no-cache
|
160
208
|
Server:
|
161
|
-
- gunicorn/
|
162
|
-
|
163
|
-
-
|
164
|
-
|
209
|
+
- gunicorn/19.1.0
|
210
|
+
Strict-Transport-Security:
|
211
|
+
- max-age=15724800;
|
212
|
+
Vary:
|
213
|
+
- Accept-Encoding
|
165
214
|
X-Dd-Version:
|
166
|
-
- 31.
|
215
|
+
- 31.1883.245-0
|
167
216
|
Content-Length:
|
168
|
-
- '
|
217
|
+
- '279'
|
169
218
|
Connection:
|
170
219
|
- keep-alive
|
171
220
|
body:
|
172
|
-
encoding:
|
173
|
-
string:
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
"state": "OK"}'
|
221
|
+
encoding: UTF-8
|
222
|
+
string: '{"event_object":"d709ad144fa2ddcc5daa4f866747a991","notify_audit":true,"timeout_h":null,"silenced":{},"query":"avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
223
|
+
> 5","message":"","name":"**test.metric.metric** over **host:test.metric.host**
|
224
|
+
was **> 5** on average during the **last 10m**.","no_data_timeframe":false,"creator":3658,"notify_no_data":false,"renotify_interval":null,"state":"No
|
225
|
+
Data","escalation_message":""}'
|
178
226
|
http_version:
|
179
|
-
recorded_at:
|
180
|
-
recorded_with: VCR 2.9.
|
227
|
+
recorded_at: Mon, 17 Nov 2014 18:26:22 GMT
|
228
|
+
recorded_with: VCR 2.9.3
|
@@ -8,7 +8,7 @@ http_interactions:
|
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
|
-
-
|
11
|
+
- '*/*'
|
12
12
|
User-Agent:
|
13
13
|
- Ruby
|
14
14
|
response:
|
@@ -36,7 +36,7 @@ http_interactions:
|
|
36
36
|
- keep-alive
|
37
37
|
body:
|
38
38
|
encoding: US-ASCII
|
39
|
-
string:
|
39
|
+
string: '{"notify_no_data": false, "event_object": "6bc5a22ffc9d267c3cd6eb3ad79623e0",
|
40
40
|
"state": "OK", "name": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
41
41
|
> 5", "silenced": false, "query": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
42
42
|
> 5", "message": null, "creator": 3658, "timeout_h": null}'
|
@@ -50,7 +50,7 @@ http_interactions:
|
|
50
50
|
string: ''
|
51
51
|
headers:
|
52
52
|
Accept:
|
53
|
-
-
|
53
|
+
- '*/*'
|
54
54
|
User-Agent:
|
55
55
|
- Ruby
|
56
56
|
response:
|
@@ -79,31 +79,28 @@ http_interactions:
|
|
79
79
|
- keep-alive
|
80
80
|
body:
|
81
81
|
encoding: US-ASCII
|
82
|
-
string:
|
83
|
-
|
82
|
+
string: '{"event_object": "6bc5a22ffc9d267c3cd6eb3ad79623e0", "timeout_h": null,
|
83
|
+
"silenced": false, "query": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
84
84
|
> 5", "message": null, "name": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
85
85
|
> 5", "silenced_timeout_ts": null, "creator": 3658, "notify_no_data": false,
|
86
86
|
"state": "OK"}'
|
87
87
|
http_version:
|
88
88
|
recorded_at: Thu, 08 May 2014 18:08:40 GMT
|
89
89
|
- request:
|
90
|
-
method:
|
91
|
-
uri: https://app.datadoghq.com/api/v1/alert?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
90
|
+
method: delete
|
91
|
+
uri: https://app.datadoghq.com/api/v1/alert/57369?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
92
92
|
body:
|
93
|
-
encoding:
|
94
|
-
string:
|
95
|
-
> 5"}'
|
93
|
+
encoding: US-ASCII
|
94
|
+
string: ''
|
96
95
|
headers:
|
97
96
|
Accept:
|
98
|
-
-
|
97
|
+
- '*/*'
|
99
98
|
User-Agent:
|
100
99
|
- Ruby
|
101
|
-
Content-Type:
|
102
|
-
- application/json
|
103
100
|
response:
|
104
101
|
status:
|
105
|
-
code:
|
106
|
-
message:
|
102
|
+
code: 200
|
103
|
+
message: OK
|
107
104
|
headers:
|
108
105
|
Cache-Control:
|
109
106
|
- no-cache
|
@@ -121,27 +118,78 @@ http_interactions:
|
|
121
118
|
X-Dd-Version:
|
122
119
|
- 31.1129.1362-0
|
123
120
|
Content-Length:
|
124
|
-
- '
|
121
|
+
- '366'
|
125
122
|
Connection:
|
126
123
|
- keep-alive
|
127
124
|
body:
|
128
125
|
encoding: US-ASCII
|
129
|
-
string:
|
126
|
+
string: '{"event_object": "6bc5a22ffc9d267c3cd6eb3ad79623e0", "notify_audit":
|
130
127
|
true, "timeout_h": null, "silenced": false, "query": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
131
|
-
> 5", "message": null, "
|
128
|
+
> 5", "message": null, "name": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
132
129
|
> 5", "silenced_timeout_ts": null, "creator": 3658, "notify_no_data": false,
|
133
130
|
"state": "OK"}'
|
134
131
|
http_version:
|
135
132
|
recorded_at: Tue, 13 May 2014 19:48:02 GMT
|
133
|
+
- request:
|
134
|
+
method: post
|
135
|
+
uri: https://app.datadoghq.com/api/v1/alert?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
136
|
+
body:
|
137
|
+
encoding: UTF-8
|
138
|
+
string: '{"query":"avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
139
|
+
> 5"}'
|
140
|
+
headers:
|
141
|
+
Accept-Encoding:
|
142
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
143
|
+
Accept:
|
144
|
+
- '*/*'
|
145
|
+
User-Agent:
|
146
|
+
- Ruby
|
147
|
+
Content-Type:
|
148
|
+
- application/json
|
149
|
+
response:
|
150
|
+
status:
|
151
|
+
code: 200
|
152
|
+
message: OK
|
153
|
+
headers:
|
154
|
+
Cache-Control:
|
155
|
+
- no-cache
|
156
|
+
Content-Type:
|
157
|
+
- application/json; charset=utf-8
|
158
|
+
Date:
|
159
|
+
- Mon, 17 Nov 2014 18:26:24 GMT
|
160
|
+
Pragma:
|
161
|
+
- no-cache
|
162
|
+
Server:
|
163
|
+
- gunicorn/19.1.0
|
164
|
+
Strict-Transport-Security:
|
165
|
+
- max-age=15724800;
|
166
|
+
Vary:
|
167
|
+
- Accept-Encoding
|
168
|
+
X-Dd-Version:
|
169
|
+
- 31.1883.245-0
|
170
|
+
Content-Length:
|
171
|
+
- '288'
|
172
|
+
Connection:
|
173
|
+
- keep-alive
|
174
|
+
body:
|
175
|
+
encoding: UTF-8
|
176
|
+
string: '{"event_object":"d709ad144fa2ddcc5daa4f866747a991","notify_audit":true,"timeout_h":null,"silenced":{},"query":"avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
177
|
+
> 5","message":"","id":103962,"name":"**test.metric.metric** over **host:test.metric.host**
|
178
|
+
was **> 5** on average during the **last 10m**.","no_data_timeframe":false,"creator":3658,"notify_no_data":false,"renotify_interval":null,"state":"No
|
179
|
+
Data","escalation_message":""}'
|
180
|
+
http_version:
|
181
|
+
recorded_at: Mon, 17 Nov 2014 18:26:24 GMT
|
136
182
|
- request:
|
137
183
|
method: delete
|
138
|
-
uri: https://app.datadoghq.com/api/v1/alert/
|
184
|
+
uri: https://app.datadoghq.com/api/v1/alert/103962?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
139
185
|
body:
|
140
186
|
encoding: US-ASCII
|
141
187
|
string: ''
|
142
188
|
headers:
|
189
|
+
Accept-Encoding:
|
190
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
143
191
|
Accept:
|
144
|
-
-
|
192
|
+
- '*/*'
|
145
193
|
User-Agent:
|
146
194
|
- Ruby
|
147
195
|
response:
|
@@ -152,29 +200,29 @@ http_interactions:
|
|
152
200
|
Cache-Control:
|
153
201
|
- no-cache
|
154
202
|
Content-Type:
|
155
|
-
- application/json
|
203
|
+
- application/json; charset=utf-8
|
156
204
|
Date:
|
157
|
-
-
|
205
|
+
- Mon, 17 Nov 2014 18:26:24 GMT
|
158
206
|
Pragma:
|
159
207
|
- no-cache
|
160
208
|
Server:
|
161
|
-
- gunicorn/
|
162
|
-
|
163
|
-
-
|
164
|
-
|
209
|
+
- gunicorn/19.1.0
|
210
|
+
Strict-Transport-Security:
|
211
|
+
- max-age=15724800;
|
212
|
+
Vary:
|
213
|
+
- Accept-Encoding
|
165
214
|
X-Dd-Version:
|
166
|
-
- 31.
|
215
|
+
- 31.1883.245-0
|
167
216
|
Content-Length:
|
168
|
-
- '
|
217
|
+
- '279'
|
169
218
|
Connection:
|
170
219
|
- keep-alive
|
171
220
|
body:
|
172
|
-
encoding:
|
173
|
-
string:
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
"state": "OK"}'
|
221
|
+
encoding: UTF-8
|
222
|
+
string: '{"event_object":"d709ad144fa2ddcc5daa4f866747a991","notify_audit":true,"timeout_h":null,"silenced":{},"query":"avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
223
|
+
> 5","message":"","name":"**test.metric.metric** over **host:test.metric.host**
|
224
|
+
was **> 5** on average during the **last 10m**.","no_data_timeframe":false,"creator":3658,"notify_no_data":false,"renotify_interval":null,"state":"No
|
225
|
+
Data","escalation_message":""}'
|
178
226
|
http_version:
|
179
|
-
recorded_at:
|
180
|
-
recorded_with: VCR 2.9.
|
227
|
+
recorded_at: Mon, 17 Nov 2014 18:26:24 GMT
|
228
|
+
recorded_with: VCR 2.9.3
|