dogapi 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,13 @@
1
- = Ruby client for Datadog API v1.4.0
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
 
@@ -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)
@@ -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 = {
@@ -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.1
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-05 00:00:00.000000000 Z
12
+ date: 2012-09-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json