Skip to content

Instantly share code, notes, and snippets.

@heffergm
Created March 11, 2016 12:08
Show Gist options
  • Save heffergm/7f163bb5889636fd8408 to your computer and use it in GitHub Desktop.
Save heffergm/7f163bb5889636fd8408 to your computer and use it in GitHub Desktop.
pd
#!/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