class DogapiDemo::V1::AlertService
Constants
- API_VERSION
Public Instance Methods
alert(query, options = {})
click to toggle source
# File lib/dogapi-demo/v1/alert.rb 10 def alert(query, options = {}) 11 begin 12 params = { 13 :api_key => @api_key, 14 :application_key => @application_key 15 } 16 17 body = { 18 'query' => query, 19 }.merge options 20 21 request(Net::HTTP::Post, "/api/#{API_VERSION}/alert", params, body, true) 22 rescue Exception => e 23 suppress_error_if_silent e 24 end 25 end
delete_alert(alert_id)
click to toggle source
# File lib/dogapi-demo/v1/alert.rb 57 def delete_alert(alert_id) 58 begin 59 params = { 60 :api_key => @api_key, 61 :application_key => @application_key 62 } 63 64 request(Net::HTTP::Delete, "/api/#{API_VERSION}/alert/#{alert_id}", params, nil, false) 65 rescue Exception => e 66 suppress_error_if_silent e 67 end 68 end
get_alert(alert_id)
click to toggle source
# File lib/dogapi-demo/v1/alert.rb 44 def get_alert(alert_id) 45 begin 46 params = { 47 :api_key => @api_key, 48 :application_key => @application_key 49 } 50 51 request(Net::HTTP::Get, "/api/#{API_VERSION}/alert/#{alert_id}", params, nil, false) 52 rescue Exception => e 53 suppress_error_if_silent e 54 end 55 end
get_all_alerts()
click to toggle source
# File lib/dogapi-demo/v1/alert.rb 70 def get_all_alerts() 71 begin 72 params = { 73 :api_key => @api_key, 74 :application_key => @application_key 75 } 76 77 request(Net::HTTP::Get, "/api/#{API_VERSION}/alert", params, nil, false) 78 rescue Exception => e 79 suppress_error_if_silent e 80 end 81 end
mute_alerts()
click to toggle source
# File lib/dogapi-demo/v1/alert.rb 83 def mute_alerts() 84 begin 85 params = { 86 :api_key => @api_key, 87 :application_key => @application_key 88 } 89 90 request(Net::HTTP::Post, "/api/#{API_VERSION}/mute_alerts", params, nil, false) 91 rescue Exception => e 92 suppress_error_if_silent e 93 end 94 end
unmute_alerts()
click to toggle source
# File lib/dogapi-demo/v1/alert.rb 96 def unmute_alerts() 97 begin 98 params = { 99 :api_key => @api_key, 100 :application_key => @application_key 101 } 102 103 request(Net::HTTP::Post, "/api/#{API_VERSION}/unmute_alerts", params, nil, false) 104 rescue Exception => e 105 suppress_error_if_silent e 106 end 107 end
update_alert(alert_id, query, options)
click to toggle source
# File lib/dogapi-demo/v1/alert.rb 27 def update_alert(alert_id, query, options) 28 begin 29 params = { 30 :api_key => @api_key, 31 :application_key => @application_key 32 } 33 34 body = { 35 'query' => query, 36 }.merge options 37 38 request(Net::HTTP::Put, "/api/#{API_VERSION}/alert/#{alert_id}", params, body, true) 39 rescue Exception => e 40 suppress_error_if_silent e 41 end 42 end