Skip to content

Instantly share code, notes, and snippets.

@samjsharpe
Last active December 22, 2015 11:39
Show Gist options
  • Save samjsharpe/6467286 to your computer and use it in GitHub Desktop.
Save samjsharpe/6467286 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'fastly'
service_id = 'deadbeefdeadbeef'
fastly = Fastly.new(:api_key => 'deadbeefdeadbeefdeadbeef')
service = fastly.get_service(service_id)
latest_version = service.version
existing_domains = Array.new
domain_lister = Fastly::Client.new(:api_key => 'deadbeefdeadbeef')
domain_lister.get(Fastly::Domain.list_path(:service_id => service.id, :version => latest_version.number)).each do |domain|
existing_domains.push domain['name']
end
existing_domains.each do |domain|
puts "Existing domain: #{domain}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment