Skip to content

Instantly share code, notes, and snippets.

@joewilliams
Created August 11, 2009 17:42
Show Gist options
  • Save joewilliams/165993 to your computer and use it in GitHub Desktop.
Save joewilliams/165993 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'right_slicehost'
API_KEY="yourapikey"
ZONE = "yourdomain.com."
slicehost = Rightscale::Slicehost.new(API_KEY)
zone_id = nil
slicehost.list_zones.each do |zone|
if zone[:origin] == ZONE
zone_id = zone[:sls_id]
end
end
if zone_id
counter = 0
slicehost.list_records.each do |record|
if record.has_value? zone_id
puts "Record: #{record[:name]}"
puts "Data: #{record[:data]}"
puts "Type: #{record[:record_type]}"
puts "TTL: #{record[:ttl]}"
puts "Aux: #{record[:aux]}"
puts "========================"
counter = counter + 1
end
end
puts "displayed #{counter} records"
else
puts "#{ZONE} not found"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment