Module: InterruptHelper::PagerDuty
Defined Under Namespace
Classes: APIError, RaiseNon202
Instance Method Summary
collapse
Instance Method Details
#events_v2 ⇒ ::Faraday
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/interrupt_helper/pager_duty.rb', line 17
def events_v2
@events_v2_client ||= Faraday.new do |conn|
conn.url_prefix = "https://events.pagerduty.com/v2/"
conn.use(RaiseNon202)
conn.request(:json)
conn.response(:json)
conn.[:accept] = "application/json"
conn.adapter(Faraday.default_adapter)
end
end
|
7
8
9
10
11
12
13
14
|
# File 'lib/interrupt_helper/pager_duty.rb', line 7
def (token)
token = token.to_s
return nil if token.empty?
@pagerduty_clients ||= Hash.new { |h, k|
h[k] = ::PagerDuty::Connection.new(k)
}
@pagerduty_clients[token]
end
|