Last active
August 29, 2015 14:02
-
-
Save ryanhoskin/6fbef04ab3aa0c489ff7 to your computer and use it in GitHub Desktop.
Get who's on-call for an escalation policy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import requests | |
SUBDOMAIN='pdt-dank' | |
API_ACCESS_KEY='HjEs6A6KozribnKqm1tX' | |
def get_escalation_policy_oncall(): | |
url = 'https://{0}.pagerduty.com/api/v1/escalation_policies/on_call'.format(SUBDOMAIN) | |
headers = { | |
'Authorization': 'Token token={0}'.format(API_ACCESS_KEY), | |
'Content-Type': 'application/json', | |
} | |
r = requests.get(url, headers=headers) | |
print r.status_code | |
print r.json() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment