PagerDuty -Zuweisungen liste leerPython

Python-Programme
Anonymous
 PagerDuty -Zuweisungen liste leer

Post by Anonymous »

Wie kann ich "Zuweisungen" der Vorfälle in PagerDuty erhalten? Ich habe ein Python -Skript, das Informationen zu einem bestimmten Vorfall zurückgibt, aber die Liste mit Aufgaben ist leer. < /P>

Code: Select all

#!/usr/bin/env python

import requests
import json
API_KEY = 'iiiiiiiiiiiiiiiiii'

# incident ID
ID = 'PPPPP'

def get_incident():
url = 'https://api.pagerduty.com/incidents/{id}'.format(id=ID)
headers = {
'Accept': 'application/vnd.pagerduty+json;version=2',
'Authorization': 'Token token={token}'.format(token=API_KEY)
}

params = {
'include': 'assignees',
'time_zone': 'Europe/Sofia'
}

r = requests.get(url, headers=headers,data=json.dumps(params))
print ('Status Code: {code}'.format(code=r.status_code))
print (r.json())

if __name__ == '__main__':
get_incident()
In their documentation here there are entries for that key, see on the picture bellow:

Image


How can I achieve that?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post