Class: Paratrooper::Newrelic::Notifier
- Inherits:
-
Paratrooper::Notifier
- Object
- Paratrooper::Notifier
- Paratrooper::Newrelic::Notifier
- Defined in:
- lib/paratrooper-newrelic.rb
Overview
Public: Sends notification to NewRelic to stop monitoring while deploy is
happening
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#application_id ⇒ Object
readonly
Returns the value of attribute application_id.
Instance Method Summary collapse
-
#initialize(api_key, account_id, application_id) ⇒ Notifier
constructor
Public: Initializes NewRelicNotifier.
- #setup(options = {}) ⇒ Object
- #teardown(options = {}) ⇒ Object
Constructor Details
#initialize(api_key, account_id, application_id) ⇒ Notifier
Public: Initializes NewRelicNotifier
api_key - String api key from NewRelic account_id - String NewRelic account id application_id - String NewRelic id of application
18 19 20 21 22 |
# File 'lib/paratrooper-newrelic.rb', line 18 def initialize(api_key, account_id, application_id) @api_key = api_key @account_id = account_id @application_id = application_id end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
11 12 13 |
# File 'lib/paratrooper-newrelic.rb', line 11 def account_id @account_id end |
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
11 12 13 |
# File 'lib/paratrooper-newrelic.rb', line 11 def api_key @api_key end |
#application_id ⇒ Object (readonly)
Returns the value of attribute application_id.
11 12 13 |
# File 'lib/paratrooper-newrelic.rb', line 11 def application_id @application_id end |
Instance Method Details
#setup(options = {}) ⇒ Object
24 25 26 |
# File 'lib/paratrooper-newrelic.rb', line 24 def setup( = {}) %x[curl https://heroku.newrelic.com/accounts/#{account_id}/applications/#{application_id}/ping_targets/disable -X POST -H "X-Api-Key: #{api_key}"] end |
#teardown(options = {}) ⇒ Object
28 29 30 |
# File 'lib/paratrooper-newrelic.rb', line 28 def teardown( = {}) %x[curl https://heroku.newrelic.com/accounts/#{account_id}/applications/#{application_id}/ping_targets/enable -X POST -H "X-Api-Key: #{api_key}"] end |