Module: OpsGenie::Helper

Included in:
Alert
Defined in:
lib/ops_genie/helper.rb

Instance Method Summary collapse

Instance Method Details

#http_post(endpoint, params) ⇒ Object



12
13
14
15
16
17
# File 'lib/ops_genie/helper.rb', line 12

def http_post endpoint, params
  uri = URI(File.join(OpsGenie.configuration.base_url, endpoint))
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true
  JSON.parse(http.post(uri.path, ops_params(params)).body)
end

#should_alert?Boolean



6
7
8
9
10
# File 'lib/ops_genie/helper.rb', line 6

def should_alert?
  OpsGenie.configuration.release_stage.nil? || 
  OpsGenie.configuration.alert_release_stages.nil? || 
  OpsGenie.configuration.alert_release_stages.include?(OpsGenie.configuration.release_stage)
end