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
|
response:
|
13
13
|
status:
|
14
14
|
code: 200
|
@@ -34,7 +34,7 @@ http_interactions:
|
|
34
34
|
- no-cache
|
35
35
|
body:
|
36
36
|
encoding: UTF-8
|
37
|
-
string:
|
37
|
+
string: '{"event": {"date_happened": 1377812695, "alert_type": "info", "resource":
|
38
38
|
"/api/v1/events/1905050031133446537", "title": "title", "url": "/event/jump_to?event_id=1905050031133446537",
|
39
39
|
"text": "test message", "tags": [], "id": 1905050031133446537, "priority":
|
40
40
|
"low", "host": "dogbox", "device_name": null, "payload": "{}"}}'
|
@@ -48,7 +48,7 @@ http_interactions:
|
|
48
48
|
string: ''
|
49
49
|
headers:
|
50
50
|
Accept:
|
51
|
-
-
|
51
|
+
- '*/*'
|
52
52
|
User-Agent:
|
53
53
|
- Ruby
|
54
54
|
response:
|
@@ -77,19 +77,64 @@ http_interactions:
|
|
77
77
|
- keep-alive
|
78
78
|
body:
|
79
79
|
encoding: US-ASCII
|
80
|
-
string:
|
80
|
+
string: '{"errors": ["No event matches that comment_id."]}'
|
81
81
|
http_version:
|
82
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
|
83
126
|
- request:
|
84
127
|
method: post
|
85
128
|
uri: https://app.datadoghq.com/api/v1/events?api_key=9775a026f1ca7d1c6c5af9d94d9595a4
|
86
129
|
body:
|
87
130
|
encoding: UTF-8
|
88
|
-
string:
|
89
|
-
message","host":"
|
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}'
|
90
133
|
headers:
|
134
|
+
Accept-Encoding:
|
135
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
91
136
|
Accept:
|
92
|
-
-
|
137
|
+
- '*/*'
|
93
138
|
User-Agent:
|
94
139
|
- Ruby
|
95
140
|
Content-Type:
|
@@ -102,29 +147,33 @@ http_interactions:
|
|
102
147
|
Content-Type:
|
103
148
|
- text/json; charset=UTF-8
|
104
149
|
Date:
|
105
|
-
-
|
150
|
+
- Mon, 17 Nov 2014 18:26:24 GMT
|
106
151
|
Server:
|
107
|
-
- dogdispatcher/
|
152
|
+
- dogdispatcher/6.0.12
|
153
|
+
Strict-Transport-Security:
|
154
|
+
- max-age=15724800;
|
108
155
|
Content-Length:
|
109
156
|
- '277'
|
110
157
|
Connection:
|
111
158
|
- keep-alive
|
112
159
|
body:
|
113
|
-
encoding:
|
114
|
-
string:
|
115
|
-
"handle": null, "title": "title", "url": "https://app.datadoghq.com/event/jump_to?event_id=
|
116
|
-
"text": "test message", "tags": [], "related_event_id": null, "id":
|
160
|
+
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}}'
|
117
164
|
http_version:
|
118
|
-
recorded_at:
|
165
|
+
recorded_at: Mon, 17 Nov 2014 18:26:24 GMT
|
119
166
|
- request:
|
120
167
|
method: get
|
121
|
-
uri: https://app.datadoghq.com/api/v1/events/
|
168
|
+
uri: https://app.datadoghq.com/api/v1/events/2549900588599571577?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
122
169
|
body:
|
123
170
|
encoding: US-ASCII
|
124
171
|
string: ''
|
125
172
|
headers:
|
173
|
+
Accept-Encoding:
|
174
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
126
175
|
Accept:
|
127
|
-
-
|
176
|
+
- '*/*'
|
128
177
|
User-Agent:
|
129
178
|
- Ruby
|
130
179
|
response:
|
@@ -137,26 +186,28 @@ http_interactions:
|
|
137
186
|
Content-Type:
|
138
187
|
- application/json
|
139
188
|
Date:
|
140
|
-
-
|
189
|
+
- Mon, 17 Nov 2014 18:26:33 GMT
|
141
190
|
Pragma:
|
142
191
|
- no-cache
|
143
192
|
Server:
|
144
|
-
- gunicorn/
|
145
|
-
|
146
|
-
-
|
147
|
-
|
193
|
+
- gunicorn/19.1.0
|
194
|
+
Strict-Transport-Security:
|
195
|
+
- max-age=15724800;
|
196
|
+
Vary:
|
197
|
+
- Accept-Encoding
|
148
198
|
X-Dd-Version:
|
149
|
-
- 31.
|
199
|
+
- 31.1883.245-0
|
150
200
|
Content-Length:
|
151
|
-
- '
|
201
|
+
- '243'
|
152
202
|
Connection:
|
153
203
|
- keep-alive
|
154
204
|
body:
|
155
|
-
encoding:
|
156
|
-
string:
|
157
|
-
"/api/v1/events/
|
158
|
-
"text": "test message", "tags": [], "id":
|
159
|
-
"low", "host": "
|
205
|
+
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
|
+
"{}"}}'
|
160
211
|
http_version:
|
161
|
-
recorded_at:
|
162
|
-
recorded_with: VCR 2.9.
|
212
|
+
recorded_at: Mon, 17 Nov 2014 18:26:33 GMT
|
213
|
+
recorded_with: VCR 2.9.3
|
@@ -5,10 +5,12 @@ http_interactions:
|
|
5
5
|
uri: https://app.datadoghq.com/api/v1/series?api_key=9775a026f1ca7d1c6c5af9d94d9595a4
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string:
|
8
|
+
string: '{"series":[{"metric":"test.tag.metric","points":[[1416248810,1.0]],"type":"gauge","host":"test.tag.host","device":null}]}'
|
9
9
|
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
10
12
|
Accept:
|
11
|
-
-
|
13
|
+
- '*/*'
|
12
14
|
User-Agent:
|
13
15
|
- Ruby
|
14
16
|
Content-Type:
|
@@ -21,18 +23,20 @@ http_interactions:
|
|
21
23
|
Content-Type:
|
22
24
|
- text/json; charset=UTF-8
|
23
25
|
Date:
|
24
|
-
-
|
26
|
+
- Mon, 17 Nov 2014 18:26:51 GMT
|
25
27
|
Server:
|
26
|
-
- dogdispatcher/
|
28
|
+
- dogdispatcher/6.0.12
|
29
|
+
Strict-Transport-Security:
|
30
|
+
- max-age=15724800;
|
27
31
|
Content-Length:
|
28
32
|
- '15'
|
29
33
|
Connection:
|
30
34
|
- keep-alive
|
31
35
|
body:
|
32
|
-
encoding:
|
33
|
-
string:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"status":"ok"}'
|
34
38
|
http_version:
|
35
|
-
recorded_at:
|
39
|
+
recorded_at: Mon, 17 Nov 2014 18:26:51 GMT
|
36
40
|
- request:
|
37
41
|
method: delete
|
38
42
|
uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
@@ -40,8 +44,10 @@ http_interactions:
|
|
40
44
|
encoding: US-ASCII
|
41
45
|
string: ''
|
42
46
|
headers:
|
47
|
+
Accept-Encoding:
|
48
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
43
49
|
Accept:
|
44
|
-
-
|
50
|
+
- '*/*'
|
45
51
|
User-Agent:
|
46
52
|
- Ruby
|
47
53
|
response:
|
@@ -56,23 +62,22 @@ http_interactions:
|
|
56
62
|
Content-Type:
|
57
63
|
- application/json
|
58
64
|
Date:
|
59
|
-
-
|
65
|
+
- Mon, 17 Nov 2014 18:26:56 GMT
|
60
66
|
Pragma:
|
61
67
|
- no-cache
|
62
68
|
Server:
|
63
|
-
- gunicorn/
|
64
|
-
|
65
|
-
-
|
66
|
-
Path=/
|
69
|
+
- gunicorn/19.1.0
|
70
|
+
Strict-Transport-Security:
|
71
|
+
- max-age=15724800;
|
67
72
|
X-Dd-Version:
|
68
|
-
- 31.
|
73
|
+
- 31.1883.245-0
|
69
74
|
Connection:
|
70
75
|
- keep-alive
|
71
76
|
body:
|
72
|
-
encoding:
|
77
|
+
encoding: UTF-8
|
73
78
|
string: ''
|
74
79
|
http_version:
|
75
|
-
recorded_at:
|
80
|
+
recorded_at: Mon, 17 Nov 2014 18:26:56 GMT
|
76
81
|
- request:
|
77
82
|
method: get
|
78
83
|
uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
@@ -80,8 +85,10 @@ http_interactions:
|
|
80
85
|
encoding: US-ASCII
|
81
86
|
string: ''
|
82
87
|
headers:
|
88
|
+
Accept-Encoding:
|
89
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
83
90
|
Accept:
|
84
|
-
-
|
91
|
+
- '*/*'
|
85
92
|
User-Agent:
|
86
93
|
- Ruby
|
87
94
|
response:
|
@@ -94,34 +101,35 @@ http_interactions:
|
|
94
101
|
Content-Type:
|
95
102
|
- application/json
|
96
103
|
Date:
|
97
|
-
-
|
104
|
+
- Mon, 17 Nov 2014 18:26:56 GMT
|
98
105
|
Pragma:
|
99
106
|
- no-cache
|
100
107
|
Server:
|
101
|
-
- gunicorn/
|
102
|
-
|
103
|
-
-
|
104
|
-
Path=/
|
108
|
+
- gunicorn/19.1.0
|
109
|
+
Strict-Transport-Security:
|
110
|
+
- max-age=15724800;
|
105
111
|
X-Dd-Version:
|
106
|
-
- 31.
|
112
|
+
- 31.1883.245-0
|
107
113
|
Content-Length:
|
108
114
|
- '12'
|
109
115
|
Connection:
|
110
116
|
- keep-alive
|
111
117
|
body:
|
112
|
-
encoding:
|
113
|
-
string:
|
118
|
+
encoding: UTF-8
|
119
|
+
string: '{"tags": []}'
|
114
120
|
http_version:
|
115
|
-
recorded_at:
|
121
|
+
recorded_at: Mon, 17 Nov 2014 18:26:56 GMT
|
116
122
|
- request:
|
117
123
|
method: post
|
118
124
|
uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
119
125
|
body:
|
120
126
|
encoding: UTF-8
|
121
|
-
string:
|
127
|
+
string: '{"tags":["test.tag.1","test.tag.2"]}'
|
122
128
|
headers:
|
129
|
+
Accept-Encoding:
|
130
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
123
131
|
Accept:
|
124
|
-
-
|
132
|
+
- '*/*'
|
125
133
|
User-Agent:
|
126
134
|
- Ruby
|
127
135
|
Content-Type:
|
@@ -136,25 +144,24 @@ http_interactions:
|
|
136
144
|
Content-Type:
|
137
145
|
- application/json
|
138
146
|
Date:
|
139
|
-
-
|
147
|
+
- Mon, 17 Nov 2014 18:26:56 GMT
|
140
148
|
Pragma:
|
141
149
|
- no-cache
|
142
150
|
Server:
|
143
|
-
- gunicorn/
|
144
|
-
|
145
|
-
-
|
146
|
-
Path=/
|
151
|
+
- gunicorn/19.1.0
|
152
|
+
Strict-Transport-Security:
|
153
|
+
- max-age=15724800;
|
147
154
|
X-Dd-Version:
|
148
|
-
- 31.
|
155
|
+
- 31.1883.245-0
|
149
156
|
Content-Length:
|
150
157
|
- '63'
|
151
158
|
Connection:
|
152
159
|
- keep-alive
|
153
160
|
body:
|
154
|
-
encoding:
|
155
|
-
string:
|
161
|
+
encoding: UTF-8
|
162
|
+
string: '{"host": "test.tag.host", "tags": ["test.tag.2", "test.tag.1"]}'
|
156
163
|
http_version:
|
157
|
-
recorded_at:
|
164
|
+
recorded_at: Mon, 17 Nov 2014 18:26:57 GMT
|
158
165
|
- request:
|
159
166
|
method: get
|
160
167
|
uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
@@ -162,8 +169,10 @@ http_interactions:
|
|
162
169
|
encoding: US-ASCII
|
163
170
|
string: ''
|
164
171
|
headers:
|
172
|
+
Accept-Encoding:
|
173
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
165
174
|
Accept:
|
166
|
-
-
|
175
|
+
- '*/*'
|
167
176
|
User-Agent:
|
168
177
|
- Ruby
|
169
178
|
response:
|
@@ -176,34 +185,37 @@ http_interactions:
|
|
176
185
|
Content-Type:
|
177
186
|
- application/json
|
178
187
|
Date:
|
179
|
-
-
|
188
|
+
- Mon, 17 Nov 2014 18:26:57 GMT
|
180
189
|
Pragma:
|
181
190
|
- no-cache
|
182
191
|
Server:
|
183
|
-
- gunicorn/
|
184
|
-
|
185
|
-
-
|
186
|
-
|
192
|
+
- gunicorn/19.1.0
|
193
|
+
Strict-Transport-Security:
|
194
|
+
- max-age=15724800;
|
195
|
+
Vary:
|
196
|
+
- Accept-Encoding
|
187
197
|
X-Dd-Version:
|
188
|
-
- 31.
|
198
|
+
- 31.1883.245-0
|
189
199
|
Content-Length:
|
190
|
-
- '
|
200
|
+
- '48'
|
191
201
|
Connection:
|
192
202
|
- keep-alive
|
193
203
|
body:
|
194
|
-
encoding:
|
195
|
-
string:
|
204
|
+
encoding: UTF-8
|
205
|
+
string: '{"tags": ["test.tag.2", "test.tag.1"]}'
|
196
206
|
http_version:
|
197
|
-
recorded_at:
|
207
|
+
recorded_at: Mon, 17 Nov 2014 18:26:57 GMT
|
198
208
|
- request:
|
199
209
|
method: post
|
200
210
|
uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
201
211
|
body:
|
202
212
|
encoding: UTF-8
|
203
|
-
string:
|
213
|
+
string: '{"tags":["test.tag.3"]}'
|
204
214
|
headers:
|
215
|
+
Accept-Encoding:
|
216
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
205
217
|
Accept:
|
206
|
-
-
|
218
|
+
- '*/*'
|
207
219
|
User-Agent:
|
208
220
|
- Ruby
|
209
221
|
Content-Type:
|
@@ -218,25 +230,24 @@ http_interactions:
|
|
218
230
|
Content-Type:
|
219
231
|
- application/json
|
220
232
|
Date:
|
221
|
-
-
|
233
|
+
- Mon, 17 Nov 2014 18:26:57 GMT
|
222
234
|
Pragma:
|
223
235
|
- no-cache
|
224
236
|
Server:
|
225
|
-
- gunicorn/
|
226
|
-
|
227
|
-
-
|
228
|
-
Path=/
|
237
|
+
- gunicorn/19.1.0
|
238
|
+
Strict-Transport-Security:
|
239
|
+
- max-age=15724800;
|
229
240
|
X-Dd-Version:
|
230
|
-
- 31.
|
241
|
+
- 31.1883.245-0
|
231
242
|
Content-Length:
|
232
243
|
- '77'
|
233
244
|
Connection:
|
234
245
|
- keep-alive
|
235
246
|
body:
|
236
|
-
encoding:
|
237
|
-
string:
|
247
|
+
encoding: UTF-8
|
248
|
+
string: '{"host": "test.tag.host", "tags": ["test.tag.2", "test.tag.3", "test.tag.1"]}'
|
238
249
|
http_version:
|
239
|
-
recorded_at:
|
250
|
+
recorded_at: Mon, 17 Nov 2014 18:26:57 GMT
|
240
251
|
- request:
|
241
252
|
method: get
|
242
253
|
uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
@@ -244,8 +255,10 @@ http_interactions:
|
|
244
255
|
encoding: US-ASCII
|
245
256
|
string: ''
|
246
257
|
headers:
|
258
|
+
Accept-Encoding:
|
259
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
247
260
|
Accept:
|
248
|
-
-
|
261
|
+
- '*/*'
|
249
262
|
User-Agent:
|
250
263
|
- Ruby
|
251
264
|
response:
|
@@ -258,25 +271,26 @@ http_interactions:
|
|
258
271
|
Content-Type:
|
259
272
|
- application/json
|
260
273
|
Date:
|
261
|
-
-
|
274
|
+
- Mon, 17 Nov 2014 18:26:57 GMT
|
262
275
|
Pragma:
|
263
276
|
- no-cache
|
264
277
|
Server:
|
265
|
-
- gunicorn/
|
266
|
-
|
267
|
-
-
|
268
|
-
|
278
|
+
- gunicorn/19.1.0
|
279
|
+
Strict-Transport-Security:
|
280
|
+
- max-age=15724800;
|
281
|
+
Vary:
|
282
|
+
- Accept-Encoding
|
269
283
|
X-Dd-Version:
|
270
|
-
- 31.
|
284
|
+
- 31.1883.245-0
|
271
285
|
Content-Length:
|
272
|
-
- '
|
286
|
+
- '51'
|
273
287
|
Connection:
|
274
288
|
- keep-alive
|
275
289
|
body:
|
276
|
-
encoding:
|
277
|
-
string:
|
290
|
+
encoding: UTF-8
|
291
|
+
string: '{"tags": ["test.tag.2", "test.tag.3", "test.tag.1"]}'
|
278
292
|
http_version:
|
279
|
-
recorded_at:
|
293
|
+
recorded_at: Mon, 17 Nov 2014 18:26:57 GMT
|
280
294
|
- request:
|
281
295
|
method: delete
|
282
296
|
uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
@@ -284,8 +298,10 @@ http_interactions:
|
|
284
298
|
encoding: US-ASCII
|
285
299
|
string: ''
|
286
300
|
headers:
|
301
|
+
Accept-Encoding:
|
302
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
287
303
|
Accept:
|
288
|
-
-
|
304
|
+
- '*/*'
|
289
305
|
User-Agent:
|
290
306
|
- Ruby
|
291
307
|
response:
|
@@ -300,23 +316,22 @@ http_interactions:
|
|
300
316
|
Content-Type:
|
301
317
|
- application/json
|
302
318
|
Date:
|
303
|
-
-
|
319
|
+
- Mon, 17 Nov 2014 18:26:57 GMT
|
304
320
|
Pragma:
|
305
321
|
- no-cache
|
306
322
|
Server:
|
307
|
-
- gunicorn/
|
308
|
-
|
309
|
-
-
|
310
|
-
Path=/
|
323
|
+
- gunicorn/19.1.0
|
324
|
+
Strict-Transport-Security:
|
325
|
+
- max-age=15724800;
|
311
326
|
X-Dd-Version:
|
312
|
-
- 31.
|
327
|
+
- 31.1883.245-0
|
313
328
|
Connection:
|
314
329
|
- keep-alive
|
315
330
|
body:
|
316
|
-
encoding:
|
331
|
+
encoding: UTF-8
|
317
332
|
string: ''
|
318
333
|
http_version:
|
319
|
-
recorded_at:
|
334
|
+
recorded_at: Mon, 17 Nov 2014 18:26:57 GMT
|
320
335
|
- request:
|
321
336
|
method: get
|
322
337
|
uri: https://app.datadoghq.com/api/v1/tags/hosts/test.tag.host?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
@@ -324,8 +339,10 @@ http_interactions:
|
|
324
339
|
encoding: US-ASCII
|
325
340
|
string: ''
|
326
341
|
headers:
|
342
|
+
Accept-Encoding:
|
343
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
327
344
|
Accept:
|
328
|
-
-
|
345
|
+
- '*/*'
|
329
346
|
User-Agent:
|
330
347
|
- Ruby
|
331
348
|
response:
|
@@ -338,23 +355,22 @@ http_interactions:
|
|
338
355
|
Content-Type:
|
339
356
|
- application/json
|
340
357
|
Date:
|
341
|
-
-
|
358
|
+
- Mon, 17 Nov 2014 18:26:58 GMT
|
342
359
|
Pragma:
|
343
360
|
- no-cache
|
344
361
|
Server:
|
345
|
-
- gunicorn/
|
346
|
-
|
347
|
-
-
|
348
|
-
Path=/
|
362
|
+
- gunicorn/19.1.0
|
363
|
+
Strict-Transport-Security:
|
364
|
+
- max-age=15724800;
|
349
365
|
X-Dd-Version:
|
350
|
-
- 31.
|
366
|
+
- 31.1883.245-0
|
351
367
|
Content-Length:
|
352
368
|
- '12'
|
353
369
|
Connection:
|
354
370
|
- keep-alive
|
355
371
|
body:
|
356
|
-
encoding:
|
357
|
-
string:
|
372
|
+
encoding: UTF-8
|
373
|
+
string: '{"tags": []}'
|
358
374
|
http_version:
|
359
|
-
recorded_at:
|
360
|
-
recorded_with: VCR 2.9.
|
375
|
+
recorded_at: Mon, 17 Nov 2014 18:26:58 GMT
|
376
|
+
recorded_with: VCR 2.9.3
|
data/tests/test_alerts.rb
CHANGED
@@ -13,12 +13,12 @@ class TestAlerts < Test::Unit::TestCase
|
|
13
13
|
alert_id = dog.alert(query)[1]['id']
|
14
14
|
status, alert = dog.get_alert(alert_id)
|
15
15
|
assert_equal alert['query'], query, alert['query']
|
16
|
-
assert_equal alert['silenced'],
|
16
|
+
assert_equal alert['silenced'], {}, alert['silenced']
|
17
17
|
|
18
18
|
dog.update_alert(alert_id, query, :silenced => true)
|
19
19
|
status, alert = dog.get_alert(alert_id)
|
20
20
|
assert_equal alert['query'], query, alert['query']
|
21
|
-
assert_equal alert['silenced'],
|
21
|
+
assert_equal alert['silenced'], {'*' => nil}, alert['silenced']
|
22
22
|
|
23
23
|
dog.delete_alert(alert_id)
|
24
24
|
|