dogapi 1.4.1 → 1.4.2
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.
- data/README.rdoc +6 -3
- data/lib/dogapi/facade.rb +5 -0
- data/lib/dogapi/v1/dash.rb +14 -0
- data/tests/test_dashes.rb +9 -0
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
-
= Ruby client for Datadog API v1.4.
|
1
|
+
= Ruby client for Datadog API v1.4.1
|
2
2
|
|
3
3
|
The Ruby client is a library suitable for inclusion in existing Ruby projects or for development of standalone scripts. It provides an abstraction on top of Datadog's raw HTTP interface for reporting events and metrics.
|
4
4
|
|
5
5
|
= What's new?
|
6
6
|
|
7
|
+
== v1.4.1
|
8
|
+
|
9
|
+
* Fixed searching for events with tags.
|
10
|
+
|
7
11
|
== v1.4.0
|
8
12
|
|
9
13
|
* Added support for the dashboard, search and comment API endpoints.
|
@@ -18,8 +22,7 @@ The Ruby client is a library suitable for inclusion in existing Ruby projects or
|
|
18
22
|
|
19
23
|
== v1.3.3
|
20
24
|
|
21
|
-
* Bug fix for submitting counters
|
22
|
-
|
25
|
+
* Bug fix for submitting counters
|
23
26
|
|
24
27
|
== v1.3.2
|
25
28
|
|
data/lib/dogapi/facade.rb
CHANGED
@@ -230,6 +230,11 @@ module Dogapi
|
|
230
230
|
@dash_service.get_dashboard(dash_id)
|
231
231
|
end
|
232
232
|
|
233
|
+
# Fetch all of the dashboards.
|
234
|
+
def get_dashboards
|
235
|
+
@dash_service.get_dashboards
|
236
|
+
end
|
237
|
+
|
233
238
|
# Delete the given dashboard.
|
234
239
|
def delete_dashboard(dash_id)
|
235
240
|
@dash_service.delete_dashboard(dash_id)
|
data/lib/dogapi/v1/dash.rb
CHANGED
@@ -60,6 +60,20 @@ module Dogapi
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
+
def get_dashboards
|
64
|
+
begin
|
65
|
+
params = {
|
66
|
+
:api_key => @api_key,
|
67
|
+
:application_key => @application_key
|
68
|
+
}
|
69
|
+
|
70
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/dash", params, nil, false)
|
71
|
+
rescue Exception => e
|
72
|
+
suppress_error_if_silent e
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
|
63
77
|
def delete_dashboard(dash_id)
|
64
78
|
begin
|
65
79
|
params = {
|
data/tests/test_dashes.rb
CHANGED
@@ -60,6 +60,15 @@ class TestDashes < Test::Unit::TestCase
|
|
60
60
|
assert_equal description, dash["description"]
|
61
61
|
assert_equal graphs, dash["graphs"]
|
62
62
|
|
63
|
+
# Fetch all the dashboards.
|
64
|
+
status, dash_response = dog.get_dashboards()
|
65
|
+
assert_equal "200", status, "fetch failed"
|
66
|
+
dashes = dash_response["dashes"]
|
67
|
+
assert dashes.length
|
68
|
+
dash = dashes.sort{|x,y| x["id"] <=> y["id"]}.last
|
69
|
+
assert_equal title, dash["title"]
|
70
|
+
assert_equal dash_id.to_s, dash["id"]
|
71
|
+
|
63
72
|
# Delete the dashboard.
|
64
73
|
status, dash_response = dog.delete_dashboard(dash_id)
|
65
74
|
assert_equal "204", status, "Deleted failed"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dogapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|