Class: PagerDutyRestClient

Inherits:
Object
  • Object
show all
Defined in:
lib/pager_duty_rest_client.rb,
lib/pager_duty_rest_client/version.rb

Constant Summary collapse

VERSION =
'0.1'

Instance Method Summary collapse

Constructor Details

#initialize(org_name, username, password) ⇒ PagerDutyRestClient

Returns a new instance of PagerDutyRestClient.



7
8
9
10
11
# File 'lib/pager_duty_rest_client.rb', line 7

def initialize(org_name, username, password)
  @org_name = org_name
  @username = username
  @password = password
end

Instance Method Details

#get_schedule_data(code, from, to, extra_args = {}) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/pager_duty_rest_client.rb', line 13

def get_schedule_data(code, from, to, extra_args = {})
  path = "/api/v1/schedules/#{code}/entries"
  form_data = {
    'since' => pagerduty_time_string(from),
    'until' => pagerduty_time_string(to)
  }.merge(extra_args)
  authenticated_get(path, form_data)
end