Class: PagerDuty::Resource::Incident

Inherits:
Full
  • Object
show all
Defined in:
lib/pagerduty/resource/incident.rb

Instance Attribute Summary

Attributes inherited from Full

#apikey, #subdomain

Instance Method Summary collapse

Methods inherited from Full

#Incident, #Schedule, #api_call, #initialize

Constructor Details

This class inherits a constructor from PagerDuty::Full

Instance Method Details

#count(assigned_to_user = nil, incident_key = nil, status = nil, service = nil, since_date = nil, sort_by = nil, until_date = nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/pagerduty/resource/incident.rb', line 6

def count(
  assigned_to_user = nil, incident_key = nil, status = nil, service = nil,
  since_date = nil, sort_by = nil, until_date = nil
)
  res = api_call("incidents/count", {
    :assigned_to_user => assigned_to_user,
    :incident_key => incident_key,
    :service  => service,
    :since    => since_date,
    :sort_by  => sort_by,
    :status   => status,
    :until    => until_date,
  })
  case res
  when Net::HTTPSuccess
    JSON.parse(res.body)
  else
    res.error!
  end
end

#search(assigned_to_user = nil, incident_key = nil, status = nil, service = nil, since_date = nil, sort_by = nil, until_date = nil) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/pagerduty/resource/incident.rb', line 27

def search(
  assigned_to_user = nil, incident_key = nil, status = nil, service = nil,
  since_date = nil, sort_by = nil, until_date = nil
)
  res = api_call("incidents", {
    :assigned_to_user => assigned_to_user,
    :incident_key => incident_key,
    :service  => service,
    :since    => since_date,
    :sort_by  => sort_by,
    :status   => status,
    :until    => until_date,
  })
  case res
  when Net::HTTPSuccess
    JSON.parse(res.body)
  else
    res.error!
  end
end