From 98965779e64bd1e51e50aa84eab209f157dce924 Mon Sep 17 00:00:00 2001 From: Quentin Madec Date: Mon, 1 May 2017 17:15:46 -0400 Subject: [PATCH] Prepare 1.27.0 release Rename monitor_validate to validate_monitor for consistency. --- CHANGELOG.md | 7 ++++++- lib/dogapi/facade.rb | 4 ++-- lib/dogapi/v1/monitor.rb | 2 +- spec/integration/monitor_spec.rb | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37945f92..cc1f4f90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ Changes ======= +# 1.27.0 / UNRELEASED + +* [FEATURE] Add monitor validation endpoint. See [#127][] + # 1.26.0 / 2017-04-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 [#115]: https://github.com/DataDog/dogapi-rb/issues/115 [#120]: https://github.com/DataDog/dogapi-rb/issues/120 [#125]: https://github.com/DataDog/dogapi-rb/issues/125 +[#127]: https://github.com/DataDog/dogapi-rb/issues/127 [@ArjenSchwarz]: https://github.com/ArjenSchwarz [@Kaixiang]: https://github.com/Kaixiang [@ansel1]: https://github.com/ansel1 @@ -192,4 +197,4 @@ This is the last release compatible with Ruby 1.8. ([EOL 2013-06-30](https://www [@rmoriz]: https://github.com/rmoriz [@treeder]: https://github.com/treeder [@winebarrel]: https://github.com/winebarrel -[@yyuu]: https://github.com/yyuu +[@yyuu]: https://github.com/yyuu \ No newline at end of file diff --git a/lib/dogapi/facade.rb b/lib/dogapi/facade.rb index 6bd77873..33e6366a 100644 --- a/lib/dogapi/facade.rb +++ b/lib/dogapi/facade.rb @@ -408,8 +408,8 @@ def get_all_monitors(options= {}) @monitor_svc.get_all_monitors(options) end - def monitor_validate(type, query, options= {}) - @monitor_svc.monitor_validate(type, query, options) + def validate_monitor(type, query, options= {}) + @monitor_svc.validate_monitor(type, query, options) end def mute_monitors() diff --git a/lib/dogapi/v1/monitor.rb b/lib/dogapi/v1/monitor.rb index 61a74dc3..8ef7a5ab 100644 --- a/lib/dogapi/v1/monitor.rb +++ b/lib/dogapi/v1/monitor.rb @@ -53,7 +53,7 @@ def get_all_monitors(options = {}) request(Net::HTTP::Get, "/api/#{API_VERSION}/monitor", extra_params, nil, false) end - def monitor_validate(type, query, options = {}) + def validate_monitor(type, query, options = {}) body = { 'type' => type, 'query' => query, diff --git a/spec/integration/monitor_spec.rb b/spec/integration/monitor_spec.rb index ccd18562..ba81292f 100644 --- a/spec/integration/monitor_spec.rb +++ b/spec/integration/monitor_spec.rb @@ -40,8 +40,8 @@ describe '#validate_monitor' do it_behaves_like 'an api method with options', - :monitor, [MONITOR_TYPE, MONITOR_QUERY], - :post, '/monitor', 'type' => MONITOR_TYPE, 'query' => MONITOR_QUERY + :validate_monitor, [MONITOR_TYPE, MONITOR_QUERY], + :post, '/monitor/validate', 'type' => MONITOR_TYPE, 'query' => MONITOR_QUERY end describe '#mute_monitors' do