-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bcon/make query optional monitor update #192
Changes from 6 commits
cdabbb7
b3176b5
8a540b2
148cb57
123a98c
fa5f7ea
bf5d965
d1c2d2f
7a1e9fb
b7632e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,13 @@ def monitor(type, query, options = {}) | |
end | ||
|
||
def update_monitor(monitor_id, query, options) | ||
body = { | ||
'query' => query, | ||
}.merge options | ||
body = {}.merge options | ||
unless query.nil? | ||
body = { | ||
'query' => query | ||
}.merge body | ||
warn '[DEPRECATION] query param is no longer required for update' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would not warn here. If someone does want to actually update the query, they should not see a deprecation message. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually you were right to have this message. I misunderstood how all of it worked. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok just put it back in with the updates! |
||
end | ||
|
||
request(Net::HTTP::Put, "/api/#{API_VERSION}/monitor/#{monitor_id}", nil, body, true) | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Dogapi | ||
VERSION = '1.36.0' | ||
VERSION = '1.36.1' | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than merging an empty hash, I would write it as :
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason it's being picky about the order and local tests don't pass with this
¯_(ツ)_/¯