Class: PagerdutyIncident

Inherits:
Pagerduty show all
Defined in:
lib/pagerduty.rb

Instance Attribute Summary

Attributes inherited from Pagerduty

#incident_key, #service_key

Instance Method Summary collapse

Methods inherited from Pagerduty

#get_incident, #trigger

Constructor Details

#initialize(service_key, incident_key) ⇒ PagerdutyIncident

Returns a new instance of PagerdutyIncident.



52
53
54
55
# File 'lib/pagerduty.rb', line 52

def initialize(service_key, incident_key)
  super service_key
  @incident_key = incident_key
end

Instance Method Details

#acknowledge(description, details = {}) ⇒ Object



57
58
59
60
61
62
# File 'lib/pagerduty.rb', line 57

def acknowledge(description, details = {})
  resp = api_call("acknowledge", description, details = {})
  throw PagerdutyException.new(self, resp) unless resp["status"] == "success"
  
  self
end

#resolve(description, details = {}) ⇒ Object



64
65
66
67
68
69
# File 'lib/pagerduty.rb', line 64

def resolve(description, details = {})
  resp = api_call("resolve", description, details = {})
  throw PagerdutyException.new(self, resp) unless resp["status"] == "success"
  
  self
end