Skip to content

Instantly share code, notes, and snippets.

@ryanhoskin
Created June 24, 2014 15:39
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/ac325c19800c879ea3e9 to your computer and use it in GitHub Desktop.
Save ryanhoskin/ac325c19800c879ea3e9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import requests
SUBDOMAIN='pdt-dank'
API_ACCESS_KEY='HjEs6A6KozribnKqm1tX'
def get_incidents():
headers = {
'Authorization': 'Token token={0}'.format(API_ACCESS_KEY),
'Content-type': 'application/json',
}
payload = {
'status':'triggered,acknowledged',
}
r = requests.get(
'https://{0}.pagerduty.com/api/v1/incidents'.format(SUBDOMAIN),
headers=headers,
params=payload,
)
print r.status_code
print r.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment