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
28
29
30
31
32
33
34
|
# File 'lib/pagerduty/requests/incident.rb', line 28
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
59
60
61
62
63
64
65
|
# File 'lib/pagerduty/requests/incident.rb', line 59
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
24
25
26
|
# File 'lib/pagerduty/requests/incident.rb', line 21
def notes
Notes.new(curl({
uri: "https://#@@subdomain.pagerduty.com/api/v1/incidents/#{self.id}/notes",
method: 'GET'
}))
end
|
#reassign(options = {}) ⇒ Object
44
45
46
47
48
49
50
|
# File 'lib/pagerduty/requests/incident.rb', line 44
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
36
37
38
39
40
41
42
|
# File 'lib/pagerduty/requests/incident.rb', line 36
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
|