dogapi 1.25.0 → 1.26.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -2
- data/lib/dogapi/v1/monitor.rb +6 -18
- data/lib/dogapi/version.rb +1 -1
- data/spec/integration/monitor_spec.rb +3 -3
- metadata +22 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9bf8f406b6802f4b75bf0c1a7347672ef1813e1
|
4
|
+
data.tar.gz: 91672b6f969fec52c9b0b83502d039b64f86fd0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d82924ea9143144a8a62fe15734a4d2b75980bbb2d2ffd512d76d46d1aa3ba9ad6f21c108331230bf30b19cd79c5b15bff262a7d0e6369fafa60a468ed7ae35
|
7
|
+
data.tar.gz: de50e88ee99964572e0a951dd9aecc5926be1fabcfec6f7a031fe8b9cd3c4957c2029f74fff5d469a85c7c6042336f131dccdfd2747fe0306ee13b0e77b382de
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
Changes
|
2
2
|
=======
|
3
3
|
|
4
|
-
# 1.
|
4
|
+
# 1.26.0 / 2017-04-10
|
5
|
+
|
6
|
+
* [IMPROVEMENT] Allow additional options to be passed to monitor API calls. See [#125][] (thanks [@jimmyngo][])
|
7
|
+
|
8
|
+
# 1.25.0 / 2017-02-14
|
5
9
|
|
6
10
|
* [FEATURE] Add Datadog endpoint for metrics metadata. See [#120][]
|
7
11
|
|
@@ -173,6 +177,7 @@ This is the last release compatible with Ruby 1.8. ([EOL 2013-06-30](https://www
|
|
173
177
|
[#114]: https://github.com/DataDog/dogapi-rb/issues/114
|
174
178
|
[#115]: https://github.com/DataDog/dogapi-rb/issues/115
|
175
179
|
[#120]: https://github.com/DataDog/dogapi-rb/issues/120
|
180
|
+
[#125]: https://github.com/DataDog/dogapi-rb/issues/125
|
176
181
|
[@ArjenSchwarz]: https://github.com/ArjenSchwarz
|
177
182
|
[@Kaixiang]: https://github.com/Kaixiang
|
178
183
|
[@ansel1]: https://github.com/ansel1
|
@@ -181,9 +186,10 @@ This is the last release compatible with Ruby 1.8. ([EOL 2013-06-30](https://www
|
|
181
186
|
[@byroot]: https://github.com/byroot
|
182
187
|
[@casperisfine]: https://github.com/casperisfine
|
183
188
|
[@hnovikov]: https://github.com/hnovikov
|
189
|
+
[@jimmyngo]: https://github.com/jimmyngo
|
184
190
|
[@miknight]: https://github.com/miknight
|
185
191
|
[@nots]: https://github.com/nots
|
186
192
|
[@rmoriz]: https://github.com/rmoriz
|
187
193
|
[@treeder]: https://github.com/treeder
|
188
194
|
[@winebarrel]: https://github.com/winebarrel
|
189
|
-
[@yyuu]: https://github.com/yyuu
|
195
|
+
[@yyuu]: https://github.com/yyuu
|
data/lib/dogapi/v1/monitor.rb
CHANGED
@@ -25,11 +25,11 @@ module Dogapi
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def get_monitor(monitor_id, options = {})
|
28
|
+
extra_params = options.clone
|
28
29
|
# :group_states is an optional list of statuses to filter returned
|
29
30
|
# groups. If no value is given then no group states will be returned.
|
30
31
|
# Possible values are: "all", "ok", "warn", "alert", "no data".
|
31
|
-
extra_params =
|
32
|
-
extra_params[:group_states] = options[:group_states].join(',') if options[:group_states]
|
32
|
+
extra_params[:group_states] = extra_params[:group_states].join(',') if extra_params[:group_states]
|
33
33
|
|
34
34
|
request(Net::HTTP::Get, "/api/#{API_VERSION}/monitor/#{monitor_id}", extra_params, nil, false)
|
35
35
|
end
|
@@ -39,22 +39,16 @@ module Dogapi
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def get_all_monitors(options = {})
|
42
|
-
extra_params =
|
42
|
+
extra_params = options.clone
|
43
43
|
# :group_states is an optional list of statuses to filter returned
|
44
44
|
# groups. If no value is given then no group states will be returned.
|
45
45
|
# Possible values are: "all", "ok", "warn", "alert", "no data".
|
46
|
-
if
|
47
|
-
extra_params[:group_states] = options[:group_states]
|
48
|
-
extra_params[:group_states] = extra_params[:group_states].join(',') if extra_params[:group_states].respond_to?(:join)
|
49
|
-
end
|
46
|
+
extra_params[:group_states] = extra_params[:group_states].join(',') if extra_params[:group_states].respond_to?(:join)
|
50
47
|
|
51
48
|
# :tags is an optional list of scope tags to filter the list of monitors
|
52
49
|
# returned. If no value is given, then all monitors, regardless of
|
53
50
|
# scope, will be returned.
|
54
|
-
if
|
55
|
-
extra_params[:tags] = options[:tags]
|
56
|
-
extra_params[:tags] = extra_params[:tags].join(',') if extra_params[:tags].respond_to?(:join)
|
57
|
-
end
|
51
|
+
extra_params[:tags] = extra_params[:tags].join(',') if extra_params[:tags].respond_to?(:join)
|
58
52
|
|
59
53
|
request(Net::HTTP::Get, "/api/#{API_VERSION}/monitor", extra_params, nil, false)
|
60
54
|
end
|
@@ -99,13 +93,7 @@ module Dogapi
|
|
99
93
|
end
|
100
94
|
|
101
95
|
def get_all_downtimes(options = {})
|
102
|
-
|
103
|
-
if options[:current_only]
|
104
|
-
extra_params[:current_only] = options[:current_only]
|
105
|
-
options.delete :current_only
|
106
|
-
end
|
107
|
-
|
108
|
-
request(Net::HTTP::Get, "/api/#{API_VERSION}/downtime", extra_params, nil, false)
|
96
|
+
request(Net::HTTP::Get, "/api/#{API_VERSION}/downtime", options, nil, false)
|
109
97
|
end
|
110
98
|
|
111
99
|
#
|
data/lib/dogapi/version.rb
CHANGED
@@ -35,7 +35,7 @@ describe Dogapi::Client do
|
|
35
35
|
describe '#get_all_monitors' do
|
36
36
|
it_behaves_like 'an api method with optional params',
|
37
37
|
:get_all_monitors, [],
|
38
|
-
:get, '/monitor', group_states: %w(custom all), tags: ['test', 'key:value']
|
38
|
+
:get, '/monitor', group_states: %w(custom all), tags: ['test', 'key:value'], name: 'test'
|
39
39
|
end
|
40
40
|
|
41
41
|
describe '#mute_monitors' do
|
@@ -87,9 +87,9 @@ describe Dogapi::Client do
|
|
87
87
|
end
|
88
88
|
|
89
89
|
describe '#get_all_downtimes' do
|
90
|
-
it_behaves_like 'an api method',
|
90
|
+
it_behaves_like 'an api method with optional params',
|
91
91
|
:get_all_downtimes, [],
|
92
|
-
:get, '/downtime'
|
92
|
+
:get, '/downtime', current_only: true
|
93
93
|
end
|
94
94
|
|
95
95
|
describe '#mute_host' do
|
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.26.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: 2017-
|
11
|
+
date: 2017-04-10 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,11 +74,11 @@ extensions: []
|
|
74
74
|
extra_rdoc_files:
|
75
75
|
- README.rdoc
|
76
76
|
files:
|
77
|
-
- .gitignore
|
78
|
-
- .rspec
|
79
|
-
- .rubocop.yml
|
80
|
-
- .tailor
|
81
|
-
- .travis.yml
|
77
|
+
- ".gitignore"
|
78
|
+
- ".rspec"
|
79
|
+
- ".rubocop.yml"
|
80
|
+
- ".tailor"
|
81
|
+
- ".travis.yml"
|
82
82
|
- CHANGELOG.md
|
83
83
|
- Gemfile
|
84
84
|
- LICENSE
|
@@ -137,27 +137,27 @@ licenses:
|
|
137
137
|
metadata: {}
|
138
138
|
post_install_message:
|
139
139
|
rdoc_options:
|
140
|
-
- --title
|
140
|
+
- "--title"
|
141
141
|
- DogAPI -- Datadog Client
|
142
|
-
- --main
|
142
|
+
- "--main"
|
143
143
|
- README.rdoc
|
144
|
-
- --line-numbers
|
145
|
-
- --inline-source
|
144
|
+
- "--line-numbers"
|
145
|
+
- "--inline-source"
|
146
146
|
require_paths:
|
147
147
|
- lib
|
148
148
|
required_ruby_version: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
154
|
requirements:
|
155
|
-
- -
|
155
|
+
- - ">="
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
158
|
requirements: []
|
159
159
|
rubyforge_project:
|
160
|
-
rubygems_version: 2.
|
160
|
+
rubygems_version: 2.6.8
|
161
161
|
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: Ruby bindings for Datadog's API
|