Class: Pagerduty::Incidents::Incident
- Inherits:
-
Object
- Object
- Pagerduty::Incidents::Incident
show all
- Includes:
- Core
- Defined in:
- lib/pagerduty/models/incident.rb,
lib/pagerduty/requests/incident.rb
Instance Method Summary
collapse
Methods included from Core
#curl, #has_requirements?
Constructor Details
#initialize(options = {}) ⇒ Incident
Returns a new instance of Incident.
6
7
8
9
|
# File 'lib/pagerduty/requests/incident.rb', line 6
def initialize(options={})
super
@@subdomain = Pagerduty.class_variable_get(:@@subdomain)
end
|
Instance Method Details
#acknowledge ⇒ Object
25
26
27
28
29
30
31
|
# File 'lib/pagerduty/requests/incident.rb', line 25
def acknowledge
curl({
uri: "https://#@@subdomain.pagerduty.com/api/v1/incidents/#{self.id}/acknowledge",
data: { 'requester_id' => self.assigned_to_user.id },
method: 'PUT'
})
end
|
#inspect ⇒ Object
11
12
13
14
15
16
17
18
19
|
# File 'lib/pagerduty/requests/incident.rb', line 11
def inspect
puts "<Pagerduty::#{self.class}"
self.attributes.each { |attr,val|
puts "\t#{attr}=#{val.class == Class ? "BLOCK" : val.inspect}"
}
puts ">"
self.attributes
end
|
#log_entries(options = {}) ⇒ Object
56
57
58
59
60
61
62
|
# File 'lib/pagerduty/requests/incident.rb', line 56
def log_entries(options={})
LogEntries.new(curl({
uri: "https://#@@subdomain.pagerduty.com/api/v1/incidents/#{self.id}/log_entries",
params: options,
method: 'GET'
}))
end
|
#notes ⇒ Object
21
22
23
|
# File 'lib/pagerduty/requests/incident.rb', line 21
def notes
super(self.id)
end
|
#reassign(options = {}) ⇒ Object
41
42
43
44
45
46
47
|
# File 'lib/pagerduty/requests/incident.rb', line 41
def reassign(options={})
curl({
uri: "https://#@@subdomain.pagerduty.com/api/v1/incidents/#{self.id}/resolve",
data: { 'requester_id' => self.assigned_to_user.id, }.merge(options),
method: 'PUT'
})
end
|
#resolve ⇒ Object
33
34
35
36
37
38
39
|
# File 'lib/pagerduty/requests/incident.rb', line 33
def resolve
curl({
uri: "https://#@@subdomain.pagerduty.com/api/v1/incidents/#{self.id}/resolve",
data: { 'requester_id' => self.assigned_to_user.id },
method: 'PUT'
})
end
|