dogapi 1.26.0 → 1.27.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 +5 -0
- data/lib/dogapi/facade.rb +4 -0
- data/lib/dogapi/v1/monitor.rb +9 -0
- data/lib/dogapi/version.rb +1 -1
- data/spec/integration/monitor_spec.rb +6 -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: 47c9486eed69610e6417d723463e3e2304a00078
|
4
|
+
data.tar.gz: 1828cdefdf1d3f266d9a7f7b8a9c11c7e7b437b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e84a8a44103464a58f9e0886ba559e59bf9e07fcac4ade95f289039fff8eaeca1f6da7b63ff95b72c53eb9fbd248a7ac78c349febd6aaef55ec8a44714cdf6c
|
7
|
+
data.tar.gz: e20e6785d99a710ec515b0ca126a3d280cfac528de8f88b59c545eb6538ac20d486179b0f2e7ee133bfc64c71456005a22b01a2f5e5da838a0867d9d73a6ae23
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
Changes
|
2
2
|
=======
|
3
3
|
|
4
|
+
# 1.27.0 / 2017-05-01
|
5
|
+
|
6
|
+
* [FEATURE] Add monitor validation endpoint. See [#127][]
|
7
|
+
|
4
8
|
# 1.26.0 / 2017-04-10
|
5
9
|
|
6
10
|
* [IMPROVEMENT] Allow additional options to be passed to monitor API calls. See [#125][] (thanks [@jimmyngo][])
|
@@ -178,6 +182,7 @@ This is the last release compatible with Ruby 1.8. ([EOL 2013-06-30](https://www
|
|
178
182
|
[#115]: https://github.com/DataDog/dogapi-rb/issues/115
|
179
183
|
[#120]: https://github.com/DataDog/dogapi-rb/issues/120
|
180
184
|
[#125]: https://github.com/DataDog/dogapi-rb/issues/125
|
185
|
+
[#127]: https://github.com/DataDog/dogapi-rb/issues/127
|
181
186
|
[@ArjenSchwarz]: https://github.com/ArjenSchwarz
|
182
187
|
[@Kaixiang]: https://github.com/Kaixiang
|
183
188
|
[@ansel1]: https://github.com/ansel1
|
data/lib/dogapi/facade.rb
CHANGED
@@ -408,6 +408,10 @@ module Dogapi
|
|
408
408
|
@monitor_svc.get_all_monitors(options)
|
409
409
|
end
|
410
410
|
|
411
|
+
def validate_monitor(type, query, options= {})
|
412
|
+
@monitor_svc.validate_monitor(type, query, options)
|
413
|
+
end
|
414
|
+
|
411
415
|
def mute_monitors()
|
412
416
|
@monitor_svc.mute_monitors()
|
413
417
|
end
|
data/lib/dogapi/v1/monitor.rb
CHANGED
@@ -53,6 +53,15 @@ module Dogapi
|
|
53
53
|
request(Net::HTTP::Get, "/api/#{API_VERSION}/monitor", extra_params, nil, false)
|
54
54
|
end
|
55
55
|
|
56
|
+
def validate_monitor(type, query, options = {})
|
57
|
+
body = {
|
58
|
+
'type' => type,
|
59
|
+
'query' => query,
|
60
|
+
}.merge options
|
61
|
+
|
62
|
+
request(Net::HTTP::Post, "/api/#{API_VERSION}/monitor/validate", nil, body, true)
|
63
|
+
end
|
64
|
+
|
56
65
|
def mute_monitors
|
57
66
|
request(Net::HTTP::Post, "/api/#{API_VERSION}/monitor/mute_all", nil, nil, false)
|
58
67
|
end
|
data/lib/dogapi/version.rb
CHANGED
@@ -38,6 +38,12 @@ describe Dogapi::Client do
|
|
38
38
|
:get, '/monitor', group_states: %w(custom all), tags: ['test', 'key:value'], name: 'test'
|
39
39
|
end
|
40
40
|
|
41
|
+
describe '#validate_monitor' do
|
42
|
+
it_behaves_like 'an api method with options',
|
43
|
+
:validate_monitor, [MONITOR_TYPE, MONITOR_QUERY],
|
44
|
+
:post, '/monitor/validate', 'type' => MONITOR_TYPE, 'query' => MONITOR_QUERY
|
45
|
+
end
|
46
|
+
|
41
47
|
describe '#mute_monitors' do
|
42
48
|
it_behaves_like 'an api method',
|
43
49
|
:mute_monitors, [],
|
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.27.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-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|