dogapi 1.21.0 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -1,143 +1,18 @@
1
1
  ---
2
2
  http_interactions:
3
- - request:
4
- method: get
5
- uri: https://app.datadoghq.com/api/v1/events/1905040728720298327?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
6
- body:
7
- encoding: UTF-8
8
- string: ''
9
- headers:
10
- Accept:
11
- - '*/*'
12
- response:
13
- status:
14
- code: 200
15
- message: OK
16
- headers:
17
- Content-Length:
18
- - '367'
19
- Cache-Control:
20
- - no-cache
21
- Content-Type:
22
- - application/json
23
- X-Dd-Version:
24
- - 31.160-300-bedcb85
25
- Set-Cookie:
26
- - user={"org":{"id":1499},"_type":"User","id":3658}; Path=/
27
- Server:
28
- - gunicorn/0.17.4
29
- Connection:
30
- - keep-alive
31
- Pragma:
32
- - no-cache
33
- Date:
34
- - Thu, 29 Aug 2013 21:35:47 GMT
35
- body:
36
- encoding: UTF-8
37
- string: '{"event": {"date_happened": 1377812141, "alert_type": "info", "resource":
38
- "/api/v1/events/1905040728720298327", "title": "dogapi-rb end test title 1377812141",
39
- "url": "/event/jump_to?event_id=1905040728720298327", "text": "test message",
40
- "tags": ["test-run:1"], "id": 1905040728720298327, "priority": "normal", "host":
41
- "dogbox", "device_name": null, "payload": "{}"}}'
42
- http_version:
43
- recorded_at: Thu, 29 Aug 2013 21:35:46 GMT
44
- - request:
45
- method: get
46
- uri: https://app.datadoghq.com/api/v1/events/2270123736026243269?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
47
- body:
48
- encoding: US-ASCII
49
- string: ''
50
- headers:
51
- Accept:
52
- - '*/*'
53
- User-Agent:
54
- - Ruby
55
- response:
56
- status:
57
- code: 404
58
- message: Not Found
59
- headers:
60
- Cache-Control:
61
- - no-cache
62
- Content-Type:
63
- - application/json
64
- Date:
65
- - Thu, 08 May 2014 18:13:05 GMT
66
- Pragma:
67
- - no-cache
68
- Server:
69
- - gunicorn/0.17.4
70
- Set-Cookie:
71
- - user={"org":{"id":1499,"time_zone":null},"_type":"User","id":3658,"time_zone":null};
72
- Path=/
73
- X-Dd-Version:
74
- - 31.1102.1335-0
75
- Content-Length:
76
- - '49'
77
- Connection:
78
- - keep-alive
79
- body:
80
- encoding: US-ASCII
81
- string: '{"errors": ["No event matches that comment_id."]}'
82
- http_version:
83
- recorded_at: Thu, 08 May 2014 18:08:42 GMT
84
- - request:
85
- method: get
86
- uri: https://app.datadoghq.com/api/v1/events/2277466975478186943?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
87
- body:
88
- encoding: US-ASCII
89
- string: ''
90
- headers:
91
- Accept:
92
- - '*/*'
93
- User-Agent:
94
- - Ruby
95
- response:
96
- status:
97
- code: 200
98
- message: OK
99
- headers:
100
- Cache-Control:
101
- - no-cache
102
- Content-Type:
103
- - application/json
104
- Date:
105
- - Tue, 13 May 2014 19:48:01 GMT
106
- Pragma:
107
- - no-cache
108
- Server:
109
- - gunicorn/0.17.4
110
- Set-Cookie:
111
- - user={"org":{"id":1499,"time_zone":null},"_type":"User","id":3658,"time_zone":null};
112
- Path=/
113
- X-Dd-Version:
114
- - 31.1129.1362-0
115
- Content-Length:
116
- - '377'
117
- Connection:
118
- - keep-alive
119
- body:
120
- encoding: US-ASCII
121
- string: '{"event": {"date_happened": 1400010475, "alert_type": "info", "resource":
122
- "/api/v1/events/2277466975478186943", "title": "dogapi-rb end test title 1400010475",
123
- "url": "/event/jump_to?event_id=2277466975478186943", "text": "test message",
124
- "tags": ["test-run:carlo"], "id": 2277466975478186943, "priority": "normal",
125
- "host": "dogbox-carlo", "device_name": null, "payload": "{}"}}'
126
- http_version:
127
- recorded_at: Tue, 13 May 2014 19:48:01 GMT
128
3
  - request:
129
4
  method: post
130
- uri: https://app.datadoghq.com/api/v1/events?api_key=9775a026f1ca7d1c6c5af9d94d9595a4
5
+ uri: https://app.datadoghq.com/api/v1/events?api_key=<DATADOG_API_KEY>
131
6
  body:
132
7
  encoding: UTF-8
133
- string: '{"msg_text":"test message","date_happened":1416248793,"msg_title":"dogapi-rb
134
- end test title 1416248793","priority":"normal","parent":null,"tags":["test-run:1"],"aggregation_key":"","alert_type":null,"event_type":null,"source_type_name":null,"title":"dogapi-rb
135
- end test title 1416248793","text":"test message","host":"Conors-MacBook-Pro-Retina.local","device":null}'
8
+ string: '{"msg_text":"test message","date_happened":1460397401,"msg_title":"dogapi-rb
9
+ end test title 1460397401","priority":"normal","parent":null,"tags":["test-run:1"],"aggregation_key":"","alert_type":null,"event_type":null,"source_type_name":null,"title":"dogapi-rb
10
+ end test title 1460397401","text":"test message","host":"dogbox-yannmahe","device":null}'
136
11
  headers:
137
12
  Accept-Encoding:
138
13
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
139
14
  Accept:
140
- - '*/*'
15
+ - "*/*"
141
16
  User-Agent:
142
17
  - Ruby
143
18
  Content-Type:
@@ -148,28 +23,28 @@ http_interactions:
148
23
  message: Accepted
149
24
  headers:
150
25
  Content-Type:
151
- - text/json; charset=UTF-8
26
+ - text/plain; charset=utf-8
152
27
  Date:
153
- - Mon, 17 Nov 2014 18:26:33 GMT
154
- Server:
155
- - dogdispatcher/6.0.12
28
+ - Mon, 11 Apr 2016 17:56:41 GMT
29
+ Dd-Pool:
30
+ - propjoe
156
31
  Strict-Transport-Security:
157
32
  - max-age=15724800;
33
+ X-Content-Type-Options:
34
+ - nosniff
158
35
  Content-Length:
159
- - '322'
36
+ - '292'
160
37
  Connection:
161
38
  - keep-alive
162
39
  body:
163
40
  encoding: UTF-8
164
- string: '{"status": "ok", "event": {"priority": "normal", "date_happened": 1416248793,
165
- "handle": null, "title": "dogapi-rb end test title 1416248793", "url": "https://app.datadoghq.com/event/jump_to?event_id=2549900732480976038",
166
- "text": "test message", "tags": ["test-run:1"], "related_event_id": null,
167
- "id": 2549900732480976038}}'
41
+ string: '{"status":"ok","event":{"id":491274007246737761,"title":"dogapi-rb
42
+ end test title 1460397401","text":"test message","date_happened":1460397401,"handle":null,"priority":"normal","related_event_id":null,"tags":["test-run:1"],"url":"https://app.datadoghq.com/event/event?id=491274007246737761"}}'
168
43
  http_version:
169
- recorded_at: Mon, 17 Nov 2014 18:26:33 GMT
44
+ recorded_at: Mon, 11 Apr 2016 17:56:41 GMT
170
45
  - request:
171
46
  method: get
172
- uri: https://app.datadoghq.com/api/v1/events/2549900732480976038?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
47
+ uri: https://app.datadoghq.com/api/v1/events/491274007246737761?api_key=<DATADOG_API_KEY>&application_key=<DATADOG_APP_KEY>
173
48
  body:
174
49
  encoding: US-ASCII
175
50
  string: ''
@@ -177,7 +52,7 @@ http_interactions:
177
52
  Accept-Encoding:
178
53
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
179
54
  Accept:
180
- - '*/*'
55
+ - "*/*"
181
56
  User-Agent:
182
57
  - Ruby
183
58
  response:
@@ -190,28 +65,36 @@ http_interactions:
190
65
  Content-Type:
191
66
  - application/json
192
67
  Date:
193
- - Mon, 17 Nov 2014 18:26:41 GMT
68
+ - Mon, 11 Apr 2016 17:56:52 GMT
69
+ Dd-Pool:
70
+ - dogweb_sameorig
194
71
  Pragma:
195
72
  - no-cache
196
- Server:
197
- - gunicorn/19.1.0
73
+ Set-Cookie:
74
+ - DD-PSHARD=0; expires="Mon, 18-Apr-2016 17:56:51 GMT"; Max-Age=604800; Path=/
198
75
  Strict-Transport-Security:
199
76
  - max-age=15724800;
200
77
  Vary:
201
78
  - Accept-Encoding
79
+ X-Content-Type-Options:
80
+ - nosniff
81
+ X-Dd-Debug:
82
+ - 5PF/Z5LFS2+PDopAy61C4pggyl02rZxZk412h3D879s=
202
83
  X-Dd-Version:
203
- - 31.1883.245-0
84
+ - '33.3404'
85
+ X-Frame-Options:
86
+ - SAMEORIGIN
204
87
  Content-Length:
205
- - '263'
88
+ - '234'
206
89
  Connection:
207
90
  - keep-alive
208
91
  body:
209
92
  encoding: UTF-8
210
- string: '{"event": {"date_happened": 1416248793, "alert_type": "info", "resource":
211
- "/api/v1/events/2549900732480976038", "title": "dogapi-rb end test title 1416248793",
212
- "url": "/event/jump_to?event_id=2549900732480976038", "text": "test message",
213
- "tags": ["test-run:1"], "id": 2549900732480976038, "priority": "normal", "host":
214
- "Conors-MacBook-Pro-Retina.local", "device_name": null, "payload": "{}"}}'
93
+ string: '{"event": {"date_happened": 1460397401, "alert_type": "info", "resource":
94
+ "/api/v1/events/491274007246737761", "title": "dogapi-rb end test title 1460397401",
95
+ "url": "/event/event?event_id=491274007246737761", "text": "test message",
96
+ "tags": ["test-run:1"], "device_name": null, "priority": "normal", "host":
97
+ "dogbox-yannmahe", "id": 491274007246737761}}'
215
98
  http_version:
216
- recorded_at: Mon, 17 Nov 2014 18:26:41 GMT
99
+ recorded_at: Mon, 11 Apr 2016 17:56:52 GMT
217
100
  recorded_with: VCR 2.9.3
@@ -1,140 +1,17 @@
1
1
  ---
2
2
  http_interactions:
3
- - request:
4
- method: get
5
- uri: https://app.datadoghq.com/api/v1/events/1905050031133446537?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
6
- body:
7
- encoding: UTF-8
8
- string: ''
9
- headers:
10
- Accept:
11
- - '*/*'
12
- response:
13
- status:
14
- code: 200
15
- message: OK
16
- headers:
17
- Date:
18
- - Thu, 29 Aug 2013 21:54:11 GMT
19
- Set-Cookie:
20
- - user={"org":{"id":1499},"_type":"User","id":3658}; Path=/
21
- Server:
22
- - gunicorn/0.17.4
23
- Content-Length:
24
- - '322'
25
- Content-Type:
26
- - application/json
27
- Pragma:
28
- - no-cache
29
- Connection:
30
- - keep-alive
31
- X-Dd-Version:
32
- - 31.160-300-bedcb85
33
- Cache-Control:
34
- - no-cache
35
- body:
36
- encoding: UTF-8
37
- string: '{"event": {"date_happened": 1377812695, "alert_type": "info", "resource":
38
- "/api/v1/events/1905050031133446537", "title": "title", "url": "/event/jump_to?event_id=1905050031133446537",
39
- "text": "test message", "tags": [], "id": 1905050031133446537, "priority":
40
- "low", "host": "dogbox", "device_name": null, "payload": "{}"}}'
41
- http_version:
42
- recorded_at: Thu, 29 Aug 2013 21:54:11 GMT
43
- - request:
44
- method: get
45
- uri: https://app.datadoghq.com/api/v1/events/2270123722067656874?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
46
- body:
47
- encoding: US-ASCII
48
- string: ''
49
- headers:
50
- Accept:
51
- - '*/*'
52
- User-Agent:
53
- - Ruby
54
- response:
55
- status:
56
- code: 404
57
- message: Not Found
58
- headers:
59
- Cache-Control:
60
- - no-cache
61
- Content-Type:
62
- - application/json
63
- Date:
64
- - Thu, 08 May 2014 18:13:04 GMT
65
- Pragma:
66
- - no-cache
67
- Server:
68
- - gunicorn/0.17.4
69
- Set-Cookie:
70
- - user={"org":{"id":1499,"time_zone":null},"_type":"User","id":3658,"time_zone":null};
71
- Path=/
72
- X-Dd-Version:
73
- - 31.1104.1337
74
- Content-Length:
75
- - '49'
76
- Connection:
77
- - keep-alive
78
- body:
79
- encoding: US-ASCII
80
- string: '{"errors": ["No event matches that comment_id."]}'
81
- http_version:
82
- recorded_at: Thu, 08 May 2014 18:08:41 GMT
83
- - request:
84
- method: get
85
- uri: https://app.datadoghq.com/api/v1/events/2277466877264261870?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
86
- body:
87
- encoding: US-ASCII
88
- string: ''
89
- headers:
90
- Accept:
91
- - '*/*'
92
- User-Agent:
93
- - Ruby
94
- response:
95
- status:
96
- code: 200
97
- message: OK
98
- headers:
99
- Cache-Control:
100
- - no-cache
101
- Content-Type:
102
- - application/json
103
- Date:
104
- - Tue, 13 May 2014 19:47:55 GMT
105
- Pragma:
106
- - no-cache
107
- Server:
108
- - gunicorn/0.17.4
109
- Set-Cookie:
110
- - user={"org":{"id":1499,"time_zone":null},"_type":"User","id":3658,"time_zone":null};
111
- Path=/
112
- X-Dd-Version:
113
- - 31.1129.1362-0
114
- Content-Length:
115
- - '328'
116
- Connection:
117
- - keep-alive
118
- body:
119
- encoding: US-ASCII
120
- string: '{"event": {"date_happened": 1400010467, "alert_type": "info", "resource":
121
- "/api/v1/events/2277466877264261870", "title": "title", "url": "/event/jump_to?event_id=2277466877264261870",
122
- "text": "test message", "tags": [], "id": 2277466877264261870, "priority":
123
- "low", "host": "dogbox-carlo", "device_name": null, "payload": "{}"}}'
124
- http_version:
125
- recorded_at: Tue, 13 May 2014 19:47:55 GMT
126
3
  - request:
127
4
  method: post
128
- uri: https://app.datadoghq.com/api/v1/events?api_key=9775a026f1ca7d1c6c5af9d94d9595a4
5
+ uri: https://app.datadoghq.com/api/v1/events?api_key=<DATADOG_API_KEY>
129
6
  body:
130
7
  encoding: UTF-8
131
- string: '{"msg_text":"test message","date_happened":1416248784,"msg_title":"title","priority":"low","parent":null,"tags":[],"aggregation_key":"","alert_type":null,"event_type":null,"source_type_name":null,"title":"title","text":"test
132
- message","host":"Conors-MacBook-Pro-Retina.local","device":null}'
8
+ string: '{"msg_text":"test message","date_happened":1460397393,"msg_title":"title","priority":"low","parent":null,"tags":[],"aggregation_key":"","alert_type":null,"event_type":null,"source_type_name":null,"title":"title","text":"test
9
+ message","host":"dogbox-yannmahe","device":null}'
133
10
  headers:
134
11
  Accept-Encoding:
135
12
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
136
13
  Accept:
137
- - '*/*'
14
+ - "*/*"
138
15
  User-Agent:
139
16
  - Ruby
140
17
  Content-Type:
@@ -145,27 +22,28 @@ http_interactions:
145
22
  message: Accepted
146
23
  headers:
147
24
  Content-Type:
148
- - text/json; charset=UTF-8
25
+ - text/plain; charset=utf-8
149
26
  Date:
150
- - Mon, 17 Nov 2014 18:26:24 GMT
151
- Server:
152
- - dogdispatcher/6.0.12
27
+ - Mon, 11 Apr 2016 17:56:33 GMT
28
+ Dd-Pool:
29
+ - propjoe
153
30
  Strict-Transport-Security:
154
31
  - max-age=15724800;
32
+ X-Content-Type-Options:
33
+ - nosniff
155
34
  Content-Length:
156
- - '277'
35
+ - '247'
157
36
  Connection:
158
37
  - keep-alive
159
38
  body:
160
39
  encoding: UTF-8
161
- string: '{"status": "ok", "event": {"priority": "low", "date_happened": 1416248784,
162
- "handle": null, "title": "title", "url": "https://app.datadoghq.com/event/jump_to?event_id=2549900588599571577",
163
- "text": "test message", "tags": [], "related_event_id": null, "id": 2549900588599571577}}'
40
+ string: '{"status":"ok","event":{"id":491273867291425124,"title":"title","text":"test
41
+ message","date_happened":1460397393,"handle":null,"priority":"low","related_event_id":null,"tags":[],"url":"https://app.datadoghq.com/event/event?id=491273867291425124"}}'
164
42
  http_version:
165
- recorded_at: Mon, 17 Nov 2014 18:26:24 GMT
43
+ recorded_at: Mon, 11 Apr 2016 17:56:33 GMT
166
44
  - request:
167
45
  method: get
168
- uri: https://app.datadoghq.com/api/v1/events/2549900588599571577?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
46
+ uri: https://app.datadoghq.com/api/v1/events/491273867291425124?api_key=<DATADOG_API_KEY>&application_key=<DATADOG_APP_KEY>
169
47
  body:
170
48
  encoding: US-ASCII
171
49
  string: ''
@@ -173,7 +51,7 @@ http_interactions:
173
51
  Accept-Encoding:
174
52
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
175
53
  Accept:
176
- - '*/*'
54
+ - "*/*"
177
55
  User-Agent:
178
56
  - Ruby
179
57
  response:
@@ -186,28 +64,35 @@ http_interactions:
186
64
  Content-Type:
187
65
  - application/json
188
66
  Date:
189
- - Mon, 17 Nov 2014 18:26:33 GMT
67
+ - Mon, 11 Apr 2016 17:56:41 GMT
68
+ Dd-Pool:
69
+ - dogweb_sameorig
190
70
  Pragma:
191
71
  - no-cache
192
- Server:
193
- - gunicorn/19.1.0
72
+ Set-Cookie:
73
+ - DD-PSHARD=0; expires="Mon, 18-Apr-2016 17:56:41 GMT"; Max-Age=604800; Path=/
194
74
  Strict-Transport-Security:
195
75
  - max-age=15724800;
196
76
  Vary:
197
77
  - Accept-Encoding
78
+ X-Content-Type-Options:
79
+ - nosniff
80
+ X-Dd-Debug:
81
+ - 74ZP/FagkgUH/fXz7TfrZdZNnEK/HFHV0fuIAe/vcZE=
198
82
  X-Dd-Version:
199
- - 31.1883.245-0
83
+ - '33.3404'
84
+ X-Frame-Options:
85
+ - SAMEORIGIN
200
86
  Content-Length:
201
- - '243'
87
+ - '213'
202
88
  Connection:
203
89
  - keep-alive
204
90
  body:
205
91
  encoding: UTF-8
206
- string: '{"event": {"date_happened": 1416248784, "alert_type": "info", "resource":
207
- "/api/v1/events/2549900588599571577", "title": "title", "url": "/event/jump_to?event_id=2549900588599571577",
208
- "text": "test message", "tags": [], "id": 2549900588599571577, "priority":
209
- "low", "host": "Conors-MacBook-Pro-Retina.local", "device_name": null, "payload":
210
- "{}"}}'
92
+ string: '{"event": {"date_happened": 1460397393, "alert_type": "info", "resource":
93
+ "/api/v1/events/491273867291425124", "title": "title", "url": "/event/event?event_id=491273867291425124",
94
+ "text": "test message", "tags": [], "device_name": null, "priority": "low",
95
+ "host": "dogbox-yannmahe", "id": 491273867291425124}}'
211
96
  http_version:
212
- recorded_at: Mon, 17 Nov 2014 18:26:33 GMT
97
+ recorded_at: Mon, 11 Apr 2016 17:56:41 GMT
213
98
  recorded_with: VCR 2.9.3