Class: PagerdutyIncident
Constant Summary
Constants inherited from Pagerduty
Instance Attribute Summary collapse
-
#incident_key ⇒ Object
readonly
Returns the value of attribute incident_key.
Attributes inherited from Pagerduty
Instance Method Summary collapse
-
#acknowledge(description = nil, details = nil) ⇒ PagerdutyIncident
Acknowledge the referenced incident.
-
#initialize(service_key, incident_key, options = {}) ⇒ PagerdutyIncident
constructor
A new instance of PagerdutyIncident.
-
#resolve(description = nil, details = nil) ⇒ PagerdutyIncident
Resolve the referenced incident.
- #trigger(description, options = {}) ⇒ Object
Methods inherited from Pagerduty
Constructor Details
#initialize(service_key, incident_key, options = {}) ⇒ PagerdutyIncident
Returns a new instance of PagerdutyIncident.
126 127 128 129 |
# File 'lib/pagerduty.rb', line 126 def initialize(service_key, incident_key, = {}) super service_key, @incident_key = incident_key end |
Instance Attribute Details
#incident_key ⇒ Object (readonly)
Returns the value of attribute incident_key.
119 120 121 |
# File 'lib/pagerduty.rb', line 119 def incident_key @incident_key end |
Instance Method Details
#acknowledge(description = nil, details = nil) ⇒ PagerdutyIncident
Acknowledge the referenced incident. While an incident is acknowledged, it won’t generate any additional notifications, even if it receives new trigger events. Send PagerDuty an acknowledge event when you know someone is presently working on the problem.
153 154 155 |
# File 'lib/pagerduty.rb', line 153 def acknowledge(description = nil, details = nil) modify_incident("acknowledge", description, details) end |
#resolve(description = nil, details = nil) ⇒ PagerdutyIncident
Resolve the referenced incident. Once an incident is resolved, it won’t generate any additional notifications. New trigger events with the same incident_key as a resolved incident won’t re-open the incident. Instead, a new incident will be created. Send PagerDuty a resolve event when the problem that caused the initial trigger event has been fixed.
174 175 176 |
# File 'lib/pagerduty.rb', line 174 def resolve(description = nil, details = nil) modify_incident("resolve", description, details) end |
#trigger(description, options = {}) ⇒ Object
133 134 135 |
# File 'lib/pagerduty.rb', line 133 def trigger(description, = {}) super(description, { incident_key: incident_key }.merge()) end |