Created
August 26, 2012 03:29
-
-
Save rtekie/3473576 to your computer and use it in GitHub Desktop.
Python example of using API to notify CronSentry upon a job completion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python example of using API to notify CronSentry upon a job completion | |
# For API documentation please go to http://www.cronsentry.com/help#api | |
import urllib | |
import requests | |
# set POST variables | |
url = 'http://api.cronsentry.com/api/v1/notifications' | |
parameters = { | |
'api_key' : 'YOUR_API_KEY', | |
'job_name' : urllib.quote_plus('Your job name'), | |
'status' : 1, | |
'message' : urllib.quote_plus('Please change me') | |
} | |
# do POST | |
response = requests.post(url, data = parameters) | |
# check response | |
print response.status_code | |
print response.text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment