itjamie / pagerdutywhosoncall
Pagerduty class for checking who is oncall including override schedules
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/itjamie/pagerdutywhosoncall
This package is not auto-updated.
Last update: 2021-11-13 10:55:24 UTC
README
(c) 2016 Jamie Murphy jamiemurphyit@gmail.com Installation
$ composer require itjamie/pagerdutywhosoncall
Basic Usage
require 'vendor/autoload.php'; // if using php composer date_default_timezone_set('UTC'); // set the timezone of your php env to be the same you pass to pagerduty $pagerdutyapi = new PagerDutyWhosOncall(array( 'baseurl' => 'https://instancename.pagerduty.com/api/v1/', 'apikey' => 'placeholderforyourapi', 'debug' => false, 'timezone' => 'UTC' // This is the timezone that will be passed to pagerduty. https://developer.pagerduty.com/documentation/rest/types#timezone ) ); $scheduleid = "abc123"; echo ' Oncall Now :'.PHP_EOL; $result = $pagerdutyapi->whoIsOnCall( $scheduleid ); var_dump($result); echo ' Oncall in one hour :'.PHP_EOL; $time = time()+60*60; $result = $pagerdutyapi->whoIsOnCall( $scheduleid, $time ); var_dump($result);
Credits
Thanks to ozzd/PagerdutyPHP for some of the original code.