Created
March 11, 2016 12:08
-
-
Save heffergm/7f163bb5889636fd8408 to your computer and use it in GitHub Desktop.
pd
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
#!/usr/bin/env ruby | |
require 'pagerduty' | |
pagerduty = Pagerduty.new('you_service_key_here') | |
incident = pagerduty.trigger( | |
"THIS IS A TEST", | |
incident_key: "this_is_a_test" | |
) | |
arr = [] | |
1024.times do | |
arr << 'a' | |
end | |
details = arr.join('') | |
puts "Length of details: #{details.length}" | |
sleep 5 | |
begin | |
pagerduty.get_incident('this_is_a_test').resolve( | |
details: details.slice(0..1024) | |
) | |
rescue Net::HTTPServerException => error | |
puts error.response.body | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment