dogapi 1.21.0 → 1.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +5 -2
- data/CHANGELOG.md +8 -3
- data/Gemfile +1 -0
- data/README.rdoc +22 -0
- data/Rakefile +2 -7
- data/lib/dogapi/facade.rb +10 -0
- data/lib/dogapi/v1/metric.rb +28 -3
- data/lib/dogapi/version.rb +1 -1
- data/spec/spec_helper.rb +3 -1
- data/spec/support/cassettes/Alerts/create/returns_HTTP_code_200.yml +39 -23
- data/spec/support/cassettes/Alerts/create/returns_a_valid_event_ID.yml +39 -153
- data/spec/support/cassettes/Alerts/create/returns_the_same_query_as_sent.yml +39 -153
- data/spec/support/cassettes/Facade/Events/emits_aggregate_events.yml +68 -264
- data/spec/support/cassettes/Facade/Events/emits_events_and_retrieves_them.yml +36 -153
- data/spec/support/cassettes/Facade/Events/emits_events_with_specified_priority.yml +34 -149
- data/spec/support/cassettes/Facade/Tags/adds_updates_and_detaches_tags.yml +132 -66
- data/tests/test_alerts.rb +1 -1
- data/tests/test_base.rb +1 -1
- data/tests/test_client.rb +1 -1
- data/tests/test_comments.rb +1 -1
- data/tests/test_dashes.rb +1 -1
- data/tests/test_embed.rb +2 -2
- data/tests/test_monitors.rb +1 -1
- data/tests/test_screenboard.rb +2 -2
- data/tests/test_search.rb +1 -1
- data/tests/test_snapshot.rb +1 -1
- data/tests/test_users.rb +1 -1
- metadata +21 -32
- data/spec/support/cassettes/Alerts/create/returns_HTTP_code_201.yml +0 -191
- data/spec/support/cassettes/Facade/Client/emit_point_can_pass_nil_host.yml +0 -32
- data/spec/support/cassettes/Facade/Client/emit_point_passes_data.yml +0 -32
- data/spec/support/cassettes/Facade/Client/emit_point_uses_localhost_default.yml +0 -32
- data/spec/support/cassettes/Facade/Client/emits_point_with_localhost.yml +0 -32
data/tests/test_client.rb
CHANGED
data/tests/test_comments.rb
CHANGED
data/tests/test_dashes.rb
CHANGED
data/tests/test_embed.rb
CHANGED
@@ -2,7 +2,7 @@ require 'dogapi'
|
|
2
2
|
require 'time'
|
3
3
|
require 'test_base.rb'
|
4
4
|
|
5
|
-
class TestEmbed < Test
|
5
|
+
class TestEmbed < Minitest::Test
|
6
6
|
include TestBase
|
7
7
|
|
8
8
|
def test_get_all_embeds
|
@@ -54,7 +54,7 @@ class TestEmbed < Test::Unit::TestCase
|
|
54
54
|
assert result["html"].include? "height=300"
|
55
55
|
assert result["html"].include? "width=600"
|
56
56
|
end
|
57
|
-
|
57
|
+
|
58
58
|
def test_get_embed
|
59
59
|
dog = Dogapi::Client.new(@api_key, @app_key)
|
60
60
|
# Create an Embed to get a valid embed_id
|
data/tests/test_monitors.rb
CHANGED
data/tests/test_screenboard.rb
CHANGED
@@ -3,7 +3,7 @@ require 'time'
|
|
3
3
|
require 'test_base.rb'
|
4
4
|
require 'open-uri'
|
5
5
|
|
6
|
-
class TestScreenboard < Test
|
6
|
+
class TestScreenboard < Minitest::Test
|
7
7
|
include TestBase
|
8
8
|
|
9
9
|
def test_screenboard
|
@@ -74,7 +74,7 @@ class TestScreenboard < Test::Unit::TestCase
|
|
74
74
|
status, revoke_result = dog.revoke_screenboard(result["id"])
|
75
75
|
assert_equal status, "200", "invalid HTTP response => #{status}"
|
76
76
|
|
77
|
-
ex =
|
77
|
+
ex = assert_raises OpenURI::HTTPError do
|
78
78
|
open(share_result["public_url"])
|
79
79
|
end
|
80
80
|
assert_equal ex.message, "404 Not Found"
|
data/tests/test_search.rb
CHANGED
data/tests/test_snapshot.rb
CHANGED
data/tests/test_users.rb
CHANGED
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dogapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Datadog, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '10'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '10'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rdoc
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: Ruby bindings for Datadog's API
|
@@ -74,10 +74,10 @@ extensions: []
|
|
74
74
|
extra_rdoc_files:
|
75
75
|
- README.rdoc
|
76
76
|
files:
|
77
|
-
-
|
78
|
-
-
|
79
|
-
-
|
80
|
-
-
|
77
|
+
- .gitignore
|
78
|
+
- .rspec
|
79
|
+
- .tailor
|
80
|
+
- .travis.yml
|
81
81
|
- CHANGELOG.md
|
82
82
|
- Gemfile
|
83
83
|
- LICENSE
|
@@ -116,13 +116,8 @@ files:
|
|
116
116
|
- spec/facade_spec.rb
|
117
117
|
- spec/spec_helper.rb
|
118
118
|
- spec/support/cassettes/Alerts/create/returns_HTTP_code_200.yml
|
119
|
-
- spec/support/cassettes/Alerts/create/returns_HTTP_code_201.yml
|
120
119
|
- spec/support/cassettes/Alerts/create/returns_a_valid_event_ID.yml
|
121
120
|
- spec/support/cassettes/Alerts/create/returns_the_same_query_as_sent.yml
|
122
|
-
- spec/support/cassettes/Facade/Client/emit_point_can_pass_nil_host.yml
|
123
|
-
- spec/support/cassettes/Facade/Client/emit_point_passes_data.yml
|
124
|
-
- spec/support/cassettes/Facade/Client/emit_point_uses_localhost_default.yml
|
125
|
-
- spec/support/cassettes/Facade/Client/emits_point_with_localhost.yml
|
126
121
|
- spec/support/cassettes/Facade/Events/emits_aggregate_events.yml
|
127
122
|
- spec/support/cassettes/Facade/Events/emits_events_and_retrieves_them.yml
|
128
123
|
- spec/support/cassettes/Facade/Events/emits_events_with_specified_priority.yml
|
@@ -144,27 +139,27 @@ licenses:
|
|
144
139
|
metadata: {}
|
145
140
|
post_install_message:
|
146
141
|
rdoc_options:
|
147
|
-
-
|
142
|
+
- --title
|
148
143
|
- DogAPI -- Datadog Client
|
149
|
-
-
|
144
|
+
- --main
|
150
145
|
- README.rdoc
|
151
|
-
-
|
152
|
-
-
|
146
|
+
- --line-numbers
|
147
|
+
- --inline-source
|
153
148
|
require_paths:
|
154
149
|
- lib
|
155
150
|
required_ruby_version: !ruby/object:Gem::Requirement
|
156
151
|
requirements:
|
157
|
-
- -
|
152
|
+
- - '>='
|
158
153
|
- !ruby/object:Gem::Version
|
159
154
|
version: '0'
|
160
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
156
|
requirements:
|
162
|
-
- -
|
157
|
+
- - '>='
|
163
158
|
- !ruby/object:Gem::Version
|
164
159
|
version: '0'
|
165
160
|
requirements: []
|
166
161
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.
|
162
|
+
rubygems_version: 2.6.1
|
168
163
|
signing_key:
|
169
164
|
specification_version: 4
|
170
165
|
summary: Ruby bindings for Datadog's API
|
@@ -174,15 +169,9 @@ test_files:
|
|
174
169
|
- spec/facade_spec.rb
|
175
170
|
- spec/spec_helper.rb
|
176
171
|
- spec/support/cassettes/Alerts/create/returns_HTTP_code_200.yml
|
177
|
-
- spec/support/cassettes/Alerts/create/returns_HTTP_code_201.yml
|
178
172
|
- spec/support/cassettes/Alerts/create/returns_a_valid_event_ID.yml
|
179
173
|
- spec/support/cassettes/Alerts/create/returns_the_same_query_as_sent.yml
|
180
|
-
- spec/support/cassettes/Facade/Client/emit_point_can_pass_nil_host.yml
|
181
|
-
- spec/support/cassettes/Facade/Client/emit_point_passes_data.yml
|
182
|
-
- spec/support/cassettes/Facade/Client/emit_point_uses_localhost_default.yml
|
183
|
-
- spec/support/cassettes/Facade/Client/emits_point_with_localhost.yml
|
184
174
|
- spec/support/cassettes/Facade/Events/emits_aggregate_events.yml
|
185
175
|
- spec/support/cassettes/Facade/Events/emits_events_and_retrieves_them.yml
|
186
176
|
- spec/support/cassettes/Facade/Events/emits_events_with_specified_priority.yml
|
187
177
|
- spec/support/cassettes/Facade/Tags/adds_updates_and_detaches_tags.yml
|
188
|
-
has_rdoc: true
|
@@ -1,191 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: delete
|
5
|
-
uri: https://app.datadoghq.com/api/v1/alert/37498?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
Accept:
|
11
|
-
- ! '*/*'
|
12
|
-
User-Agent:
|
13
|
-
- Ruby
|
14
|
-
response:
|
15
|
-
status:
|
16
|
-
code: 200
|
17
|
-
message: OK
|
18
|
-
headers:
|
19
|
-
Cache-Control:
|
20
|
-
- no-cache
|
21
|
-
Content-Type:
|
22
|
-
- application/json
|
23
|
-
Date:
|
24
|
-
- Tue, 27 Aug 2013 16:13:42 GMT
|
25
|
-
Pragma:
|
26
|
-
- no-cache
|
27
|
-
Server:
|
28
|
-
- gunicorn/0.17.4
|
29
|
-
Set-Cookie:
|
30
|
-
- user={"org":{"id":1499},"_type":"User","id":3658}; Path=/
|
31
|
-
X-Dd-Version:
|
32
|
-
- 31.153-293-3859d5c
|
33
|
-
Content-Length:
|
34
|
-
- '315'
|
35
|
-
Connection:
|
36
|
-
- keep-alive
|
37
|
-
body:
|
38
|
-
encoding: US-ASCII
|
39
|
-
string: ! '{"notify_no_data": false, "event_object": "6bc5a22ffc9d267c3cd6eb3ad79623e0",
|
40
|
-
"state": "OK", "name": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
41
|
-
> 5", "silenced": false, "query": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
42
|
-
> 5", "message": null, "creator": 3658, "timeout_h": null}'
|
43
|
-
http_version:
|
44
|
-
recorded_at: Tue, 27 Aug 2013 16:13:42 GMT
|
45
|
-
- request:
|
46
|
-
method: delete
|
47
|
-
uri: https://app.datadoghq.com/api/v1/alert/?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
48
|
-
body:
|
49
|
-
encoding: US-ASCII
|
50
|
-
string: ''
|
51
|
-
headers:
|
52
|
-
Accept:
|
53
|
-
- ! '*/*'
|
54
|
-
User-Agent:
|
55
|
-
- Ruby
|
56
|
-
response:
|
57
|
-
status:
|
58
|
-
code: 404
|
59
|
-
message: Not Found
|
60
|
-
headers:
|
61
|
-
Cache-Control:
|
62
|
-
- no-cache
|
63
|
-
Content-Type:
|
64
|
-
- text/html; charset=utf-8
|
65
|
-
Date:
|
66
|
-
- Thu, 08 May 2014 18:13:02 GMT
|
67
|
-
Pragma:
|
68
|
-
- no-cache
|
69
|
-
Server:
|
70
|
-
- gunicorn/0.17.4
|
71
|
-
Set-Cookie:
|
72
|
-
- user={"org":{"id":1499,"time_zone":null},"_type":"User","id":3658,"time_zone":null};
|
73
|
-
Path=/
|
74
|
-
X-Dd-Version:
|
75
|
-
- 31.1104.1337
|
76
|
-
Content-Length:
|
77
|
-
- '1178'
|
78
|
-
Connection:
|
79
|
-
- keep-alive
|
80
|
-
body:
|
81
|
-
encoding: US-ASCII
|
82
|
-
string: ! "\n <html>\n <head>\n <title>Error
|
83
|
-
404 | Datadog</title>\n <link href=\"/static/css/datadog.css?v=31.1104.1337\"
|
84
|
-
media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />\n </head>\n
|
85
|
-
\ <body>\n <div class=\"header\">\n <div
|
86
|
-
class=\"header_content\">\n <a name=\"top\"></a>\n <h1
|
87
|
-
id=\"logo\">\n <a href=\"/\">Datadog</a>\n </h1>\n
|
88
|
-
\ <!--header_content--></div>\n <!--header--></div>\n
|
89
|
-
\ <div class=\"error_page clearfix\">\n <img alt=\"sad
|
90
|
-
datadog\" id=\"sad_bits\" src=\"/static/images/sad_bits.png?v=31.1104.1337\"
|
91
|
-
/>\n <p class=\"arf\">Arf.</p>\n <h1>404 Not Found</h1>\n
|
92
|
-
\ <ul>\n <li><a href=\"/\">Go home →</a></li>\n
|
93
|
-
\ <li><a href=\"http://help.datadoghq.com/\">Datadog help center
|
94
|
-
→</a></li>\n <li><a href=\"/account/settings\">Datadog
|
95
|
-
setup basics →</a></li>\n </ul>\n </div>\n <div
|
96
|
-
class=\"version_number\">Copyright Datadog, Inc. 2014</div>\n </body>\n
|
97
|
-
\ </html>\n\n "
|
98
|
-
http_version:
|
99
|
-
recorded_at: Thu, 08 May 2014 18:08:39 GMT
|
100
|
-
- request:
|
101
|
-
method: post
|
102
|
-
uri: https://app.datadoghq.com/api/v1/alert?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
103
|
-
body:
|
104
|
-
encoding: UTF-8
|
105
|
-
string: ! '{"query":"avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
106
|
-
> 5"}'
|
107
|
-
headers:
|
108
|
-
Accept:
|
109
|
-
- ! '*/*'
|
110
|
-
User-Agent:
|
111
|
-
- Ruby
|
112
|
-
Content-Type:
|
113
|
-
- application/json
|
114
|
-
response:
|
115
|
-
status:
|
116
|
-
code: 201
|
117
|
-
message: Created
|
118
|
-
headers:
|
119
|
-
Cache-Control:
|
120
|
-
- no-cache
|
121
|
-
Content-Type:
|
122
|
-
- application/json
|
123
|
-
Date:
|
124
|
-
- Tue, 13 May 2014 19:48:03 GMT
|
125
|
-
Pragma:
|
126
|
-
- no-cache
|
127
|
-
Server:
|
128
|
-
- gunicorn/0.17.4
|
129
|
-
Set-Cookie:
|
130
|
-
- user={"org":{"id":1499,"time_zone":null},"_type":"User","id":3658,"time_zone":null};
|
131
|
-
Path=/
|
132
|
-
X-Dd-Version:
|
133
|
-
- 31.1129.1362-0
|
134
|
-
Content-Length:
|
135
|
-
- '379'
|
136
|
-
Connection:
|
137
|
-
- keep-alive
|
138
|
-
body:
|
139
|
-
encoding: US-ASCII
|
140
|
-
string: ! '{"event_object": "6bc5a22ffc9d267c3cd6eb3ad79623e0", "notify_audit":
|
141
|
-
true, "timeout_h": null, "silenced": false, "query": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
142
|
-
> 5", "message": null, "id": 57371, "name": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
143
|
-
> 5", "silenced_timeout_ts": null, "creator": 3658, "notify_no_data": false,
|
144
|
-
"state": "OK"}'
|
145
|
-
http_version:
|
146
|
-
recorded_at: Tue, 13 May 2014 19:48:04 GMT
|
147
|
-
- request:
|
148
|
-
method: delete
|
149
|
-
uri: https://app.datadoghq.com/api/v1/alert/57371?api_key=9775a026f1ca7d1c6c5af9d94d9595a4&application_key=87ce4a24b5553d2e482ea8a8500e71b8ad4554ff
|
150
|
-
body:
|
151
|
-
encoding: US-ASCII
|
152
|
-
string: ''
|
153
|
-
headers:
|
154
|
-
Accept:
|
155
|
-
- ! '*/*'
|
156
|
-
User-Agent:
|
157
|
-
- Ruby
|
158
|
-
response:
|
159
|
-
status:
|
160
|
-
code: 200
|
161
|
-
message: OK
|
162
|
-
headers:
|
163
|
-
Cache-Control:
|
164
|
-
- no-cache
|
165
|
-
Content-Type:
|
166
|
-
- application/json
|
167
|
-
Date:
|
168
|
-
- Tue, 13 May 2014 19:48:04 GMT
|
169
|
-
Pragma:
|
170
|
-
- no-cache
|
171
|
-
Server:
|
172
|
-
- gunicorn/0.17.4
|
173
|
-
Set-Cookie:
|
174
|
-
- user={"org":{"id":1499,"time_zone":null},"_type":"User","id":3658,"time_zone":null};
|
175
|
-
Path=/
|
176
|
-
X-Dd-Version:
|
177
|
-
- 31.1129.1362-0
|
178
|
-
Content-Length:
|
179
|
-
- '366'
|
180
|
-
Connection:
|
181
|
-
- keep-alive
|
182
|
-
body:
|
183
|
-
encoding: US-ASCII
|
184
|
-
string: ! '{"event_object": "6bc5a22ffc9d267c3cd6eb3ad79623e0", "notify_audit":
|
185
|
-
true, "timeout_h": null, "silenced": false, "query": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
186
|
-
> 5", "message": null, "name": "avg(last_10m):avg:test.metric.metric{host:test.metric.host}
|
187
|
-
> 5", "silenced_timeout_ts": null, "creator": 3658, "notify_no_data": false,
|
188
|
-
"state": "OK"}'
|
189
|
-
http_version:
|
190
|
-
recorded_at: Tue, 13 May 2014 19:48:04 GMT
|
191
|
-
recorded_with: VCR 2.9.0
|