allomov
6/13/2014 - 2:20 PM

remove-fog-resource.sh

# Gemfile:
# source 'https://rubygems.org'
# gem 'fog', path: '~/fun/github/fog'

require 'fog'
require 'yaml'

config = YAML.load_file('~/.fog.yml')
google_config = config['google']

storage = Fog::Storage::Google.new(google_config['storage'])
compute = Fog::Compute::Google.new(google_config['compute'])


compute.servers.each do |s|
  s.destroy(false) if s.name =~ /fog-test/
end

compute.disks.each do |d|
  d.destroy if d.name =~ /fog-test/
end