Skip to content

Instantly share code, notes, and snippets.

@x0x8x
Forked from baskarp/pagerduty.bat
Created May 12, 2017 09:56
Show Gist options
  • Select an option

  • Save x0x8x/48e558aaf0b27fa8e67273fc029ecdac to your computer and use it in GitHub Desktop.

Select an option

Save x0x8x/48e558aaf0b27fa8e67273fc029ecdac to your computer and use it in GitHub Desktop.
Invoke PagerDuty using cURL from Windows
@echo off
:: Download cURL with SSL support from here: http://www.paehl.com/open_source/?CURL_7.28.0:
:: Extract curl.exe in the same directory as this bat file
:: Usage: pagerduty.bat service_key event_type description incident_key
:: event_types = (trigger | acknowledge | resolve)
::
set service_key=%1
set service_key=%service_key:"=\"%
set event_type=%2
set event_type=%event_type:"=\"%
set description=%3
set description=%description:"=\"%
set incident_key=%4
set incident_key=%incident_key:"=\"%
curl -H "Content-type: application/json" -k -X POST -d "{\"service_key\": %service_key%, \"event_type\": %event_type%, \"incident_key\": %incident_key%, \"description\": %description% }" "https://events.pagerduty.com/generic/2010-04-15/create_event.json"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment