dogapi 1.26.0 → 1.27.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: a9bf8f406b6802f4b75bf0c1a7347672ef1813e1
4
- data.tar.gz: 91672b6f969fec52c9b0b83502d039b64f86fd0f
3
+ metadata.gz: 47c9486eed69610e6417d723463e3e2304a00078
4
+ data.tar.gz: 1828cdefdf1d3f266d9a7f7b8a9c11c7e7b437b8
5
5
  SHA512:
6
- metadata.gz: 4d82924ea9143144a8a62fe15734a4d2b75980bbb2d2ffd512d76d46d1aa3ba9ad6f21c108331230bf30b19cd79c5b15bff262a7d0e6369fafa60a468ed7ae35
7
- data.tar.gz: de50e88ee99964572e0a951dd9aecc5926be1fabcfec6f7a031fe8b9cd3c4957c2029f74fff5d469a85c7c6042336f131dccdfd2747fe0306ee13b0e77b382de
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Dogapi
2
- VERSION = '1.26.0'
2
+ VERSION = '1.27.0'
3
3
  end
@@ -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.26.0
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-04-10 00:00:00.000000000 Z
11
+ date: 2017-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json