Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F35490263
raw-paste-data.txt
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
herron
Aug 25 2022, 10:18 PM
2022-08-25 22:18:58 (UTC+0)
Size
813 B
Referenced Files
None
Subscribers
None
raw-paste-data.txt
View Options
# quick-n-dirty new incident example via dispatch api
import requests
import json
login_endpoint = 'https://dispatch-keith.wmcloud.org/api/v1/wikimedia/auth/login'
login_data = '{ "email": "me@email.address", "projects": [ ], "organizations": [ ], "password": "secret" }'
login = requests.post(login_endpoint, data=login_data, headers='').json()
headers = f"""{{"Authorization": "Bearer {login['token']}"}}"""
pita = json.loads(headers)
incident_endpoint = 'https://dispatch-keith.wmcloud.org/api/v1/wikimedia/incidents'
new_incident_data = '{ "title": "testing", "description": "testing api creation", "project": { "name": "sre" }, "incident_priority": { "name": "Unbreak Now!" }, "incdient_type": { "name": "Outage" } }'
print(requests.post(incident_endpoint, data=new_incident_data, headers=pita).json())
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9722585
Default Alt Text
raw-paste-data.txt (813 B)
Attached To
Mode
P33166 (An Untitled Masterwork)
Attached
Detach File
Event Timeline
Log In to Comment