Class: PagerDutyRestClient
- Inherits:
-
Object
- Object
- PagerDutyRestClient
- 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
- #get_schedule_data(code, from, to, extra_args = {}) ⇒ Object
-
#initialize(org_name, username, password) ⇒ PagerDutyRestClient
constructor
A new instance of PagerDutyRestClient.
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 |