Class: Paratrooper::Newrelic::Notifier

Inherits:
Paratrooper::Notifier
  • Object
show all
Defined in:
lib/paratrooper-newrelic.rb

Overview

Public: Sends notification to NewRelic to stop monitoring while deploy is

happening

Instance Attribute Summary collapse

Instance Method Summary collapse

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, , application_id)
  @api_key        = api_key
  @account_id     = 
  @application_id = application_id
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



11
12
13
# File 'lib/paratrooper-newrelic.rb', line 11

def 
  @account_id
end

#api_keyObject (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_idObject (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(options = {})
  %x[curl https://heroku.newrelic.com/accounts/#{}/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(options = {})
  %x[curl https://heroku.newrelic.com/accounts/#{}/applications/#{application_id}/ping_targets/enable -X POST -H "X-Api-Key: #{api_key}"]
end