dogapi 1.21.0 → 1.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +5 -2
  4. data/CHANGELOG.md +8 -3
  5. data/Gemfile +1 -0
  6. data/README.rdoc +22 -0
  7. data/Rakefile +2 -7
  8. data/lib/dogapi/facade.rb +10 -0
  9. data/lib/dogapi/v1/metric.rb +28 -3
  10. data/lib/dogapi/version.rb +1 -1
  11. data/spec/spec_helper.rb +3 -1
  12. data/spec/support/cassettes/Alerts/create/returns_HTTP_code_200.yml +39 -23
  13. data/spec/support/cassettes/Alerts/create/returns_a_valid_event_ID.yml +39 -153
  14. data/spec/support/cassettes/Alerts/create/returns_the_same_query_as_sent.yml +39 -153
  15. data/spec/support/cassettes/Facade/Events/emits_aggregate_events.yml +68 -264
  16. data/spec/support/cassettes/Facade/Events/emits_events_and_retrieves_them.yml +36 -153
  17. data/spec/support/cassettes/Facade/Events/emits_events_with_specified_priority.yml +34 -149
  18. data/spec/support/cassettes/Facade/Tags/adds_updates_and_detaches_tags.yml +132 -66
  19. data/tests/test_alerts.rb +1 -1
  20. data/tests/test_base.rb +1 -1
  21. data/tests/test_client.rb +1 -1
  22. data/tests/test_comments.rb +1 -1
  23. data/tests/test_dashes.rb +1 -1
  24. data/tests/test_embed.rb +2 -2
  25. data/tests/test_monitors.rb +1 -1
  26. data/tests/test_screenboard.rb +2 -2
  27. data/tests/test_search.rb +1 -1
  28. data/tests/test_snapshot.rb +1 -1
  29. data/tests/test_users.rb +1 -1
  30. metadata +21 -32
  31. data/spec/support/cassettes/Alerts/create/returns_HTTP_code_201.yml +0 -191
  32. data/spec/support/cassettes/Facade/Client/emit_point_can_pass_nil_host.yml +0 -32
  33. data/spec/support/cassettes/Facade/Client/emit_point_passes_data.yml +0 -32
  34. data/spec/support/cassettes/Facade/Client/emit_point_uses_localhost_default.yml +0 -32
  35. data/spec/support/cassettes/Facade/Client/emits_point_with_localhost.yml +0 -32
@@ -2,15 +2,15 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://app.datadoghq.com/api/v1/series?api_key=9775a026f1ca7d1c6c5af9d94d9595a4
5
+ uri: https://app.datadoghq.com/api/v1/series?api_key=<DATADOG_API_KEY>
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"series":[{"metric":"test.tag.metric","points":[[1416248810,1.0]],"type":"gauge","host":"test.tag.host","device":null}]}'
8
+ string: '{"series":[{"metric":"test.tag.metric","points":[[1460397371,1.0]],"type":"gauge","host":"test.tag.host","device":null}]}'
9
9
  headers:
10
10
  Accept-Encoding:
11
11
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
12
  Accept:
13
- - '*/*'
13
+ - "*/*"
14
14
  User-Agent:
15
15
  - Ruby
16
16
  Content-Type:
@@ -21,25 +21,27 @@ http_interactions:
21
21
  message: Accepted
22
22
  headers:
23
23
  Content-Type:
24
- - text/json; charset=UTF-8
24
+ - text/json
25
25
  Date:
26
- - Mon, 17 Nov 2014 18:26:51 GMT
27
- Server:
28
- - dogdispatcher/6.0.12
26
+ - Mon, 11 Apr 2016 17:56:11 GMT
27
+ Dd-Pool:
28
+ - propjoe
29
29
  Strict-Transport-Security:
30
30
  - max-age=15724800;
31
+ X-Content-Type-Options:
32
+ - nosniff
31
33
  Content-Length:
32
- - '15'
34
+ - '16'
33
35
  Connection:
34
36
  - keep-alive
35
37
  body:
36
38
  encoding: UTF-8
37
- string: '{"status":"ok"}'
39
+ string: '{"status": "ok"}'
38
40
  http_version:
39
- recorded_at: Mon, 17 Nov 2014 18:26:51 GMT
41
+ recorded_at: Mon, 11 Apr 2016 17:56:11 GMT
40
42
  - request:
41
43
  method: delete
42
- uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
44
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=<DATADOG_API_KEY>&application_key=<DATADOG_APP_KEY>
43
45
  body:
44
46
  encoding: US-ASCII
45
47
  string: ''
@@ -47,7 +49,7 @@ http_interactions:
47
49
  Accept-Encoding:
48
50
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
49
51
  Accept:
50
- - '*/*'
52
+ - "*/*"
51
53
  User-Agent:
52
54
  - Ruby
53
55
  response:
@@ -62,25 +64,33 @@ http_interactions:
62
64
  Content-Type:
63
65
  - application/json
64
66
  Date:
65
- - Mon, 17 Nov 2014 18:26:56 GMT
67
+ - Mon, 11 Apr 2016 17:56:21 GMT
68
+ Dd-Pool:
69
+ - dogweb_sameorig
66
70
  Pragma:
67
71
  - no-cache
68
- Server:
69
- - gunicorn/19.1.0
72
+ Set-Cookie:
73
+ - DD-PSHARD=0; expires="Mon, 18-Apr-2016 17:56:21 GMT"; Max-Age=604800; Path=/
70
74
  Strict-Transport-Security:
71
75
  - max-age=15724800;
76
+ X-Content-Type-Options:
77
+ - nosniff
78
+ X-Dd-Debug:
79
+ - Q7aBYzHHllsXmnqYXTRnBui4yUFIlE4QkBCcKXhPzNs=
72
80
  X-Dd-Version:
73
- - 31.1883.245-0
81
+ - '33.3404'
82
+ X-Frame-Options:
83
+ - SAMEORIGIN
74
84
  Connection:
75
85
  - keep-alive
76
86
  body:
77
87
  encoding: UTF-8
78
88
  string: ''
79
89
  http_version:
80
- recorded_at: Mon, 17 Nov 2014 18:26:56 GMT
90
+ recorded_at: Mon, 11 Apr 2016 17:56:21 GMT
81
91
  - request:
82
92
  method: get
83
- uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
93
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=<DATADOG_API_KEY>&application_key=<DATADOG_APP_KEY>
84
94
  body:
85
95
  encoding: US-ASCII
86
96
  string: ''
@@ -88,7 +98,7 @@ http_interactions:
88
98
  Accept-Encoding:
89
99
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
90
100
  Accept:
91
- - '*/*'
101
+ - "*/*"
92
102
  User-Agent:
93
103
  - Ruby
94
104
  response:
@@ -101,15 +111,23 @@ http_interactions:
101
111
  Content-Type:
102
112
  - application/json
103
113
  Date:
104
- - Mon, 17 Nov 2014 18:26:56 GMT
114
+ - Mon, 11 Apr 2016 17:56:22 GMT
115
+ Dd-Pool:
116
+ - dogweb_sameorig
105
117
  Pragma:
106
118
  - no-cache
107
- Server:
108
- - gunicorn/19.1.0
119
+ Set-Cookie:
120
+ - DD-PSHARD=0; expires="Mon, 18-Apr-2016 17:56:22 GMT"; Max-Age=604800; Path=/
109
121
  Strict-Transport-Security:
110
122
  - max-age=15724800;
123
+ X-Content-Type-Options:
124
+ - nosniff
125
+ X-Dd-Debug:
126
+ - dzXYMfoU4q3VT0cFBUpsrrkUExtYDwvMMuX3a9VAyzA=
111
127
  X-Dd-Version:
112
- - 31.1883.245-0
128
+ - '33.3404'
129
+ X-Frame-Options:
130
+ - SAMEORIGIN
113
131
  Content-Length:
114
132
  - '12'
115
133
  Connection:
@@ -118,10 +136,10 @@ http_interactions:
118
136
  encoding: UTF-8
119
137
  string: '{"tags": []}'
120
138
  http_version:
121
- recorded_at: Mon, 17 Nov 2014 18:26:56 GMT
139
+ recorded_at: Mon, 11 Apr 2016 17:56:22 GMT
122
140
  - request:
123
141
  method: post
124
- uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
142
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=<DATADOG_API_KEY>&application_key=<DATADOG_APP_KEY>
125
143
  body:
126
144
  encoding: UTF-8
127
145
  string: '{"tags":["test.tag.1","test.tag.2"]}'
@@ -129,7 +147,7 @@ http_interactions:
129
147
  Accept-Encoding:
130
148
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
131
149
  Accept:
132
- - '*/*'
150
+ - "*/*"
133
151
  User-Agent:
134
152
  - Ruby
135
153
  Content-Type:
@@ -144,15 +162,23 @@ http_interactions:
144
162
  Content-Type:
145
163
  - application/json
146
164
  Date:
147
- - Mon, 17 Nov 2014 18:26:56 GMT
165
+ - Mon, 11 Apr 2016 17:56:22 GMT
166
+ Dd-Pool:
167
+ - dogweb_sameorig
148
168
  Pragma:
149
169
  - no-cache
150
- Server:
151
- - gunicorn/19.1.0
170
+ Set-Cookie:
171
+ - DD-PSHARD=0; expires="Mon, 18-Apr-2016 17:56:22 GMT"; Max-Age=604800; Path=/
152
172
  Strict-Transport-Security:
153
173
  - max-age=15724800;
174
+ X-Content-Type-Options:
175
+ - nosniff
176
+ X-Dd-Debug:
177
+ - MIdc/CQwmTXk1Lah/1lXbujR7+lOMI0VokxaEpQGrUw=
154
178
  X-Dd-Version:
155
- - 31.1883.245-0
179
+ - '33.3404'
180
+ X-Frame-Options:
181
+ - SAMEORIGIN
156
182
  Content-Length:
157
183
  - '63'
158
184
  Connection:
@@ -161,10 +187,10 @@ http_interactions:
161
187
  encoding: UTF-8
162
188
  string: '{"host": "test.tag.host", "tags": ["test.tag.2", "test.tag.1"]}'
163
189
  http_version:
164
- recorded_at: Mon, 17 Nov 2014 18:26:57 GMT
190
+ recorded_at: Mon, 11 Apr 2016 17:56:22 GMT
165
191
  - request:
166
192
  method: get
167
- uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
193
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=<DATADOG_API_KEY>&application_key=<DATADOG_APP_KEY>
168
194
  body:
169
195
  encoding: US-ASCII
170
196
  string: ''
@@ -172,7 +198,7 @@ http_interactions:
172
198
  Accept-Encoding:
173
199
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
174
200
  Accept:
175
- - '*/*'
201
+ - "*/*"
176
202
  User-Agent:
177
203
  - Ruby
178
204
  response:
@@ -185,17 +211,25 @@ http_interactions:
185
211
  Content-Type:
186
212
  - application/json
187
213
  Date:
188
- - Mon, 17 Nov 2014 18:26:57 GMT
214
+ - Mon, 11 Apr 2016 17:56:22 GMT
215
+ Dd-Pool:
216
+ - dogweb_sameorig
189
217
  Pragma:
190
218
  - no-cache
191
- Server:
192
- - gunicorn/19.1.0
219
+ Set-Cookie:
220
+ - DD-PSHARD=0; expires="Mon, 18-Apr-2016 17:56:22 GMT"; Max-Age=604800; Path=/
193
221
  Strict-Transport-Security:
194
222
  - max-age=15724800;
195
223
  Vary:
196
224
  - Accept-Encoding
225
+ X-Content-Type-Options:
226
+ - nosniff
227
+ X-Dd-Debug:
228
+ - eI0fWTxl6lKLmNakO6G9P/2RveEEWg/lRpRy9/lv8MQ=
197
229
  X-Dd-Version:
198
- - 31.1883.245-0
230
+ - '33.3404'
231
+ X-Frame-Options:
232
+ - SAMEORIGIN
199
233
  Content-Length:
200
234
  - '48'
201
235
  Connection:
@@ -204,10 +238,10 @@ http_interactions:
204
238
  encoding: UTF-8
205
239
  string: '{"tags": ["test.tag.2", "test.tag.1"]}'
206
240
  http_version:
207
- recorded_at: Mon, 17 Nov 2014 18:26:57 GMT
241
+ recorded_at: Mon, 11 Apr 2016 17:56:22 GMT
208
242
  - request:
209
243
  method: post
210
- uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
244
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=<DATADOG_API_KEY>&application_key=<DATADOG_APP_KEY>
211
245
  body:
212
246
  encoding: UTF-8
213
247
  string: '{"tags":["test.tag.3"]}'
@@ -215,7 +249,7 @@ http_interactions:
215
249
  Accept-Encoding:
216
250
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
217
251
  Accept:
218
- - '*/*'
252
+ - "*/*"
219
253
  User-Agent:
220
254
  - Ruby
221
255
  Content-Type:
@@ -230,15 +264,23 @@ http_interactions:
230
264
  Content-Type:
231
265
  - application/json
232
266
  Date:
233
- - Mon, 17 Nov 2014 18:26:57 GMT
267
+ - Mon, 11 Apr 2016 17:56:23 GMT
268
+ Dd-Pool:
269
+ - dogweb_sameorig
234
270
  Pragma:
235
271
  - no-cache
236
- Server:
237
- - gunicorn/19.1.0
272
+ Set-Cookie:
273
+ - DD-PSHARD=0; expires="Mon, 18-Apr-2016 17:56:22 GMT"; Max-Age=604800; Path=/
238
274
  Strict-Transport-Security:
239
275
  - max-age=15724800;
276
+ X-Content-Type-Options:
277
+ - nosniff
278
+ X-Dd-Debug:
279
+ - RlyQtDX9W/oMpkQZZjcoqOBiatUP2GiWyxgzdIMrWuU=
240
280
  X-Dd-Version:
241
- - 31.1883.245-0
281
+ - '33.3404'
282
+ X-Frame-Options:
283
+ - SAMEORIGIN
242
284
  Content-Length:
243
285
  - '77'
244
286
  Connection:
@@ -247,10 +289,10 @@ http_interactions:
247
289
  encoding: UTF-8
248
290
  string: '{"host": "test.tag.host", "tags": ["test.tag.2", "test.tag.3", "test.tag.1"]}'
249
291
  http_version:
250
- recorded_at: Mon, 17 Nov 2014 18:26:57 GMT
292
+ recorded_at: Mon, 11 Apr 2016 17:56:23 GMT
251
293
  - request:
252
294
  method: get
253
- uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
295
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=<DATADOG_API_KEY>&application_key=<DATADOG_APP_KEY>
254
296
  body:
255
297
  encoding: US-ASCII
256
298
  string: ''
@@ -258,7 +300,7 @@ http_interactions:
258
300
  Accept-Encoding:
259
301
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
260
302
  Accept:
261
- - '*/*'
303
+ - "*/*"
262
304
  User-Agent:
263
305
  - Ruby
264
306
  response:
@@ -271,17 +313,25 @@ http_interactions:
271
313
  Content-Type:
272
314
  - application/json
273
315
  Date:
274
- - Mon, 17 Nov 2014 18:26:57 GMT
316
+ - Mon, 11 Apr 2016 17:56:23 GMT
317
+ Dd-Pool:
318
+ - dogweb_sameorig
275
319
  Pragma:
276
320
  - no-cache
277
- Server:
278
- - gunicorn/19.1.0
321
+ Set-Cookie:
322
+ - DD-PSHARD=0; expires="Mon, 18-Apr-2016 17:56:23 GMT"; Max-Age=604800; Path=/
279
323
  Strict-Transport-Security:
280
324
  - max-age=15724800;
281
325
  Vary:
282
326
  - Accept-Encoding
327
+ X-Content-Type-Options:
328
+ - nosniff
329
+ X-Dd-Debug:
330
+ - B2DpeiArkz14rllWI622s7wjvWckEq5WuxOA4oijqwI=
283
331
  X-Dd-Version:
284
- - 31.1883.245-0
332
+ - '33.3404'
333
+ X-Frame-Options:
334
+ - SAMEORIGIN
285
335
  Content-Length:
286
336
  - '51'
287
337
  Connection:
@@ -290,10 +340,10 @@ http_interactions:
290
340
  encoding: UTF-8
291
341
  string: '{"tags": ["test.tag.2", "test.tag.3", "test.tag.1"]}'
292
342
  http_version:
293
- recorded_at: Mon, 17 Nov 2014 18:26:57 GMT
343
+ recorded_at: Mon, 11 Apr 2016 17:56:23 GMT
294
344
  - request:
295
345
  method: delete
296
- uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
346
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=<DATADOG_API_KEY>&application_key=<DATADOG_APP_KEY>
297
347
  body:
298
348
  encoding: US-ASCII
299
349
  string: ''
@@ -301,7 +351,7 @@ http_interactions:
301
351
  Accept-Encoding:
302
352
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
303
353
  Accept:
304
- - '*/*'
354
+ - "*/*"
305
355
  User-Agent:
306
356
  - Ruby
307
357
  response:
@@ -316,25 +366,33 @@ http_interactions:
316
366
  Content-Type:
317
367
  - application/json
318
368
  Date:
319
- - Mon, 17 Nov 2014 18:26:57 GMT
369
+ - Mon, 11 Apr 2016 17:56:24 GMT
370
+ Dd-Pool:
371
+ - dogweb_sameorig
320
372
  Pragma:
321
373
  - no-cache
322
- Server:
323
- - gunicorn/19.1.0
374
+ Set-Cookie:
375
+ - DD-PSHARD=0; expires="Mon, 18-Apr-2016 17:56:23 GMT"; Max-Age=604800; Path=/
324
376
  Strict-Transport-Security:
325
377
  - max-age=15724800;
378
+ X-Content-Type-Options:
379
+ - nosniff
380
+ X-Dd-Debug:
381
+ - u7dUbT/JdTcUwf46Xq6Rp9y7LQHfqCh/ybJrMEoYyOs=
326
382
  X-Dd-Version:
327
- - 31.1883.245-0
383
+ - '33.3404'
384
+ X-Frame-Options:
385
+ - SAMEORIGIN
328
386
  Connection:
329
387
  - keep-alive
330
388
  body:
331
389
  encoding: UTF-8
332
390
  string: ''
333
391
  http_version:
334
- recorded_at: Mon, 17 Nov 2014 18:26:57 GMT
392
+ recorded_at: Mon, 11 Apr 2016 17:56:24 GMT
335
393
  - request:
336
394
  method: get
337
- uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
395
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=<DATADOG_API_KEY>&application_key=<DATADOG_APP_KEY>
338
396
  body:
339
397
  encoding: US-ASCII
340
398
  string: ''
@@ -342,7 +400,7 @@ http_interactions:
342
400
  Accept-Encoding:
343
401
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
344
402
  Accept:
345
- - '*/*'
403
+ - "*/*"
346
404
  User-Agent:
347
405
  - Ruby
348
406
  response:
@@ -355,15 +413,23 @@ http_interactions:
355
413
  Content-Type:
356
414
  - application/json
357
415
  Date:
358
- - Mon, 17 Nov 2014 18:26:58 GMT
416
+ - Mon, 11 Apr 2016 17:56:24 GMT
417
+ Dd-Pool:
418
+ - dogweb_sameorig
359
419
  Pragma:
360
420
  - no-cache
361
- Server:
362
- - gunicorn/19.1.0
421
+ Set-Cookie:
422
+ - DD-PSHARD=0; expires="Mon, 18-Apr-2016 17:56:24 GMT"; Max-Age=604800; Path=/
363
423
  Strict-Transport-Security:
364
424
  - max-age=15724800;
425
+ X-Content-Type-Options:
426
+ - nosniff
427
+ X-Dd-Debug:
428
+ - VVb9PTrXTexlsgMglysHoi+NfsNQ6yOwNcwZLsurLAw=
365
429
  X-Dd-Version:
366
- - 31.1883.245-0
430
+ - '33.3404'
431
+ X-Frame-Options:
432
+ - SAMEORIGIN
367
433
  Content-Length:
368
434
  - '12'
369
435
  Connection:
@@ -372,5 +438,5 @@ http_interactions:
372
438
  encoding: UTF-8
373
439
  string: '{"tags": []}'
374
440
  http_version:
375
- recorded_at: Mon, 17 Nov 2014 18:26:58 GMT
441
+ recorded_at: Mon, 11 Apr 2016 17:56:24 GMT
376
442
  recorded_with: VCR 2.9.3
@@ -2,7 +2,7 @@ require 'dogapi'
2
2
  require 'time'
3
3
  require 'test_base.rb'
4
4
 
5
- class TestAlerts < Test::Unit::TestCase
5
+ class TestAlerts < Minitest::Test
6
6
  include TestBase
7
7
 
8
8
  def test_alerts
@@ -1,4 +1,4 @@
1
- require 'test/unit'
1
+ require 'minitest/autorun'
2
2
  require 'dogapi'
3
3
  require 'time'
4
4