dogapi 1.18.0 → 1.19.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a0168ec9732a98699a3c482343009150d400c12
4
- data.tar.gz: c85ddc87c5fea88a8e33908200170edcce90462f
3
+ metadata.gz: de64563ab5144d6702205f3880a060f67df51241
4
+ data.tar.gz: f05d0e0f8ee326fa9d894ca79dccc7b60de1a936
5
5
  SHA512:
6
- metadata.gz: 6f5b5a3042667d4b4994381bea615c07cfe6d90aad63a8fb402c20c53e541c5e39318e74420155dccdc63afc159f17f1ada861ea1f99d59c473f7b81a3f25449
7
- data.tar.gz: 4daad67757975dce8b26e21cb87066ef4613185c8a0f84d54a40e8f760eb9d3e80bbd79cef81b87e4e038519ce975be7cc2445535304ca8ad9bc19b4e770c40d
6
+ metadata.gz: 5b4ab9bf5dff9e693be19c9c06e3d4e73650565f79eda03241415d10173df6002ca907ce0a5f8f3ec3101a0ca543f04bb7b311efefebef5d94b586aa912f9769
7
+ data.tar.gz: 9863d208e81b87f6fa0f353126253c4d0fe2c1ec6d0b6ff13d6308e5ed4bab1ed8c53027e6f19adac7d9a1107c95b1d1b3636728a3cd8dcd4a4a20351937e269
@@ -1,113 +1,116 @@
1
1
  Changes
2
2
  =======
3
3
 
4
+ # 1.19.0 / 2015-06-22
5
+ * [FEATURE] Revoke a shared a Screenboard. See [#69][]
6
+
4
7
  # 1.18.0 / 2015-06-01
5
- * Add support for host muting.
8
+ * [FEATURE] Add support for host muting.
6
9
 
7
10
  # 1.17.0 / 2015-03-26
8
- * Use MultiJSON for JSON handling. (thanks [@winebarrel][] [#64][])
11
+ * [IMPROVEMENT] Use MultiJSON for JSON handling. (thanks [@winebarrel][] [#64][])
9
12
 
10
13
  # 1.16.0 / 2015-03-06
11
- * Return response from API when metrics are sent as a batch. (thanks [@yyuu][] [#62](https://github.com/DataDog/dogapi-rb/pull/62))
14
+ * [IMPROVEMENT] Return response from API when metrics are sent as a batch. (thanks [@yyuu][] [#62](https://github.com/DataDog/dogapi-rb/pull/62))
12
15
 
13
16
  # 1.15.0 / 2015-02-03
14
- * Encode capistrano output messages to UTF-8 before manipulating them. (thanks [@byroot][] [#52](https://github.com/DataDog/dogapi-rb/pull/52))
15
- * Add open_timeout to avoid stuck HTTP calls (thanks [@Kaixiang][] [#55](https://github.com/DataDog/dogapi-rb/pull/55))
17
+ * [BUGFIX] Add open_timeout to avoid stuck HTTP calls (thanks [@Kaixiang][] [#55](https://github.com/DataDog/dogapi-rb/pull/55))
18
+ * [BUGFIX] Encode capistrano output messages to UTF-8 before manipulating them. (thanks [@byroot][] [#52](https://github.com/DataDog/dogapi-rb/pull/52))
16
19
 
17
20
  # 1.14.0 / 2015-01-09
18
- * Add get_all_screenboards [#61](https://github.com/DataDog/dogapi-rb/pull/61)
19
- * Remove required start argument from schedule_downtime [#60](https://github.com/DataDog/dogapi-rb/pull/60)
21
+ * [FEATURE] Add get_all_screenboards [#61](https://github.com/DataDog/dogapi-rb/pull/61)
22
+ * [IMPROVEMENT] Remove required start argument from schedule_downtime [#60](https://github.com/DataDog/dogapi-rb/pull/60)
20
23
 
21
24
  # 1.13.0 / 2014-12-10
22
- * Add tag filter to get_all_monitors [#58](https://github.com/DataDog/dogapi-rb/pull/58)
23
- * Add update downtime method [#59](https://github.com/DataDog/dogapi-rb/pull/59)
25
+ * [FEATURE] Add tag filter to get_all_monitors [#58](https://github.com/DataDog/dogapi-rb/pull/58)
26
+ * [FEATURE] Add update downtime method [#59](https://github.com/DataDog/dogapi-rb/pull/59)
24
27
 
25
28
  # 1.12.0 / 2014-11-17
26
- * Add support for the Monitor API [#51](https://github.com/DataDog/dogapi-rb/pull/51)
27
- * Truncate event title and text before submission [#53](https://github.com/DataDog/dogapi-rb/pull/53)
29
+ * [FEATURE] Add support for the Monitor API [#51](https://github.com/DataDog/dogapi-rb/pull/51)
30
+ * [IMPROVEMENT] Truncate event title and text before submission [#53](https://github.com/DataDog/dogapi-rb/pull/53)
28
31
 
29
32
  # 1.11.0 / 2014-07-03
30
- * Allow to send several metrics in the same http request
31
- * Add support for http proxy defined by the environment variables
33
+ * [IMPROVEMENT] Add support for HTTP proxy defined by the environment variables
34
+ * [IMPROVEMENT] Allow to send several metrics in the same HTTP request
32
35
 
33
36
  # 1.10.0 / 2014-05-13
34
- * Re-enable SSL verification ([#37](https://github.com/DataDog/dogapi-rb/issues/37))
35
- * Make http timeout configurable ([#29](https://github.com/DataDog/dogapi-rb/issues/29))
36
- * Report application name when deploy with Capistrano (thanks [@ArjenSchwarz][] [#46](https://github.com/DataDog/dogapi-rb/pull/46))
37
+ * [IMPROVEMENT] Make HTTP timeout configurable ([#29](https://github.com/DataDog/dogapi-rb/issues/29))
38
+ * [IMPROVEMENT] Re-enable SSL verification ([#37](https://github.com/DataDog/dogapi-rb/issues/37))
39
+ * [IMPROVEMENT] Report application name when deploy with Capistrano (thanks [@ArjenSchwarz][] [#46](https://github.com/DataDog/dogapi-rb/pull/46))
37
40
 
38
41
  # 1.9.2 / 2014-02-13
39
- * Fully support for capistrano v3 ([#43](https://github.com/DataDog/dogapi-rb/pull/43))
40
- * Strip control characters from capistrano messages ([#36](https://github.com/DataDog/dogapi-rb/issues/36))
41
- * Tag capistrano events by stage (thanks [@arielo][] [#25](https://github.com/DataDog/dogapi-rb/pull/25))
42
+ * [IMPROVEMENT] Fully support for capistrano v3 ([#43](https://github.com/DataDog/dogapi-rb/pull/43))
43
+ * [IMPROVEMENT] Strip control characters from capistrano messages ([#36](https://github.com/DataDog/dogapi-rb/issues/36))
44
+ * [IMPROVEMENT] Tag capistrano events by stage (thanks [@arielo][] [#25](https://github.com/DataDog/dogapi-rb/pull/25))
42
45
 
43
46
  # 1.9.1 / 2014-01-06
44
- * Log a warning instead of crashing when trying to integration with capistrano v3
47
+ * [IMPROVEMENT] Log a warning instead of crashing when trying to integration with capistrano v3
45
48
 
46
49
  # 1.9.0 / 2013-09-06
47
- * When emitting a metric without an explicit host, default to local hostname.
50
+ * [IMPROVEMENT] When emitting a metric without an explicit host, default to local hostname.
48
51
 
49
52
  # 1.8.1 / 2013-08-22
50
- * Update Dash API to support template variables.
53
+ * [FEATURE] Update Dash API to support template variables.
51
54
 
52
55
  # 1.8.0 / 2013-07-16
53
- * Add an API for interacting with Screenboards
56
+ * [FEATURE] Add an API for interacting with Screenboards
54
57
 
55
58
  # 1.7.1 / 2013-06-23
56
- * Add an API for inviting users
57
- * Add an API for taking graph snapshots
58
- * Fix bug in capistrano integration with logging of nil (thanks [@arielo][])
59
+ * [BUGFIX] Fix bug in capistrano integration with logging of nil (thanks [@arielo][])
60
+ * [FEATURE] Add an API for inviting users
61
+ * [FEATURE] Add an API for taking graph snapshots
59
62
 
60
63
  # 1.7.0
61
64
  * Not released.
62
65
 
63
66
  # 1.6.0 / 2013-02-19
64
- * Support for setting `source` type when submitting host tags
67
+ * [FEATURE] Support for setting `source` type when submitting host tags
65
68
 
66
69
  # 1.5.2 / 2013-02-13
67
- * Fix a bug in hashing the Event object when the instance variables are symbols.
70
+ * [BUGFIX] Fix a bug in hashing the Event object when the instance variables are symbols.
68
71
 
69
72
  # 1.5.0 / 2012-11-06
70
- * Alerting API
73
+ * [FEATURE] Alerting API
71
74
 
72
75
  # 1.4.3
73
- * Fix bug with capistrano integration for capistrano 2.13.5 (thanks [@ansel1][])
76
+ * [BUGFIX] Fix bug with capistrano integration for capistrano 2.13.5 (thanks [@ansel1][])
74
77
 
75
78
  # 1.4.2
76
- * Added missing dashboards endpoint.
79
+ * [BUGFIX] Added missing dashboards endpoint.
77
80
 
78
81
  # 1.4.1
79
- * Fixed searching for events with tags.
82
+ * [BUGFIX] Fixed searching for events with tags.
80
83
 
81
84
  # 1.4.0
82
- * Added support for the dashboard, search and comment API endpoints.
85
+ * [FEATURE] Added support for the dashboard, search and comment API endpoints.
83
86
 
84
87
  # 1.3.6
85
- * Small fix for capistrano integration
88
+ * [BUGFIX] Small fix for capistrano integration
86
89
 
87
90
  # 1.3.4
88
- * Various bug fixes (event.to_hash, md5 import, capistrano lambda roles)
91
+ * [BUGFIX] Various bug fixes (event.to_hash, md5 import, capistrano lambda roles)
89
92
 
90
93
  # 1.3.3
91
- * Bug fix for submitting counters
94
+ * [BUGFIX] Bug fix for submitting counters
92
95
 
93
96
  # 1.3.2
94
- * Support an aggregation key to aggregate events together
97
+ * [IMPROVEMENT] Support an aggregation key to aggregate events together
95
98
 
96
99
  # 1.3.1
97
- * Metrics can be counters, rather than just gauges (thanks to [@treeder][])
98
- * Metrics can be tagged.
100
+ * [FEATURE] Metrics can be counters, rather than just gauges (thanks to [@treeder][])
101
+ * [FEATURE] Metrics can be tagged.
99
102
 
100
103
  # 1.3.0
101
- * Capistrano integration. See https://github.com/DataDog/dogapi-rb/tree/master/lib/capistrano
104
+ * [FEATURE] Capistrano integration. See https://github.com/DataDog/dogapi-rb/tree/master/lib/capistrano
102
105
 
103
106
  # 1.2.x
104
- * You can now manage host tags
105
- * You can now get event details and query the stream in addition to posting events
106
- * Functionality relating to events with a duration has been deprecated
107
- * The underlying clients have been updated to use Datadog's new public HTTP API[https://github.com/DataDog/dogapi/wiki]
107
+ * [FEATURE] You can now manage host tags
108
+ * [IMPROVEMENT] Functionality relating to events with a duration has been deprecated
109
+ * [IMPROVEMENT] The underlying clients have been updated to use Datadog's new public HTTP API[https://github.com/DataDog/dogapi/wiki]
110
+ * [IMPROVEMENT] You can now get event details and query the stream in addition to posting events
108
111
 
109
112
  # 1.1.x
110
- * You do not need to use environment variables anymore to use the client.
113
+ * [IMPROVEMENT] You do not need to use environment variables anymore to use the client.
111
114
 
112
115
  <!--- The following link definition list is generated by PimpMyChangelog --->
113
116
  [#25]: https://github.com/DataDog/dogapi-rb/issues/25
@@ -126,6 +129,7 @@ Changes
126
129
  [#61]: https://github.com/DataDog/dogapi-rb/issues/61
127
130
  [#62]: https://github.com/DataDog/dogapi-rb/issues/62
128
131
  [#64]: https://github.com/DataDog/dogapi-rb/issues/64
132
+ [#69]: https://github.com/DataDog/dogapi-rb/issues/69
129
133
  [@ArjenSchwarz]: https://github.com/ArjenSchwarz
130
134
  [@Kaixiang]: https://github.com/Kaixiang
131
135
  [@ansel1]: https://github.com/ansel1
@@ -322,6 +322,10 @@ module Dogapi
322
322
  @screenboard_svc.share_screenboard(board_id)
323
323
  end
324
324
 
325
+ def revoke_screenboard(board_id)
326
+ @screenboard_svc.revoke_screenboard(board_id)
327
+ end
328
+
325
329
  #
326
330
  # MONITORS
327
331
  #
@@ -91,6 +91,19 @@ module Dogapi
91
91
  end
92
92
  end
93
93
 
94
+ def revoke_screenboard(board_id)
95
+ begin
96
+ params = {
97
+ :api_key => @api_key,
98
+ :application_key => @application_key
99
+ }
100
+
101
+ request(Net::HTTP::Delete, "/api/#{API_VERSION}/screen/share/#{board_id}", params, nil, false)
102
+ rescue Exception => e
103
+ suppress_error_if_silent e
104
+ end
105
+ end
106
+
94
107
  end
95
108
 
96
109
  end
@@ -1,3 +1,3 @@
1
1
  module Dogapi
2
- VERSION = "1.18.0"
2
+ VERSION = "1.19.0"
3
3
  end
@@ -150,7 +150,8 @@ class TestAlerts < Test::Unit::TestCase
150
150
 
151
151
  def test_host_muting
152
152
  dog = Dogapi::Client.new(@api_key, @app_key)
153
- hostname = 'test.host'
153
+
154
+ hostname = 'test.host%d' % rand(10000)
154
155
 
155
156
  # Reset test
156
157
  dog.unmute_host(hostname)
@@ -1,6 +1,7 @@
1
1
  require 'dogapi'
2
2
  require 'time'
3
3
  require 'test_base.rb'
4
+ require 'open-uri'
4
5
 
5
6
  class TestScreenboard < Test::Unit::TestCase
6
7
  include TestBase
@@ -66,6 +67,18 @@ class TestScreenboard < Test::Unit::TestCase
66
67
  assert_equal status, "200", "invalid HTTP response => #{status}"
67
68
  assert share_result["board_id"] == result["id"]
68
69
 
70
+ open(share_result["public_url"]) do |f|
71
+ assert_equal f.status.first, "200", "invalid HTTP response => #{status}"
72
+ end
73
+
74
+ status, revoke_result = dog.revoke_screenboard(result["id"])
75
+ assert_equal status, "200", "invalid HTTP response => #{status}"
76
+
77
+ ex = assert_raise OpenURI::HTTPError do
78
+ open(share_result["public_url"])
79
+ end
80
+ assert_equal ex.message, "404 Not Found"
81
+
69
82
  status, del_result = dog.delete_screenboard(result["id"])
70
83
  assert_equal status, "200", "invalid HTTP response => #{status}"
71
84
  assert del_result["id"] == result["id"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dogapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.0
4
+ version: 1.19.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: 2015-06-01 00:00:00.000000000 Z
11
+ date: 2015-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json