Skip to content

Instantly share code, notes, and snippets.

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