dogapi 1.13.0 → 1.14.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/dogapi/facade.rb +6 -2
- data/lib/dogapi/v1/monitor.rb +2 -3
- data/lib/dogapi/v1/screenboard.rb +13 -1
- data/lib/dogapi/version.rb +1 -1
- data/tests/test_comments.rb +2 -0
- data/tests/test_monitors.rb +2 -2
- data/tests/test_screenboard.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a2330cb3e89fca5eeabf84fbcdffb53efa658cf
|
4
|
+
data.tar.gz: 01463c055324568ca094f9153f984083ef40de59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b6f6500aac95e6b21dde0511b88089e2203023f894764eca3ac72acdec8e869224a0e80d818956ffdb2180a3bb8c2b0d8753382fea0a7667fa31d32270f354f
|
7
|
+
data.tar.gz: b9bd1c6aa13837610cca2092d459a8820a363eb30b721f74619a1be026636bfef77686a49276816a11115ce2adae9fdf921427320a4b7e7089911fd4017b321f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
Changes
|
2
2
|
=======
|
3
|
+
# 1.14.0 / 2015-01-09
|
4
|
+
* Add get_all_screenboards [#61](https://github.com/DataDog/dogapi-rb/pull/61)
|
5
|
+
* Remove required start argument from schedule_downtime [#60](https://github.com/DataDog/dogapi-rb/pull/60)
|
6
|
+
|
3
7
|
# 1.13.0 / 2014-12-10
|
4
8
|
* Add tag filter to get_all_monitors [#58](https://github.com/DataDog/dogapi-rb/pull/58)
|
5
9
|
* Add update downtime method [#59](https://github.com/DataDog/dogapi-rb/pull/59)
|
data/lib/dogapi/facade.rb
CHANGED
@@ -310,6 +310,10 @@ module Dogapi
|
|
310
310
|
@screenboard_svc.get_screenboard(board_id)
|
311
311
|
end
|
312
312
|
|
313
|
+
def get_all_screenboards()
|
314
|
+
@screenboard_svc.get_all_screenboards()
|
315
|
+
end
|
316
|
+
|
313
317
|
def delete_screenboard(board_id)
|
314
318
|
@screenboard_svc.delete_screenboard(board_id)
|
315
319
|
end
|
@@ -362,8 +366,8 @@ module Dogapi
|
|
362
366
|
# MONITOR DOWNTIME
|
363
367
|
#
|
364
368
|
|
365
|
-
def schedule_downtime(scope,
|
366
|
-
@monitor_svc.schedule_downtime(scope,
|
369
|
+
def schedule_downtime(scope, options = {})
|
370
|
+
@monitor_svc.schedule_downtime(scope, options)
|
367
371
|
end
|
368
372
|
|
369
373
|
def update_downtime(downtime_id, options = {})
|
data/lib/dogapi/v1/monitor.rb
CHANGED
@@ -157,7 +157,7 @@ module Dogapi
|
|
157
157
|
#
|
158
158
|
# DOWNTIMES
|
159
159
|
|
160
|
-
def schedule_downtime(scope,
|
160
|
+
def schedule_downtime(scope, options = {})
|
161
161
|
begin
|
162
162
|
params = {
|
163
163
|
:api_key => @api_key,
|
@@ -165,8 +165,7 @@ module Dogapi
|
|
165
165
|
}
|
166
166
|
|
167
167
|
body = {
|
168
|
-
'scope' => scope
|
169
|
-
'start' => start
|
168
|
+
'scope' => scope
|
170
169
|
}.merge options
|
171
170
|
|
172
171
|
request(Net::HTTP::Post, "/api/#{API_VERSION}/downtime", params, body, true)
|
@@ -52,6 +52,19 @@ module Dogapi
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
+
def get_all_screenboards()
|
56
|
+
begin
|
57
|
+
params = {
|
58
|
+
:api_key => @api_key,
|
59
|
+
:application_key => @application_key
|
60
|
+
}
|
61
|
+
|
62
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/screen", params, nil, false)
|
63
|
+
rescue Exception => e
|
64
|
+
suppress_error_if_silent e
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
55
68
|
def delete_screenboard(board_id)
|
56
69
|
begin
|
57
70
|
params = {
|
@@ -65,7 +78,6 @@ module Dogapi
|
|
65
78
|
end
|
66
79
|
end
|
67
80
|
|
68
|
-
|
69
81
|
def share_screenboard(board_id)
|
70
82
|
begin
|
71
83
|
params = {
|
data/lib/dogapi/version.rb
CHANGED
data/tests/test_comments.rb
CHANGED
@@ -18,6 +18,8 @@ class TestComments < Test::Unit::TestCase
|
|
18
18
|
comment = comment_response["comment"]
|
19
19
|
assert_equal "200", status, "Comment did not succeed, response: #{comment_response}"
|
20
20
|
|
21
|
+
sleep 1
|
22
|
+
|
21
23
|
# Reply to a comment.
|
22
24
|
status, reply_response = dog.comment('replying!', :related_event_id => comment["id"])
|
23
25
|
reply = reply_response["comment"]
|
data/tests/test_monitors.rb
CHANGED
@@ -129,8 +129,8 @@ class TestAlerts < Test::Unit::TestCase
|
|
129
129
|
dog = Dogapi::Client.new(@api_key, @app_key)
|
130
130
|
start_ts = Time.now.to_i
|
131
131
|
end_ts = start_ts + 1000
|
132
|
-
downtime_id = dog.schedule_downtime('env:staging',
|
133
|
-
:message=>'Message!')[1]['id']
|
132
|
+
downtime_id = dog.schedule_downtime('env:staging', :start => start_ts,
|
133
|
+
:end => end_ts, :message=>'Message!')[1]['id']
|
134
134
|
status, dt = dog.get_downtime(downtime_id)
|
135
135
|
assert_equal dt['start'], start_ts, dt['start']
|
136
136
|
assert_equal dt['end'], end_ts, dt['end']
|
data/tests/test_screenboard.rb
CHANGED
@@ -58,6 +58,9 @@ class TestScreenboard < Test::Unit::TestCase
|
|
58
58
|
assert_equal status, "200", "invalid HTTP response => #{status}"
|
59
59
|
assert result["widgets"] == board["widgets"]
|
60
60
|
|
61
|
+
status, result = dog.get_all_screenboards()
|
62
|
+
assert_equal status, "200", "invalid HTTP response => #{status}"
|
63
|
+
|
61
64
|
status, result = dog.update_screenboard(result["id"], updated_board)
|
62
65
|
assert_equal status, "200", "invalid HTTP response => #{status}"
|
63
66
|
assert result["widgets"] == updated_board["widgets"]
|
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.
|
4
|
+
version: 1.14.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: 2015-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|