Created
April 30, 2014 17:24
-
-
Save julianeon/e17f74b8952c7c288038 to your computer and use it in GitHub Desktop.
Returns the information from a single incident.
This file contains 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
require 'json' | |
incident_id="CHANGE_THIS" | |
subdomain="CHANGE_THIS" | |
api_key="CHANGE_THIS" | |
endpoint="https://#{subdomain}.pagerduty.com/api/v1/incidents/#{incident_id}" | |
def curl_get_id(tokennum,endpoint) | |
curl_command='curl -H "Content-type: application/json" -H "Authorization: Token token='+tokennum+'" -X GET -G "'+endpoint+'"' | |
end | |
def print_results(curl_get_all) | |
IO.popen(curl_get_all).each do |line| | |
parsed=JSON.parse(line) | |
puts parsed | |
end | |
end | |
curl_cmd=curl_get_id(api_key,endpoint) | |
puts curl_cmd | |
print_results(curl_cmd) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment