Class: Paratrooper::Pingdom::Notifier
- Inherits:
-
Notifier
- Object
- Notifier
- Paratrooper::Pingdom::Notifier
- Defined in:
- lib/paratrooper-pingdom.rb
Overview
Public: Sends notification to Pingdom to stop monitoring while deploy is
happening
Instance Attribute Summary collapse
-
#app_key ⇒ Object
readonly
Returns the value of attribute app_key.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(app_key, username, password) ⇒ Notifier
constructor
Public: Initializes PingdomNotifier.
- #setup(options = {}) ⇒ Object
- #teardown(options = {}) ⇒ Object
Constructor Details
#initialize(app_key, username, password) ⇒ Notifier
Public: Initializes PingdomNotifier
app_key - String app key from Pingdom username - String Pingdom username password - String Pingdom password
18 19 20 21 22 |
# File 'lib/paratrooper-pingdom.rb', line 18 def initialize(app_key, username, password) @app_key = app_key @username = username @password = password end |
Instance Attribute Details
#app_key ⇒ Object (readonly)
Returns the value of attribute app_key.
11 12 13 |
# File 'lib/paratrooper-pingdom.rb', line 11 def app_key @app_key end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
11 12 13 |
# File 'lib/paratrooper-pingdom.rb', line 11 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
11 12 13 |
# File 'lib/paratrooper-pingdom.rb', line 11 def username @username end |
Instance Method Details
#setup(options = {}) ⇒ Object
24 25 26 |
# File 'lib/paratrooper-pingdom.rb', line 24 def setup( = {}) %x[curl https://api.pingdom.com/api/2.0/checks -X PUT -d "paused=true" -H "App-Key: #{app_key}" -u "#{username}:#{password}"] end |
#teardown(options = {}) ⇒ Object
28 29 30 |
# File 'lib/paratrooper-pingdom.rb', line 28 def teardown( = {}) %x[curl https://api.pingdom.com/api/2.0/checks -X PUT -d "paused=false" -H "App-Key: #{app_key}" -u "#{username}:#{password}"] end |