Last active
December 22, 2015 11:39
-
-
Save samjsharpe/6467286 to your computer and use it in GitHub Desktop.
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 '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