Module: LibratoAlerts
Constant Summary collapse
- API_HOST =
"https://metrics-api.librato.com/v1"
- DEFAULT_VERSION =
2
Instance Attribute Summary collapse
-
#token ⇒ Object
writeonly
Sets the attribute token.
-
#user ⇒ Object
writeonly
Sets the attribute user.
Instance Method Summary collapse
- #all ⇒ Object
- #configure {|_self| ... } ⇒ Object
- #disable(alert_id) ⇒ Object
- #enable(alert_id) ⇒ Object
Instance Attribute Details
#token=(value) ⇒ Object (writeonly)
Sets the attribute token
9 10 11 |
# File 'lib/librato-alerts.rb', line 9 def token=(value) @token = value end |
#user=(value) ⇒ Object (writeonly)
Sets the attribute user
9 10 11 |
# File 'lib/librato-alerts.rb', line 9 def user=(value) @user = value end |
Instance Method Details
#all ⇒ Object
15 16 17 |
# File 'lib/librato-alerts.rb', line 15 def all request(method: :get)[:alerts] end |
#configure {|_self| ... } ⇒ Object
11 12 13 |
# File 'lib/librato-alerts.rb', line 11 def configure yield self end |
#disable(alert_id) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/librato-alerts.rb', line 26 def disable(alert_id) request( endpoint: "/#{alert_id}", method: :put, active: false) end |
#enable(alert_id) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/librato-alerts.rb', line 19 def enable(alert_id) request( endpoint: "/#{alert_id}", method: :put, active: true) end |