Class: Wavefront::Alerting
- Inherits:
-
Object
- Object
- Wavefront::Alerting
- Defined in:
- lib/wavefront/alerting.rb
Constant Summary collapse
- DEFAULT_HOST =
'metrics.wavefront.com'- DEFAULT_PATH =
'/api/alert/'
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #active(options = {}) ⇒ Object
-
#initialize(token) ⇒ Alerting
constructor
A new instance of Alerting.
Constructor Details
#initialize(token) ⇒ Alerting
Returns a new instance of Alerting.
30 31 32 |
# File 'lib/wavefront/alerting.rb', line 30 def initialize(token) @token = token end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
28 29 30 |
# File 'lib/wavefront/alerting.rb', line 28 def token @token end |
Instance Method Details
#active(options = {}) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/wavefront/alerting.rb', line 34 def active(={}) [:host] ||= DEFAULT_HOST [:path] ||= DEFAULT_PATH uri = URI::HTTPS.build(:host => [:host], :path => [:path]) uri = URI.join(uri.to_s,"active") uri = URI.join(uri.to_s,"?t=#{@token}") response = RestClient.get(uri.to_s) return response end |