Skip to content

Instantly share code, notes, and snippets.

@Ebtoulson
Created April 17, 2014 15:56
Show Gist options
  • Save Ebtoulson/10994000 to your computer and use it in GitHub Desktop.
Save Ebtoulson/10994000 to your computer and use it in GitHub Desktop.
require 'json'
require 'cgi'
server = "localhost:8098"
bucket = "portal_development_tokens"
request = `curl http://#{server}/buckets/#{bucket}/keys?keys=true`
keys = JSON.parse(request)["keys"]
keys.each do |key|
encoded_key = CGI.escape(key)
url = "http://#{server}/buckets/#{bucket}/keys/#{encoded_key}"
`curl -v -X DELETE #{url}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment