Skip to content

Instantly share code, notes, and snippets.

@ryanhoskin
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanhoskin/6fbef04ab3aa0c489ff7 to your computer and use it in GitHub Desktop.
Save ryanhoskin/6fbef04ab3aa0c489ff7 to your computer and use it in GitHub Desktop.
Get who's on-call for an escalation policy
#!/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